Re: [patch net-next RFC 1/4] openvswitch: split flow structures into ovs specific and generic ones
From: Thomas Graf <tgraf@suug.ch>
Date: 2014-03-20 13:04:30
On 03/19/14 at 04:33pm, Jiri Pirko wrote:
After this, flow related structures can be used in other code.
LGTM. Definitely makes sense to share flow definition between OVS and a possible HW switch API.
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
+ /* Ethernet+IPv4 specific members. */
+ unsigned char ar_sha[ETH_ALEN]; /* sender hardware address */
+ unsigned char ar_sip[4]; /* sender IP address */
+ unsigned char ar_tha[ETH_ALEN]; /* target hardware address */
+ unsigned char ar_tip[4]; /* target IP address */
+} __packed;
-struct sw_flow_mask {
+struct ovs_flow_mask {
int ref_count;
struct rcu_head rcu;Perhaps move rcu_head to the end if you are touching it anyway.
quoted hunk ↗ jump to hunk
struct list_head list; - struct sw_flow_key_range range; - struct sw_flow_key key; + struct sw_flow_mask mask; }; -struct sw_flow_match { +struct ovs_flow_match { struct sw_flow_key *key; struct sw_flow_key_range range; struct sw_flow_mask *mask;@@ -163,36 +106,20 @@ struct sw_flow_stats { }; }; -struct sw_flow { +struct ovs_flow { struct rcu_head rcu;
Same here.
struct hlist_node hash_node[2]; u32 hash; - struct sw_flow_key key; - struct sw_flow_key unmasked_key; - struct sw_flow_mask *mask; + struct sw_flow flow; struct sw_flow_actions __rcu *sf_acts; struct sw_flow_stats stats; };