From: Andy Zhou Date: Wed, 31 Jul 2013 02:49:12 +0000 (-0700) Subject: datapath: always export priority and skb_mark in netlink message X-Git-Tag: sliver-openvswitch-2.0.90-1~34^2~5 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=dd62b991ec2472e13af681ca8c21872726c50eb4 datapath: always export priority and skb_mark in netlink message Handling of missing attributes in netlink can be tricky and turns out to be error prone. The value (savings in netlink bandwidth) does not seem to be significant enough to justify allowing them. This patch series make both kernel and userspace always export priority and skb_mark attribute. There will be follow on patches in the direction of making all attributes explicit. Signed-off-by: Andy Zhou Acked-by: Simon Horman Signed-off-by: Jesse Gross --- diff --git a/datapath/flow.c b/datapath/flow.c index 3acc74321..62fdf8588 100644 --- a/datapath/flow.c +++ b/datapath/flow.c @@ -1694,8 +1694,7 @@ int ovs_flow_to_nlattrs(const struct sw_flow_key *swkey, struct ovs_key_ethernet *eth_key; struct nlattr *nla, *encap; - if (output->phy.priority && - nla_put_u32(skb, OVS_KEY_ATTR_PRIORITY, output->phy.priority)) + if (nla_put_u32(skb, OVS_KEY_ATTR_PRIORITY, output->phy.priority)) goto nla_put_failure; if (swkey->tun_key.ipv4_dst && @@ -1715,8 +1714,7 @@ int ovs_flow_to_nlattrs(const struct sw_flow_key *swkey, goto nla_put_failure; } - if (output->phy.skb_mark && - nla_put_u32(skb, OVS_KEY_ATTR_SKB_MARK, output->phy.skb_mark)) + if (nla_put_u32(skb, OVS_KEY_ATTR_SKB_MARK, output->phy.skb_mark)) goto nla_put_failure; nla = nla_reserve(skb, OVS_KEY_ATTR_ETHERNET, sizeof(*eth_key));