All drivers are converted to use block callbacks for TC_SETUP_CLS*.
So it is now safe to remove the calls to ndo_setup_tc from cls_*
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return bnxt_setup_tc_block(dev, type_data);
case TC_SETUP_MQPRIO: {
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return bnxt_vf_rep_setup_tc_block(dev, type_data);
default:
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSU32:
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return cxgb_setup_tc_block(dev, type_data);
default:
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSU32:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return ixgbe_setup_tc_block(dev, type_data);
case TC_SETUP_MQPRIO:
{
switch (type) {
#ifdef CONFIG_MLX5_ESWITCH
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return mlx5e_setup_tc_block(dev, type_data);
#endif
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return mlx5e_rep_setup_tc_block(dev, type_data);
default:
struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev);
switch (type) {
- case TC_SETUP_CLSMATCHALL:
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return mlxsw_sp_setup_tc_block(mlxsw_sp_port, type_data);
default:
enum tc_setup_type type, void *type_data)
{
switch (type) {
- case TC_SETUP_CLSBPF:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return nfp_bpf_setup_tc_block(netdev, type_data);
default:
enum tc_setup_type type, void *type_data)
{
switch (type) {
- case TC_SETUP_CLSFLOWER:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return nfp_flower_setup_tc_block(netdev, type_data);
default:
void *type_data)
{
switch (type) {
- case TC_SETUP_CLSMATCHALL:
- return 0; /* will be removed after conversion from ndo */
case TC_SETUP_BLOCK:
return dsa_slave_setup_tc_block(dev, type_data);
default:
enum tc_clsbpf_command cmd)
{
bool addorrep = cmd == TC_CLSBPF_ADD || cmd == TC_CLSBPF_REPLACE;
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
bool skip_sw = tc_skip_sw(prog->gen_flags);
struct tc_cls_bpf_offload cls_bpf = {};
cls_bpf.exts_integrated = prog->exts_integrated;
cls_bpf.gen_flags = prog->gen_flags;
- if (tc_can_offload(dev)) {
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSBPF,
- &cls_bpf);
- if (addorrep) {
- if (err) {
- if (skip_sw)
- return err;
- } else {
- prog->gen_flags |= TCA_CLS_FLAGS_IN_HW;
- }
- }
- }
-
err = tc_setup_cb_call(block, NULL, TC_SETUP_CLSBPF, &cls_bpf, skip_sw);
if (addorrep) {
if (err < 0) {
static void fl_hw_destroy_filter(struct tcf_proto *tp, struct cls_fl_filter *f)
{
struct tc_cls_flower_offload cls_flower = {};
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
tc_cls_common_offload_init(&cls_flower.common, tp);
cls_flower.command = TC_CLSFLOWER_DESTROY;
cls_flower.cookie = (unsigned long) f;
- if (tc_can_offload(dev))
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
- &cls_flower);
tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER,
&cls_flower, false);
}
struct fl_flow_key *mask,
struct cls_fl_filter *f)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tc_cls_flower_offload cls_flower = {};
struct tcf_block *block = tp->chain->block;
bool skip_sw = tc_skip_sw(f->flags);
cls_flower.key = &f->mkey;
cls_flower.exts = &f->exts;
- if (tc_can_offload(dev)) {
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
- &cls_flower);
- if (err) {
- if (skip_sw)
- return err;
- } else {
- f->flags |= TCA_CLS_FLAGS_IN_HW;
- }
- }
-
err = tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER,
&cls_flower, skip_sw);
if (err < 0) {
static void fl_hw_update_stats(struct tcf_proto *tp, struct cls_fl_filter *f)
{
struct tc_cls_flower_offload cls_flower = {};
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
tc_cls_common_offload_init(&cls_flower.common, tp);
cls_flower.cookie = (unsigned long) f;
cls_flower.exts = &f->exts;
- if (tc_can_offload(dev))
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSFLOWER,
- &cls_flower);
tc_setup_cb_call(block, &f->exts, TC_SETUP_CLSFLOWER,
&cls_flower, false);
}
struct cls_mall_head *head,
unsigned long cookie)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tc_cls_matchall_offload cls_mall = {};
struct tcf_block *block = tp->chain->block;
cls_mall.command = TC_CLSMATCHALL_DESTROY;
cls_mall.cookie = cookie;
- if (tc_can_offload(dev))
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSMATCHALL,
- &cls_mall);
tc_setup_cb_call(block, NULL, TC_SETUP_CLSMATCHALL, &cls_mall, false);
}
struct cls_mall_head *head,
unsigned long cookie)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tc_cls_matchall_offload cls_mall = {};
struct tcf_block *block = tp->chain->block;
bool skip_sw = tc_skip_sw(head->flags);
cls_mall.exts = &head->exts;
cls_mall.cookie = cookie;
- if (tc_can_offload(dev)) {
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSMATCHALL,
- &cls_mall);
- if (err) {
- if (skip_sw)
- return err;
- } else {
- head->flags |= TCA_CLS_FLAGS_IN_HW;
- }
- }
-
err = tc_setup_cb_call(block, NULL, TC_SETUP_CLSMATCHALL,
&cls_mall, skip_sw);
if (err < 0) {
static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
cls_u32.hnode.handle = h->handle;
cls_u32.hnode.prio = h->prio;
- if (tc_can_offload(dev))
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &cls_u32);
tc_setup_cb_call(block, NULL, TC_SETUP_CLSU32, &cls_u32, false);
}
static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
u32 flags)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
bool skip_sw = tc_skip_sw(flags);
cls_u32.hnode.handle = h->handle;
cls_u32.hnode.prio = h->prio;
- if (tc_can_offload(dev)) {
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
- &cls_u32);
- if (err) {
- if (skip_sw)
- return err;
- } else {
- offloaded = true;
- }
- }
-
err = tc_setup_cb_call(block, NULL, TC_SETUP_CLSU32, &cls_u32, skip_sw);
if (err < 0) {
u32_clear_hw_hnode(tp, h);
static void u32_remove_hw_knode(struct tcf_proto *tp, u32 handle)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
cls_u32.command = TC_CLSU32_DELETE_KNODE;
cls_u32.knode.handle = handle;
- if (tc_can_offload(dev))
- dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32, &cls_u32);
tc_setup_cb_call(block, NULL, TC_SETUP_CLSU32, &cls_u32, false);
}
static int u32_replace_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
u32 flags)
{
- struct net_device *dev = tp->q->dev_queue->dev;
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
bool skip_sw = tc_skip_sw(flags);
if (n->ht_down)
cls_u32.knode.link_handle = n->ht_down->handle;
-
- if (tc_can_offload(dev)) {
- err = dev->netdev_ops->ndo_setup_tc(dev, TC_SETUP_CLSU32,
- &cls_u32);
- if (err) {
- if (skip_sw)
- return err;
- } else {
- n->flags |= TCA_CLS_FLAGS_IN_HW;
- }
- }
-
err = tc_setup_cb_call(block, NULL, TC_SETUP_CLSU32, &cls_u32, skip_sw);
if (err < 0) {
u32_remove_hw_knode(tp, n->handle);