ixgbe: add basic support for setting and getting nfc controls
authorAlexander Duyck <alexander.h.duyck@intel.com>
Wed, 11 May 2011 07:18:41 +0000 (07:18 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 24 Jun 2011 05:44:34 +0000 (22:44 -0700)
This change adds basic support for the obtaining of RSS ring counts.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Ross Brattain <ross.b.brattain@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ixgbe/ixgbe_ethtool.c

index a2d8ed5060534d28f68903b392ced4f2c75d4812..837324429f54b1175d1351f3429c0814031bcdd8 100644 (file)
@@ -2336,6 +2336,24 @@ static int ixgbe_set_flags(struct net_device *netdev, u32 data)
        return 0;
 }
 
+static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
+                          void *rule_locs)
+{
+       struct ixgbe_adapter *adapter = netdev_priv(dev);
+       int ret = -EOPNOTSUPP;
+
+       switch (cmd->cmd) {
+       case ETHTOOL_GRXRINGS:
+               cmd->data = adapter->num_rx_queues;
+               ret = 0;
+               break;
+       default:
+               break;
+       }
+
+       return ret;
+}
+
 static const struct ethtool_ops ixgbe_ethtool_ops = {
        .get_settings           = ixgbe_get_settings,
        .set_settings           = ixgbe_set_settings,
@@ -2371,6 +2389,7 @@ static const struct ethtool_ops ixgbe_ethtool_ops = {
        .set_coalesce           = ixgbe_set_coalesce,
        .get_flags              = ethtool_op_get_flags,
        .set_flags              = ixgbe_set_flags,
+       .get_rxnfc              = ixgbe_get_rxnfc,
 };
 
 void ixgbe_set_ethtool_ops(struct net_device *netdev)