Skip to content

Commit a6e1693

Browse files
hadarhenziondavem330
authored andcommitted
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: 7091d8c ('net/sched: cls_flower: Add offload support using egress Hardware device') Signed-off-by: Hadar Hen Zion <[email protected]> Reported-by: Simon Horman <[email protected]> Tested-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 96d5822 commit a6e1693

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/sched/cls_flower.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,11 @@ static int fl_hw_replace_filter(struct tcf_proto *tp,
236236
int err;
237237

238238
if (!tc_can_offload(dev, tp)) {
239-
if (tcf_exts_get_dev(dev, &f->exts, &f->hw_dev))
239+
if (tcf_exts_get_dev(dev, &f->exts, &f->hw_dev) ||
240+
(f->hw_dev && !tc_can_offload(f->hw_dev, tp))) {
241+
f->hw_dev = dev;
240242
return tc_skip_sw(f->flags) ? -EINVAL : 0;
243+
}
241244
dev = f->hw_dev;
242245
tc->egress_dev = true;
243246
} else {

0 commit comments

Comments
 (0)