datapath: Inline flow_cast().
authorBen Pfaff <blp@nicira.com>
Fri, 23 Jul 2010 20:05:25 +0000 (13:05 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 3 Aug 2010 03:16:32 +0000 (20:16 -0700)
This function is both trivial and on the packet processing fast path, so
expand it inline.

datapath/flow.c
datapath/flow.h

index 7b3be47..8b736c8 100644 (file)
@@ -319,11 +319,6 @@ int flow_extract(struct sk_buff *skb, u16 in_port, struct odp_flow_key *key)
        return retval;
 }
 
-struct sw_flow *flow_cast(const struct tbl_node *node)
-{
-       return container_of(node, struct sw_flow, tbl_node);
-}
-
 u32 flow_hash(const struct odp_flow_key *key)
 {
        return jhash2((u32*)key, sizeof *key / sizeof(u32), hash_seed);
index f0e7697..534c7af 100644 (file)
@@ -50,7 +50,6 @@ void flow_deferred_free_acts(struct sw_flow_actions *);
 int flow_extract(struct sk_buff *, u16 in_port, struct odp_flow_key *);
 void flow_used(struct sw_flow *, struct sk_buff *);
 
-struct sw_flow *flow_cast(const struct tbl_node *);
 u32 flow_hash(const struct odp_flow_key *key);
 int flow_cmp(const struct tbl_node *, void *target);
 void flow_free_tbl(struct tbl_node *);
@@ -58,4 +57,9 @@ void flow_free_tbl(struct tbl_node *);
 int flow_init(void);
 void flow_exit(void);
 
+static inline struct sw_flow *flow_cast(const struct tbl_node *node)
+{
+       return container_of(node, struct sw_flow, tbl_node);
+}
+
 #endif /* flow.h */