aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
diff options
context:
space:
mode:
authorMitch Williams <mitch.a.williams@intel.com>2014-10-24 23:24:34 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-11-11 09:02:00 -0500
commitcc0529271f23896208723e310fd75c2c88b3fd8c (patch)
tree037a8b55b9e2756d0e13c00501d379a1d9b1e4f6 /drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
parentf8d4db35e870896dd7b2ba70a30f4dfc53c39472 (diff)
i40evf: don't use more queues than CPUs
It's kind of silly to configure and attempt to use a bunch of queue pairs when you're running on a single (virtual) CPU. Instead of unconditionally configuring all of the queues that the PF gives us, clamp the number of queue pairs to the number of CPUs. Change-ID: I321714c9e15072ee76de8f95ab9a81f86ed347d1 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Patrick Lu <patrick.lu@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
index efee6b290c0f..876411c39ee0 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c
@@ -59,7 +59,7 @@ static const struct i40evf_stats i40evf_gstrings_stats[] = {
59#define I40EVF_GLOBAL_STATS_LEN ARRAY_SIZE(i40evf_gstrings_stats) 59#define I40EVF_GLOBAL_STATS_LEN ARRAY_SIZE(i40evf_gstrings_stats)
60#define I40EVF_QUEUE_STATS_LEN(_dev) \ 60#define I40EVF_QUEUE_STATS_LEN(_dev) \
61 (((struct i40evf_adapter *) \ 61 (((struct i40evf_adapter *) \
62 netdev_priv(_dev))->vsi_res->num_queue_pairs \ 62 netdev_priv(_dev))->num_active_queues \
63 * 2 * (sizeof(struct i40e_queue_stats) / sizeof(u64))) 63 * 2 * (sizeof(struct i40e_queue_stats) / sizeof(u64)))
64#define I40EVF_STATS_LEN(_dev) \ 64#define I40EVF_STATS_LEN(_dev) \
65 (I40EVF_GLOBAL_STATS_LEN + I40EVF_QUEUE_STATS_LEN(_dev)) 65 (I40EVF_GLOBAL_STATS_LEN + I40EVF_QUEUE_STATS_LEN(_dev))
@@ -121,11 +121,11 @@ static void i40evf_get_ethtool_stats(struct net_device *netdev,
121 p = (char *)adapter + i40evf_gstrings_stats[i].stat_offset; 121 p = (char *)adapter + i40evf_gstrings_stats[i].stat_offset;
122 data[i] = *(u64 *)p; 122 data[i] = *(u64 *)p;
123 } 123 }
124 for (j = 0; j < adapter->vsi_res->num_queue_pairs; j++) { 124 for (j = 0; j < adapter->num_active_queues; j++) {
125 data[i++] = adapter->tx_rings[j]->stats.packets; 125 data[i++] = adapter->tx_rings[j]->stats.packets;
126 data[i++] = adapter->tx_rings[j]->stats.bytes; 126 data[i++] = adapter->tx_rings[j]->stats.bytes;
127 } 127 }
128 for (j = 0; j < adapter->vsi_res->num_queue_pairs; j++) { 128 for (j = 0; j < adapter->num_active_queues; j++) {
129 data[i++] = adapter->rx_rings[j]->stats.packets; 129 data[i++] = adapter->rx_rings[j]->stats.packets;
130 data[i++] = adapter->rx_rings[j]->stats.bytes; 130 data[i++] = adapter->rx_rings[j]->stats.bytes;
131 } 131 }
@@ -151,13 +151,13 @@ static void i40evf_get_strings(struct net_device *netdev, u32 sset, u8 *data)
151 ETH_GSTRING_LEN); 151 ETH_GSTRING_LEN);
152 p += ETH_GSTRING_LEN; 152 p += ETH_GSTRING_LEN;
153 } 153 }
154 for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { 154 for (i = 0; i < adapter->num_active_queues; i++) {
155 snprintf(p, ETH_GSTRING_LEN, "tx-%u.packets", i); 155 snprintf(p, ETH_GSTRING_LEN, "tx-%u.packets", i);
156 p += ETH_GSTRING_LEN; 156 p += ETH_GSTRING_LEN;
157 snprintf(p, ETH_GSTRING_LEN, "tx-%u.bytes", i); 157 snprintf(p, ETH_GSTRING_LEN, "tx-%u.bytes", i);
158 p += ETH_GSTRING_LEN; 158 p += ETH_GSTRING_LEN;
159 } 159 }
160 for (i = 0; i < adapter->vsi_res->num_queue_pairs; i++) { 160 for (i = 0; i < adapter->num_active_queues; i++) {
161 snprintf(p, ETH_GSTRING_LEN, "rx-%u.packets", i); 161 snprintf(p, ETH_GSTRING_LEN, "rx-%u.packets", i);
162 p += ETH_GSTRING_LEN; 162 p += ETH_GSTRING_LEN;
163 snprintf(p, ETH_GSTRING_LEN, "rx-%u.bytes", i); 163 snprintf(p, ETH_GSTRING_LEN, "rx-%u.bytes", i);
@@ -430,7 +430,7 @@ static int i40evf_get_rxnfc(struct net_device *netdev,
430 430
431 switch (cmd->cmd) { 431 switch (cmd->cmd) {
432 case ETHTOOL_GRXRINGS: 432 case ETHTOOL_GRXRINGS:
433 cmd->data = adapter->vsi_res->num_queue_pairs; 433 cmd->data = adapter->num_active_queues;
434 ret = 0; 434 ret = 0;
435 break; 435 break;
436 case ETHTOOL_GRXFH: 436 case ETHTOOL_GRXFH:
@@ -598,12 +598,12 @@ static void i40evf_get_channels(struct net_device *netdev,
598 struct i40evf_adapter *adapter = netdev_priv(netdev); 598 struct i40evf_adapter *adapter = netdev_priv(netdev);
599 599
600 /* Report maximum channels */ 600 /* Report maximum channels */
601 ch->max_combined = adapter->vsi_res->num_queue_pairs; 601 ch->max_combined = adapter->num_active_queues;
602 602
603 ch->max_other = NONQ_VECS; 603 ch->max_other = NONQ_VECS;
604 ch->other_count = NONQ_VECS; 604 ch->other_count = NONQ_VECS;
605 605
606 ch->combined_count = adapter->vsi_res->num_queue_pairs; 606 ch->combined_count = adapter->num_active_queues;
607} 607}
608 608
609/** 609/**