Commit f185a49a authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller

ibmvnic: Deactivate RX pool buffer replenishment on H_CLOSED

If H_CLOSED is returned, halt RX buffer replenishment activity
until firmware sends a notification that the driver can reset.
Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8c80b84
...@@ -200,6 +200,15 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter, ...@@ -200,6 +200,15 @@ static void free_long_term_buff(struct ibmvnic_adapter *adapter,
dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr); dma_free_coherent(dev, ltb->size, ltb->buff, ltb->addr);
} }
static void deactivate_rx_pools(struct ibmvnic_adapter *adapter)
{
int i;
for (i = 0; i < be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs);
i++)
adapter->rx_pool[i].active = 0;
}
static void replenish_rx_pool(struct ibmvnic_adapter *adapter, static void replenish_rx_pool(struct ibmvnic_adapter *adapter,
struct ibmvnic_rx_pool *pool) struct ibmvnic_rx_pool *pool)
{ {
...@@ -217,6 +226,9 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, ...@@ -217,6 +226,9 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter,
int index; int index;
int i; int i;
if (!pool->active)
return;
handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) + handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) +
be32_to_cpu(adapter->login_rsp_buf-> be32_to_cpu(adapter->login_rsp_buf->
off_rxadd_subcrqs)); off_rxadd_subcrqs));
...@@ -287,6 +299,15 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter, ...@@ -287,6 +299,15 @@ static void replenish_rx_pool(struct ibmvnic_adapter *adapter,
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
adapter->replenish_add_buff_failure++; adapter->replenish_add_buff_failure++;
atomic_add(buffers_added, &pool->available); atomic_add(buffers_added, &pool->available);
if (lpar_rc == H_CLOSED) {
/* Disable buffer pool replenishment and report carrier off if
* queue is closed. Firmware guarantees that a signal will
* be sent to the driver, triggering a reset.
*/
deactivate_rx_pools(adapter);
netif_carrier_off(adapter->netdev);
}
} }
static void replenish_pools(struct ibmvnic_adapter *adapter) static void replenish_pools(struct ibmvnic_adapter *adapter)
......
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