ibmvnic: Implement .get_ringparam
authorJohn Allen <jallen@linux.vnet.ibm.com>
Wed, 2 Aug 2017 21:46:30 +0000 (16:46 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Aug 2017 16:33:06 +0000 (09:33 -0700)
Implement .get_ringparam (ethtool -g) functionality

Signed-off-by: John Allen <jallen@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ibm/ibmvnic.c

index ea0ff28..c40456a 100644 (file)
@@ -1729,12 +1729,14 @@ static u32 ibmvnic_get_link(struct net_device *netdev)
 static void ibmvnic_get_ringparam(struct net_device *netdev,
                                  struct ethtool_ringparam *ring)
 {
-       ring->rx_max_pending = 0;
-       ring->tx_max_pending = 0;
+       struct ibmvnic_adapter *adapter = netdev_priv(netdev);
+
+       ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq;
+       ring->tx_max_pending = adapter->max_tx_entries_per_subcrq;
        ring->rx_mini_max_pending = 0;
        ring->rx_jumbo_max_pending = 0;
-       ring->rx_pending = 0;
-       ring->tx_pending = 0;
+       ring->rx_pending = adapter->req_rx_add_entries_per_subcrq;
+       ring->tx_pending = adapter->req_tx_entries_per_subcrq;
        ring->rx_mini_pending = 0;
        ring->rx_jumbo_pending = 0;
 }