Skip to content

Commit 15f4edb

Browse files
Jakub Kicinskidavem330
authored andcommitted
mlxsw: use tc_cls_can_offload_and_chain0()
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 <[email protected]> Reviewed-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a0d8637 commit 15f4edb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/mellanox/mlxsw/spectrum.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,9 +1738,6 @@ static int mlxsw_sp_setup_tc_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port,
17381738
struct tc_cls_matchall_offload *f,
17391739
bool ingress)
17401740
{
1741-
if (f->common.chain_index)
1742-
return -EOPNOTSUPP;
1743-
17441741
switch (f->command) {
17451742
case TC_CLSMATCHALL_REPLACE:
17461743
return mlxsw_sp_port_add_cls_matchall(mlxsw_sp_port, f,
@@ -1780,7 +1777,8 @@ static int mlxsw_sp_setup_tc_block_cb_matchall(enum tc_setup_type type,
17801777

17811778
switch (type) {
17821779
case TC_SETUP_CLSMATCHALL:
1783-
if (!tc_can_offload(mlxsw_sp_port->dev))
1780+
if (!tc_cls_can_offload_and_chain0(mlxsw_sp_port->dev,
1781+
type_data))
17841782
return -EOPNOTSUPP;
17851783

17861784
return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data,

0 commit comments

Comments
 (0)