net/sched: remove block pointer from common offload structure
Based on feedback from Jiri avoid carrying a pointer to the tcf_block structure in the tc_cls_common_offload structure. Instead store a flag in driver private data which indicates if offloads apply to a shared block at block binding time. Suggested-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2e7ae67b5f
commit
d6787147e1
@@ -485,8 +485,7 @@ static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
|
||||
struct tcf_block *block = tp->chain->block;
|
||||
struct tc_cls_u32_offload cls_u32 = {};
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, h->flags, block,
|
||||
extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, h->flags, extack);
|
||||
cls_u32.command = TC_CLSU32_DELETE_HNODE;
|
||||
cls_u32.hnode.divisor = h->divisor;
|
||||
cls_u32.hnode.handle = h->handle;
|
||||
@@ -504,7 +503,7 @@ static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
|
||||
bool offloaded = false;
|
||||
int err;
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, flags, block, extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, flags, extack);
|
||||
cls_u32.command = TC_CLSU32_NEW_HNODE;
|
||||
cls_u32.hnode.divisor = h->divisor;
|
||||
cls_u32.hnode.handle = h->handle;
|
||||
@@ -530,8 +529,7 @@ static void u32_remove_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
|
||||
struct tcf_block *block = tp->chain->block;
|
||||
struct tc_cls_u32_offload cls_u32 = {};
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, block,
|
||||
extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, extack);
|
||||
cls_u32.command = TC_CLSU32_DELETE_KNODE;
|
||||
cls_u32.knode.handle = n->handle;
|
||||
|
||||
@@ -548,7 +546,7 @@ static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
|
||||
bool skip_sw = tc_skip_sw(flags);
|
||||
int err;
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, flags, block, extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, flags, extack);
|
||||
cls_u32.command = TC_CLSU32_REPLACE_KNODE;
|
||||
cls_u32.knode.handle = n->handle;
|
||||
cls_u32.knode.fshift = n->fshift;
|
||||
@@ -1172,12 +1170,10 @@ static int u32_reoffload_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
|
||||
bool add, tc_setup_cb_t *cb, void *cb_priv,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
struct tcf_block *block = tp->chain->block;
|
||||
struct tc_cls_u32_offload cls_u32 = {};
|
||||
int err;
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, ht->flags, block,
|
||||
extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, ht->flags, extack);
|
||||
cls_u32.command = add ? TC_CLSU32_NEW_HNODE : TC_CLSU32_DELETE_HNODE;
|
||||
cls_u32.hnode.divisor = ht->divisor;
|
||||
cls_u32.hnode.handle = ht->handle;
|
||||
@@ -1199,8 +1195,7 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
|
||||
struct tc_cls_u32_offload cls_u32 = {};
|
||||
int err;
|
||||
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, block,
|
||||
extack);
|
||||
tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, extack);
|
||||
cls_u32.command = add ?
|
||||
TC_CLSU32_REPLACE_KNODE : TC_CLSU32_DELETE_KNODE;
|
||||
cls_u32.knode.handle = n->handle;
|
||||
|
Reference in New Issue
Block a user