Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
flow.h File Reference
#include <linux/kernel.h>
#include <linux/netlink.h>
#include <linux/openvswitch.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/rcupdate.h>
#include <linux/if_ether.h>
#include <linux/in6.h>
#include <linux/jiffies.h>
#include <linux/time.h>
#include <linux/flex_array.h>
#include <net/inet_ecn.h>

Go to the source code of this file.

Data Structures

struct  sw_flow_actions
 
struct  sw_flow_key
 
struct  sw_flow
 
struct  arp_eth_header
 
struct  flow_table
 

Macros

#define FLOW_BUFSIZE   144
 
#define MAX_ACTIONS_BUFSIZE   (16 * 1024)
 
#define TBL_MIN_BUCKETS   1024
 

Functions

int ovs_flow_init (void)
 
void ovs_flow_exit (void)
 
struct sw_flowovs_flow_alloc (void)
 
void ovs_flow_deferred_free (struct sw_flow *)
 
void ovs_flow_free (struct sw_flow *flow)
 
struct sw_flow_actionsovs_flow_actions_alloc (const struct nlattr *)
 
void ovs_flow_deferred_free_acts (struct sw_flow_actions *)
 
int ovs_flow_extract (struct sk_buff *, u16 in_port, struct sw_flow_key *, int *key_lenp)
 
void ovs_flow_used (struct sw_flow *, struct sk_buff *)
 
u64 ovs_flow_used_time (unsigned long flow_jiffies)
 
int ovs_flow_to_nlattrs (const struct sw_flow_key *, struct sk_buff *)
 
int ovs_flow_from_nlattrs (struct sw_flow_key *swkey, int *key_lenp, const struct nlattr *)
 
int ovs_flow_metadata_from_nlattrs (u32 *priority, u16 *in_port, const struct nlattr *)
 
struct sw_flowovs_flow_tbl_lookup (struct flow_table *table, struct sw_flow_key *key, int len)
 
void ovs_flow_tbl_destroy (struct flow_table *table)
 
void ovs_flow_tbl_deferred_destroy (struct flow_table *table)
 
struct flow_tableovs_flow_tbl_alloc (int new_size)
 
struct flow_tableovs_flow_tbl_expand (struct flow_table *table)
 
struct flow_tableovs_flow_tbl_rehash (struct flow_table *table)
 
void ovs_flow_tbl_insert (struct flow_table *table, struct sw_flow *flow)
 
void ovs_flow_tbl_remove (struct flow_table *table, struct sw_flow *flow)
 
u32 ovs_flow_hash (const struct sw_flow_key *key, int key_len)
 
struct sw_flowovs_flow_tbl_next (struct flow_table *table, u32 *bucket, u32 *idx)
 

Variables

struct arp_eth_header __packed
 
const int ovs_key_lens [OVS_KEY_ATTR_MAX+1]
 

Macro Definition Documentation

#define FLOW_BUFSIZE   144

Definition at line 158 of file flow.h.

#define MAX_ACTIONS_BUFSIZE   (16 * 1024)

Definition at line 166 of file flow.h.

#define TBL_MIN_BUCKETS   1024

Definition at line 167 of file flow.h.

Function Documentation

struct sw_flow_actions* ovs_flow_actions_alloc ( const struct nlattr )
read

Definition at line 201 of file flow.c.

struct sw_flow* ovs_flow_alloc ( void  )
read

Definition at line 218 of file flow.c.

void ovs_flow_deferred_free ( struct sw_flow )

Definition at line 422 of file flow.c.

void ovs_flow_deferred_free_acts ( struct sw_flow_actions )

Definition at line 429 of file flow.c.

void ovs_flow_exit ( void  )

Definition at line 1333 of file flow.c.

int ovs_flow_extract ( struct sk_buff skb,
u16  in_port,
struct sw_flow_key key,
int key_lenp 
)

ovs_flow_extract - extracts a flow key from an Ethernet frame. : sk_buff that contains the frame, with skb->data pointing to the Ethernet header : port number on which was received. : output flow key : length of output flow key

The caller must ensure that skb->len >= ETH_HLEN.

Returns 0 if successful, otherwise a negative errno value.

Initializes header pointers as follows:

  • skb->network_header: just past the Ethernet header, or just past the VLAN header, to the first byte of the Ethernet payload.
  • skb->transport_header: If key->dl_type is ETH_P_IP or ETH_P_IPV6 on output, then just past the IP header, if one is present and of a correct length, otherwise the same as skb->network_header. For other key->dl_type values it is left untouched.

Definition at line 596 of file flow.c.

void ovs_flow_free ( struct sw_flow flow)

Definition at line 403 of file flow.c.

int ovs_flow_from_nlattrs ( struct sw_flow_key swkey,
int key_lenp,
const struct nlattr attr 
)

ovs_flow_from_nlattrs - parses Netlink attributes into a flow key. : receives the extracted flow key. : number of bytes used in . : Netlink attribute holding nested OVS_KEY_ATTR_* Netlink attribute sequence.

Definition at line 960 of file flow.c.

u32 ovs_flow_hash ( const struct sw_flow_key key,
int  key_len 
)

Definition at line 758 of file flow.c.

int ovs_flow_init ( void  )

Definition at line 1322 of file flow.c.

int ovs_flow_metadata_from_nlattrs ( u32 priority,
u16 in_port,
const struct nlattr attr 
)

ovs_flow_metadata_from_nlattrs - parses Netlink attributes into a flow key. : receives the extracted input port. : Netlink attribute holding nested OVS_KEY_ATTR_* Netlink attribute sequence.

This parses a series of Netlink attributes that form a flow key, which must take the same form accepted by flow_from_nlattrs(), but only enough of it to get the metadata, that is, the parts of the flow key that cannot be extracted from the packet itself.

Definition at line 1125 of file flow.c.

struct flow_table* ovs_flow_tbl_alloc ( int  new_size)
read

Definition at line 267 of file flow.c.

void ovs_flow_tbl_deferred_destroy ( struct flow_table table)

Definition at line 323 of file flow.c.

void ovs_flow_tbl_destroy ( struct flow_table table)

Definition at line 289 of file flow.c.

struct flow_table* ovs_flow_tbl_expand ( struct flow_table table)
read

Definition at line 398 of file flow.c.

void ovs_flow_tbl_insert ( struct flow_table table,
struct sw_flow flow 
)

Definition at line 784 of file flow.c.

struct sw_flow* ovs_flow_tbl_lookup ( struct flow_table table,
struct sw_flow_key key,
int  len 
)
read

Definition at line 763 of file flow.c.

struct sw_flow* ovs_flow_tbl_next ( struct flow_table table,
u32 bucket,
u32 idx 
)
read

Definition at line 331 of file flow.c.

struct flow_table* ovs_flow_tbl_rehash ( struct flow_table table)
read

Definition at line 393 of file flow.c.

void ovs_flow_tbl_remove ( struct flow_table table,
struct sw_flow flow 
)

Definition at line 793 of file flow.c.

int ovs_flow_to_nlattrs ( const struct sw_flow_key ,
struct sk_buff  
)

Definition at line 1159 of file flow.c.

void ovs_flow_used ( struct sw_flow ,
struct sk_buff  
)

Definition at line 181 of file flow.c.

u64 ovs_flow_used_time ( unsigned long  flow_jiffies)

Definition at line 110 of file flow.c.

Variable Documentation

const int ovs_key_lens[OVS_KEY_ATTR_MAX+1]

Definition at line 801 of file flow.c.