Commit a6e16931 authored by Hadar Hen Zion's avatar Hadar Hen Zion Committed by David S. Miller

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: 7091d8c7 ('net/sched: cls_flower: Add offload support using egress Hardware device')
Signed-off-by: default avatarHadar Hen Zion <hadarh@mellanox.com>
Reported-by: default avatarSimon Horman <horms@verge.net.au>
Tested-by: default avatarSimon Horman <simon.horman@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 96d5822c
...@@ -236,8 +236,11 @@ static int fl_hw_replace_filter(struct tcf_proto *tp, ...@@ -236,8 +236,11 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
int err; int err;
if (!tc_can_offload(dev, tp)) { 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; return tc_skip_sw(f->flags) ? -EINVAL : 0;
}
dev = f->hw_dev; dev = f->hw_dev;
tc->egress_dev = true; tc->egress_dev = true;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment