Commit abcae546 authored by Nathan Fontenot's avatar Nathan Fontenot Committed by David S. Miller

ibmvnic: Allocate max queues stats buffers

To avoid losing any stats when the number of sub-crqs change, allocate
the max number of stats buffers so a stats buffer exists all possible
sub-crqs.
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 86f669b2
...@@ -361,14 +361,14 @@ static void release_stats_buffers(struct ibmvnic_adapter *adapter) ...@@ -361,14 +361,14 @@ static void release_stats_buffers(struct ibmvnic_adapter *adapter)
static int init_stats_buffers(struct ibmvnic_adapter *adapter) static int init_stats_buffers(struct ibmvnic_adapter *adapter)
{ {
adapter->tx_stats_buffers = adapter->tx_stats_buffers =
kcalloc(adapter->req_tx_queues, kcalloc(IBMVNIC_MAX_QUEUES,
sizeof(struct ibmvnic_tx_queue_stats), sizeof(struct ibmvnic_tx_queue_stats),
GFP_KERNEL); GFP_KERNEL);
if (!adapter->tx_stats_buffers) if (!adapter->tx_stats_buffers)
return -ENOMEM; return -ENOMEM;
adapter->rx_stats_buffers = adapter->rx_stats_buffers =
kcalloc(adapter->req_rx_queues, kcalloc(IBMVNIC_MAX_QUEUES,
sizeof(struct ibmvnic_rx_queue_stats), sizeof(struct ibmvnic_rx_queue_stats),
GFP_KERNEL); GFP_KERNEL);
if (!adapter->rx_stats_buffers) if (!adapter->rx_stats_buffers)
......
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