net: sched: cls_flower: dump offload count value
authorVlad Buslov <vladbu@mellanox.com>
Fri, 7 Sep 2018 14:22:21 +0000 (17:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 10 Sep 2018 17:35:15 +0000 (10:35 -0700)
Change flower in_hw_count type to fixed-size u32 and dump it as
TCA_FLOWER_IN_HW_COUNT. This change is necessary to properly test shared
blocks and re-offload functionality.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sch_generic.h
include/uapi/linux/pkt_cls.h
net/sched/cls_flower.c

index fdaa5506e6f722fe69a797511e14c9ac85606bad..d326fd553b58fb77a75e850b4fb3d47385db8ca0 100644 (file)
@@ -362,7 +362,7 @@ static inline void tcf_block_offload_dec(struct tcf_block *block, u32 *flags)
 }
 
 static inline void
-tc_cls_offload_cnt_update(struct tcf_block *block, unsigned int *cnt,
+tc_cls_offload_cnt_update(struct tcf_block *block, u32 *cnt,
                          u32 *flags, bool add)
 {
        if (add) {
index be382fb0592d8e74a74a490d3914ab0207b81cdc..401d0c1e612d3a291688cf6f90e4d2803f7c09dd 100644 (file)
@@ -483,6 +483,8 @@ enum {
        TCA_FLOWER_KEY_ENC_OPTS,
        TCA_FLOWER_KEY_ENC_OPTS_MASK,
 
+       TCA_FLOWER_IN_HW_COUNT,
+
        __TCA_FLOWER_MAX,
 };
 
index 6fd9bdd937968abb92a4b120beeeac24145a825e..4b8dd37dd4f861fb52df2359012e88752e812ad3 100644 (file)
@@ -98,7 +98,7 @@ struct cls_fl_filter {
        struct list_head list;
        u32 handle;
        u32 flags;
-       unsigned int in_hw_count;
+       u32 in_hw_count;
        struct rcu_work rwork;
        struct net_device *hw_dev;
 };
@@ -1880,6 +1880,9 @@ static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,
        if (f->flags && nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags))
                goto nla_put_failure;
 
+       if (nla_put_u32(skb, TCA_FLOWER_IN_HW_COUNT, f->in_hw_count))
+               goto nla_put_failure;
+
        if (tcf_exts_dump(skb, &f->exts))
                goto nla_put_failure;