qede: Don't expose self-test for VFs
authorYuval Mintz <Yuval.Mintz@qlogic.com>
Thu, 26 May 2016 08:01:19 +0000 (11:01 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 May 2016 19:27:32 +0000 (12:27 -0700)
PFs and VFs differ in their registered ethtool operations,
but they're using a common function for get_sset_count().
As a result, `ethtool -i' for a VF would indicate it supports
selftest, although that's not the case.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_ethtool.c

index 1bc75358cbc471856ebd1626a8d6432653b4934e..ad3cae3b7243b54f5b2a74413d7464eda32d67ab 100644 (file)
@@ -230,7 +230,10 @@ static int qede_get_sset_count(struct net_device *dev, int stringset)
        case ETH_SS_PRIV_FLAGS:
                return QEDE_PRI_FLAG_LEN;
        case ETH_SS_TEST:
-               return QEDE_ETHTOOL_TEST_MAX;
+               if (!IS_VF(edev))
+                       return QEDE_ETHTOOL_TEST_MAX;
+               else
+                       return 0;
        default:
                DP_VERBOSE(edev, QED_MSG_DEBUG,
                           "Unsupported stringset 0x%08x\n", stringset);