datapath: backport: ovs: use nla_put_u64_64bit()
authorPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 16:52:11 +0000 (09:52 -0700)
committerPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 17:25:09 +0000 (10:25 -0700)
Upstream commit:

    commit 0238b7204b7ff1bad1d2d4489f010d670cbd89f2
    Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>

    ovs: use nla_put_u64_64bit()

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/datapath.c
datapath/linux/compat/include/net/netlink.h

index 1700caa..9ce611f 100644 (file)
@@ -787,7 +787,8 @@ static int ovs_flow_cmd_fill_stats(const struct sw_flow *flow,
        ovs_flow_stats_get(flow, &stats, &used, &tcp_flags);
 
        if (used &&
-           nla_put_u64(skb, OVS_FLOW_ATTR_USED, ovs_flow_used_time(used)))
+           nla_put_u64_64bit(skb, OVS_FLOW_ATTR_USED, ovs_flow_used_time(used),
+                             OVS_FLOW_ATTR_PAD))
                return -EMSGSIZE;
 
        if (stats.n_packets &&
index 59826ba..07bd873 100644 (file)
@@ -142,5 +142,12 @@ void rpl___nla_put_64bit(struct sk_buff *skb, int attrtype, int attrlen,
 #define __nla_reserve_64bit rpl___nla_reserve_64bit
 struct nlattr *rpl___nla_reserve_64bit(struct sk_buff *skb, int attrtype,
                                   int attrlen, int padattr);
+
+static inline int nla_put_u64_64bit(struct sk_buff *skb, int attrtype,
+                                    u64 value, int padattr)
+{
+        return nla_put_64bit(skb, attrtype, sizeof(u64), &value, padattr);
+}
+
 #endif
 #endif /* net/netlink.h */