Skip to content

Commit

Permalink
Merge branch 'sched-couple-of-ndo_setup_tc-fixes-and-adjustments'
Browse files Browse the repository at this point in the history
Jiri Pirko says:

====================
net: sched: couple of ndo_setup_tc fixes and adjustments

This patchset includes couple of patches that fix or adjust default
cases and return values in ndo_setup_tc implementations in drivers.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jun 25, 2018
2 parents 0ef8b45 + 246ab6f commit 064f390
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
16 changes: 5 additions & 11 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1544,22 +1544,16 @@ void bnxt_tc_flow_stats_work(struct bnxt *bp)
int bnxt_tc_setup_flower(struct bnxt *bp, u16 src_fid,
struct tc_cls_flower_offload *cls_flower)
{
int rc = 0;

switch (cls_flower->command) {
case TC_CLSFLOWER_REPLACE:
rc = bnxt_tc_add_flow(bp, src_fid, cls_flower);
break;

return bnxt_tc_add_flow(bp, src_fid, cls_flower);
case TC_CLSFLOWER_DESTROY:
rc = bnxt_tc_del_flow(bp, cls_flower);
break;

return bnxt_tc_del_flow(bp, cls_flower);
case TC_CLSFLOWER_STATS:
rc = bnxt_tc_get_flow_stats(bp, cls_flower);
break;
return bnxt_tc_get_flow_stats(bp, cls_flower);
default:
return -EOPNOTSUPP;
}
return rc;
}

static const struct rhashtable_params bnxt_tc_flow_ht_params = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7522,7 +7522,7 @@ static int i40e_setup_tc_cls_flower(struct i40e_netdev_priv *np,
case TC_CLSFLOWER_STATS:
return -EOPNOTSUPP;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/i40evf/i40evf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,7 @@ static int i40evf_setup_tc_cls_flower(struct i40evf_adapter *adapter,
case TC_CLSFLOWER_STATS:
return -EOPNOTSUPP;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/igb/igb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2698,7 +2698,7 @@ static int igb_setup_tc_cls_flower(struct igb_adapter *adapter,
case TC_CLSFLOWER_STATS:
return -EOPNOTSUPP;
default:
return -EINVAL;
return -EOPNOTSUPP;
}
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ethernet/netronome/nfp/flower/offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,9 +576,9 @@ nfp_flower_repr_offload(struct nfp_app *app, struct net_device *netdev,
return nfp_flower_del_offload(app, netdev, flower, egress);
case TC_CLSFLOWER_STATS:
return nfp_flower_get_stats(app, netdev, flower, egress);
default:
return -EOPNOTSUPP;
}

return -EOPNOTSUPP;
}

int nfp_flower_setup_tc_egress_cb(enum tc_setup_type type, void *type_data,
Expand Down

0 comments on commit 064f390

Please sign in to comment.