From 9d2094938de6e6d6503a3d0777f64cff945321c3 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 23 Jul 2010 13:05:25 -0700 Subject: [PATCH] datapath: Inline flow_cast(). This function is both trivial and on the packet processing fast path, so expand it inline. --- datapath/flow.c | 5 ----- datapath/flow.h | 6 +++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/datapath/flow.c b/datapath/flow.c index 7b3be47c..8b736c88 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -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); diff --git a/datapath/flow.h b/datapath/flow.h index f0e76975..534c7af2 100644 --- a/datapath/flow.h +++ b/datapath/flow.h @@ -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 */ -- 2.30.2