diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-01-25 17:00:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-01-25 21:23:09 -0500 |
commit | 15f4edb3d9c60a0934b133aae9c915807138cb4d (patch) | |
tree | 8f99fc867fd5b902356d78e468695ed68d02c4d4 | |
parent | a0d8637f0f59c4028b73ef1f319eca4f8b5beb53 (diff) |
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 <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 833cd0a96fd9..3dcc58d61506 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c | |||
@@ -1738,9 +1738,6 @@ static int mlxsw_sp_setup_tc_cls_matchall(struct mlxsw_sp_port *mlxsw_sp_port, | |||
1738 | struct tc_cls_matchall_offload *f, | 1738 | struct tc_cls_matchall_offload *f, |
1739 | bool ingress) | 1739 | bool ingress) |
1740 | { | 1740 | { |
1741 | if (f->common.chain_index) | ||
1742 | return -EOPNOTSUPP; | ||
1743 | |||
1744 | switch (f->command) { | 1741 | switch (f->command) { |
1745 | case TC_CLSMATCHALL_REPLACE: | 1742 | case TC_CLSMATCHALL_REPLACE: |
1746 | return mlxsw_sp_port_add_cls_matchall(mlxsw_sp_port, f, | 1743 | 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, | |||
1780 | 1777 | ||
1781 | switch (type) { | 1778 | switch (type) { |
1782 | case TC_SETUP_CLSMATCHALL: | 1779 | 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)) | ||
1784 | return -EOPNOTSUPP; | 1782 | return -EOPNOTSUPP; |
1785 | 1783 | ||
1786 | return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data, | 1784 | return mlxsw_sp_setup_tc_cls_matchall(mlxsw_sp_port, type_data, |