From: Alexander Duyck Date: Wed, 11 May 2011 07:18:41 +0000 (+0000) Subject: ixgbe: add basic support for setting and getting nfc controls X-Git-Tag: v2.6.39-400.9.0~619^2~30 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=50ecf6452bc6db3448ae6defb2352442d75c677f;p=users%2Fjedix%2Flinux-maple.git ixgbe: add basic support for setting and getting nfc controls This change adds basic support for the obtaining of RSS ring counts. Signed-off-by: Alexander Duyck Tested-by: Ross Brattain Signed-off-by: Jeff Kirsher (cherry picked from commit 91cd94bfe4f00fccf692e32dfa86a9fad0d61280) Signed-off-by: Joe Jin --- diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index c2dd1c46433f..04461573e488 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c @@ -2340,6 +2340,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, @@ -2375,6 +2393,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)