Make use of tc_can_offload_cls() to report error in case
ethtool tc offload flag is not set or chain unsupported.

Signed-off-by: Jakub Kicinski <jakub.kicin...@netronome.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 4f28621b76e1..77682aee029e 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9278,7 +9278,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter 
*adapter,
 static int ixgbe_setup_tc_cls_u32(struct ixgbe_adapter *adapter,
                                  struct tc_cls_u32_offload *cls_u32)
 {
-       if (cls_u32->common.chain_index)
+       if (!tc_can_offload_cls(adapter->netdev, &cls_u32->common))
                return -EOPNOTSUPP;
 
        switch (cls_u32->command) {
@@ -9302,9 +9302,6 @@ static int ixgbe_setup_tc_block_cb(enum tc_setup_type 
type, void *type_data,
 {
        struct ixgbe_adapter *adapter = cb_priv;
 
-       if (!tc_can_offload(adapter->netdev))
-               return -EOPNOTSUPP;
-
        switch (type) {
        case TC_SETUP_CLSU32:
                return ixgbe_setup_tc_cls_u32(adapter, type_data);
-- 
2.15.1

Reply via email to