diff options
author | Thomas Graf <tgraf@suug.ch> | 2013-03-29 09:46:49 -0400 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2013-03-29 20:53:57 -0400 |
commit | c3ff8cfe3e7748a93c4815b76e464d54c7efd241 (patch) | |
tree | 4526700f7eda3334516e16076c0917c1bae5fbac /net/openvswitch/flow.h | |
parent | 32686a9d2988516788cfcc402e1355c1eba1186a (diff) |
openvswitch: Refine Netlink message size calculation and kill FLOW_BUFSIZE
Kills the FLOW_BUFSIZE constant which needs to be calculated manually
and replaces it with key_attr_size() based on nla_total_size().
Calculates the size of datapath messages instead of relying on
NLMSG_DEFAULT_SIZE and moves the existing message size calculations
into own functions for clarity.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/flow.h')
-rw-r--r-- | net/openvswitch/flow.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/net/openvswitch/flow.h b/net/openvswitch/flow.h index a7bb60ff3b5b..0875fde65b9c 100644 --- a/net/openvswitch/flow.h +++ b/net/openvswitch/flow.h | |||
@@ -138,27 +138,6 @@ int ovs_flow_extract(struct sk_buff *, u16 in_port, struct sw_flow_key *, | |||
138 | void ovs_flow_used(struct sw_flow *, struct sk_buff *); | 138 | void ovs_flow_used(struct sw_flow *, struct sk_buff *); |
139 | u64 ovs_flow_used_time(unsigned long flow_jiffies); | 139 | u64 ovs_flow_used_time(unsigned long flow_jiffies); |
140 | 140 | ||
141 | /* Upper bound on the length of a nlattr-formatted flow key. The longest | ||
142 | * nlattr-formatted flow key would be: | ||
143 | * | ||
144 | * struct pad nl hdr total | ||
145 | * ------ --- ------ ----- | ||
146 | * OVS_KEY_ATTR_PRIORITY 4 -- 4 8 | ||
147 | * OVS_KEY_ATTR_IN_PORT 4 -- 4 8 | ||
148 | * OVS_KEY_ATTR_SKB_MARK 4 -- 4 8 | ||
149 | * OVS_KEY_ATTR_ETHERNET 12 -- 4 16 | ||
150 | * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (outer VLAN ethertype) | ||
151 | * OVS_KEY_ATTR_8021Q 4 -- 4 8 | ||
152 | * OVS_KEY_ATTR_ENCAP 0 -- 4 4 (VLAN encapsulation) | ||
153 | * OVS_KEY_ATTR_ETHERTYPE 2 2 4 8 (inner VLAN ethertype) | ||
154 | * OVS_KEY_ATTR_IPV6 40 -- 4 44 | ||
155 | * OVS_KEY_ATTR_ICMPV6 2 2 4 8 | ||
156 | * OVS_KEY_ATTR_ND 28 -- 4 32 | ||
157 | * ------------------------------------------------- | ||
158 | * total 152 | ||
159 | */ | ||
160 | #define FLOW_BUFSIZE 152 | ||
161 | |||
162 | int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); | 141 | int ovs_flow_to_nlattrs(const struct sw_flow_key *, struct sk_buff *); |
163 | int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, | 142 | int ovs_flow_from_nlattrs(struct sw_flow_key *swkey, int *key_lenp, |
164 | const struct nlattr *); | 143 | const struct nlattr *); |