diff options
author | Hadar Hen Zion <hadarh@mellanox.com> | 2016-12-04 16:25:19 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-05 23:06:58 +0300 |
commit | a6e169312971219a34927e8fdece60046fafb8ba (patch) | |
tree | 3dffea390e5937f265986672f53165ae34b8790d | |
parent | 96d5822c1d812ed30da035795a4408f43fe533f3 (diff) | |
download | linux-a6e169312971219a34927e8fdece60046fafb8ba.tar.xz |
net/sched: cls_flower: Set the filter Hardware device for all use-cases
Check if the returned device from tcf_exts_get_dev function supports tc
offload and in case the rule can't be offloaded, set the filter hw_dev
parameter to the original device given by the user.
The filter hw_device parameter should always be set by fl_hw_replace_filter
function, since this pointer is used by dump stats and destroy
filter for each flower rule (offloaded or not).
Fixes: 7091d8c7055d ('net/sched: cls_flower: Add offload support using egress Hardware device')
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Reported-by: Simon Horman <horms@verge.net.au>
Tested-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/sched/cls_flower.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index c5cea78491dc..29a9e6d9f274 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c @@ -236,8 +236,11 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, int err; if (!tc_can_offload(dev, tp)) { - if (tcf_exts_get_dev(dev, &f->exts, &f->hw_dev)) + if (tcf_exts_get_dev(dev, &f->exts, &f->hw_dev) || + (f->hw_dev && !tc_can_offload(f->hw_dev, tp))) { + f->hw_dev = dev; return tc_skip_sw(f->flags) ? -EINVAL : 0; + } dev = f->hw_dev; tc->egress_dev = true; } else { |