net: sched: fix tc_should_offload for specific clsact classes
When offloading classifiers such as u32 or flower to hardware, and the qdisc is clsact (TC_H_CLSACT), then we need to differentiate its classes, since not all of them handle ingress, therefore we must leave those in software path. Add a .tcf_cl_offload() callback, so we can generically handle them, tested on ixgbe. Fixes:10cbc68434
("net/sched: cls_flower: Hardware offloaded filters statistics support") Fixes:5b33f48842
("net/flower: Introduce hardware offload support") Fixes:a1b7c5fd7f
("net: sched: add cls_u32 offload hooks for netdevs") Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: John Fastabend <john.r.fastabend@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
a03e6fe569
commit
92c075dbde
@@ -440,7 +440,7 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, u32 handle)
|
||||
offload.type = TC_SETUP_CLSU32;
|
||||
offload.cls_u32 = &u32_offload;
|
||||
|
||||
if (tc_should_offload(dev, 0)) {
|
||||
if (tc_should_offload(dev, tp, 0)) {
|
||||
offload.cls_u32->command = TC_CLSU32_DELETE_KNODE;
|
||||
offload.cls_u32->knode.handle = handle;
|
||||
dev->netdev_ops->ndo_setup_tc(dev, tp->q->handle,
|
||||
@@ -457,7 +457,7 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp,
|
||||
struct tc_to_netdev offload;
|
||||
int err;
|
||||
|
||||
if (!tc_should_offload(dev, flags))
|
||||
if (!tc_should_offload(dev, tp, flags))
|
||||
return tc_skip_sw(flags) ? -EINVAL : 0;
|
||||
|
||||
offload.type = TC_SETUP_CLSU32;
|
||||
@@ -485,7 +485,7 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h)
|
||||
offload.type = TC_SETUP_CLSU32;
|
||||
offload.cls_u32 = &u32_offload;
|
||||
|
||||
if (tc_should_offload(dev, 0)) {
|
||||
if (tc_should_offload(dev, tp, 0)) {
|
||||
offload.cls_u32->command = TC_CLSU32_DELETE_HNODE;
|
||||
offload.cls_u32->hnode.divisor = h->divisor;
|
||||
offload.cls_u32->hnode.handle = h->handle;
|
||||
@@ -508,7 +508,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp,
|
||||
offload.type = TC_SETUP_CLSU32;
|
||||
offload.cls_u32 = &u32_offload;
|
||||
|
||||
if (tc_should_offload(dev, flags)) {
|
||||
if (tc_should_offload(dev, tp, flags)) {
|
||||
offload.cls_u32->command = TC_CLSU32_REPLACE_KNODE;
|
||||
offload.cls_u32->knode.handle = n->handle;
|
||||
offload.cls_u32->knode.fshift = n->fshift;
|
||||
|
Reference in New Issue
Block a user