Commit 87e70ab9 authored by Don Skidmore's avatar Don Skidmore Committed by David S. Miller

ixgbevf: Convert ring storage form pointer to an array to array of pointers

This will change how we store rings arrays in the adapter sturct.
We use to have a pointer to an array now we will be using an array
of pointers.  This will allow us to support multiple queues on
muliple nodes at some point we would be able to reallocate the rings
so that each is on a local node if needed.
Signed-off-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDon Skidmore <donald.c.skidmore@intel.com>
Tested-by: default avatarPhil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27ae2967
...@@ -286,9 +286,9 @@ static int ixgbevf_set_ringparam(struct net_device *netdev, ...@@ -286,9 +286,9 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
if (!netif_running(adapter->netdev)) { if (!netif_running(adapter->netdev)) {
for (i = 0; i < adapter->num_tx_queues; i++) for (i = 0; i < adapter->num_tx_queues; i++)
adapter->tx_ring[i].count = new_tx_count; adapter->tx_ring[i]->count = new_tx_count;
for (i = 0; i < adapter->num_rx_queues; i++) for (i = 0; i < adapter->num_rx_queues; i++)
adapter->rx_ring[i].count = new_rx_count; adapter->rx_ring[i]->count = new_rx_count;
adapter->tx_ring_count = new_tx_count; adapter->tx_ring_count = new_tx_count;
adapter->rx_ring_count = new_rx_count; adapter->rx_ring_count = new_rx_count;
goto clear_reset; goto clear_reset;
...@@ -303,7 +303,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev, ...@@ -303,7 +303,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
for (i = 0; i < adapter->num_tx_queues; i++) { for (i = 0; i < adapter->num_tx_queues; i++) {
/* clone ring and setup updated count */ /* clone ring and setup updated count */
tx_ring[i] = adapter->tx_ring[i]; tx_ring[i] = *adapter->tx_ring[i];
tx_ring[i].count = new_tx_count; tx_ring[i].count = new_tx_count;
err = ixgbevf_setup_tx_resources(adapter, &tx_ring[i]); err = ixgbevf_setup_tx_resources(adapter, &tx_ring[i]);
if (!err) if (!err)
...@@ -329,7 +329,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev, ...@@ -329,7 +329,7 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
/* clone ring and setup updated count */ /* clone ring and setup updated count */
rx_ring[i] = adapter->rx_ring[i]; rx_ring[i] = *adapter->rx_ring[i];
rx_ring[i].count = new_rx_count; rx_ring[i].count = new_rx_count;
err = ixgbevf_setup_rx_resources(adapter, &rx_ring[i]); err = ixgbevf_setup_rx_resources(adapter, &rx_ring[i]);
if (!err) if (!err)
...@@ -352,9 +352,8 @@ static int ixgbevf_set_ringparam(struct net_device *netdev, ...@@ -352,9 +352,8 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
/* Tx */ /* Tx */
if (tx_ring) { if (tx_ring) {
for (i = 0; i < adapter->num_tx_queues; i++) { for (i = 0; i < adapter->num_tx_queues; i++) {
ixgbevf_free_tx_resources(adapter, ixgbevf_free_tx_resources(adapter, adapter->tx_ring[i]);
&adapter->tx_ring[i]); *adapter->tx_ring[i] = tx_ring[i];
adapter->tx_ring[i] = tx_ring[i];
} }
adapter->tx_ring_count = new_tx_count; adapter->tx_ring_count = new_tx_count;
...@@ -365,9 +364,8 @@ static int ixgbevf_set_ringparam(struct net_device *netdev, ...@@ -365,9 +364,8 @@ static int ixgbevf_set_ringparam(struct net_device *netdev,
/* Rx */ /* Rx */
if (rx_ring) { if (rx_ring) {
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
ixgbevf_free_rx_resources(adapter, ixgbevf_free_rx_resources(adapter, adapter->rx_ring[i]);
&adapter->rx_ring[i]); *adapter->rx_ring[i] = rx_ring[i];
adapter->rx_ring[i] = rx_ring[i];
} }
adapter->rx_ring_count = new_rx_count; adapter->rx_ring_count = new_rx_count;
...@@ -413,15 +411,15 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev, ...@@ -413,15 +411,15 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev,
tx_yields = 0, tx_cleaned = 0, tx_missed = 0; tx_yields = 0, tx_cleaned = 0, tx_missed = 0;
for (i = 0; i < adapter->num_rx_queues; i++) { for (i = 0; i < adapter->num_rx_queues; i++) {
rx_yields += adapter->rx_ring[i].bp_yields; rx_yields += adapter->rx_ring[i]->bp_yields;
rx_cleaned += adapter->rx_ring[i].bp_cleaned; rx_cleaned += adapter->rx_ring[i]->bp_cleaned;
rx_yields += adapter->rx_ring[i].bp_yields; rx_yields += adapter->rx_ring[i]->bp_yields;
} }
for (i = 0; i < adapter->num_tx_queues; i++) { for (i = 0; i < adapter->num_tx_queues; i++) {
tx_yields += adapter->tx_ring[i].bp_yields; tx_yields += adapter->tx_ring[i]->bp_yields;
tx_cleaned += adapter->tx_ring[i].bp_cleaned; tx_cleaned += adapter->tx_ring[i]->bp_cleaned;
tx_yields += adapter->tx_ring[i].bp_yields; tx_yields += adapter->tx_ring[i]->bp_yields;
} }
adapter->bp_rx_yields = rx_yields; adapter->bp_rx_yields = rx_yields;
......
...@@ -327,7 +327,7 @@ struct ixgbevf_adapter { ...@@ -327,7 +327,7 @@ struct ixgbevf_adapter {
u32 eims_other; u32 eims_other;
/* TX */ /* TX */
struct ixgbevf_ring *tx_ring; /* One per active queue */ struct ixgbevf_ring *tx_ring[MAX_TX_QUEUES]; /* One per active queue */
int num_tx_queues; int num_tx_queues;
u64 restart_queue; u64 restart_queue;
u64 hw_csum_tx_good; u64 hw_csum_tx_good;
...@@ -337,7 +337,7 @@ struct ixgbevf_adapter { ...@@ -337,7 +337,7 @@ struct ixgbevf_adapter {
u32 tx_timeout_count; u32 tx_timeout_count;
/* RX */ /* RX */
struct ixgbevf_ring *rx_ring; /* One per active queue */ struct ixgbevf_ring *rx_ring[MAX_TX_QUEUES]; /* One per active queue */
int num_rx_queues; int num_rx_queues;
u64 hw_csum_rx_error; u64 hw_csum_rx_error;
u64 hw_rx_no_dma_resources; u64 hw_rx_no_dma_resources;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment