ixgbe: use tc_cls_can_offload_and_chain0()
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 25 Jan 2018 22:00:49 +0000 (14:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Jan 2018 02:23:08 +0000 (21:23 -0500)
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>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 722cc3153a99baf286f9c1840d66591239b08885..bbb622f15a772796810cc7e545666384b30160eb 100644 (file)
@@ -9303,9 +9303,6 @@ free_jump:
 static int ixgbe_setup_tc_cls_u32(struct ixgbe_adapter *adapter,
                                  struct tc_cls_u32_offload *cls_u32)
 {
-       if (cls_u32->common.chain_index)
-               return -EOPNOTSUPP;
-
        switch (cls_u32->command) {
        case TC_CLSU32_NEW_KNODE:
        case TC_CLSU32_REPLACE_KNODE:
@@ -9327,7 +9324,7 @@ 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))
+       if (!tc_cls_can_offload_and_chain0(adapter->netdev, type_data))
                return -EOPNOTSUPP;
 
        switch (type) {