Skip to content

Commit

Permalink
mlxsw: use tc_cls_can_offload_and_chain0()
Browse files Browse the repository at this point in the history
Make use of tc_cls_can_offload_and_chain0() to set extack msg in case
ethtool tc offload flag is not set or chain unsupported.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Jan 26, 2018
1 parent a0d8637 commit 15f4edb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/mellanox/mlxsw/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1738,9 +1738,6 @@ static int mlxsw_sp_setup_tc_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
struct tc_cls_matchall_offload *f,
bool ingress)
{
if (f->common.chain_index)
return -EOPNOTSUPP;

switch (f->command) {
case TC_CLSMATCHALL_REPLACE:
return mlxsw_sp_port_add_cls_matchall(mlxsw_sp_port, f,
Expand Down Expand Up @@ -1780,7 +1777,8 @@ static int mlxsw_sp_setup_tc_block_cb_matchall(enum tc_setup_type type,

switch (type) {
case TC_SETUP_CLSMATCHALL:
if (!tc_can_offload(mlxsw_sp_port->dev))
if (!tc_cls_can_offload_and_chain0(mlxsw_sp_port->dev,
type_data))
return -EOPNOTSUPP;

return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data,
Expand Down

0 comments on commit 15f4edb

Please sign in to comment.