This is preparation for multi-queue (MQ) RX; nothing sets multi_queue
yet, so single-queue behavior does not change.

An RX queue starts with no buffers and its interrupt masked, and PHYP
interrupts a queue only after placing a frame in one of its buffers.
The first NAPI poll posts the buffers and unmasks the interrupt, but
open() and resume schedule NAPI only on queue 0, so the other queues
would never receive.

Schedule NAPI on every RX queue in open() and resume. Refill still
runs only from a queue's own NAPI poll, so no two contexts touch one
queue's buffers and no lock is needed.

Signed-off-by: Mingming Cao <[email protected]>
---
 drivers/net/ethernet/ibm/ibmveth.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmveth.c 
b/drivers/net/ethernet/ibm/ibmveth.c
index cafbed3d1512..fbaa964c6963 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1574,8 +1574,9 @@ static int ibmveth_open(struct net_device *netdev)
        if (rc)
                goto out_unregister_queues;
 
-       netdev_dbg(netdev, "initial replenish cycle\n");
-       ibmveth_schedule_rx_queue(adapter, 0);
+       /* Each queue's first poll posts its buffers and unmasks it. */
+       for (i = 0; i < adapter->num_rx_queues; i++)
+               ibmveth_schedule_rx_queue(adapter, i);
 
        /* netif_tx_lock() takes each txq lock, so a sender that then sees
         * DRV_XOFF clear under its txq lock also sees the LTBs set up above.
@@ -3204,8 +3205,12 @@ static int ibmveth_resume(struct device *dev)
 {
        struct net_device *netdev = dev_get_drvdata(dev);
        struct ibmveth_adapter *adapter = netdev_priv(netdev);
+       unsigned int num = adapter->num_rx_queues;
+       int i;
+
+       for (i = 0; i < num; i++)
+               ibmveth_schedule_rx_queue(adapter, i);
 
-       ibmveth_schedule_rx_queue(adapter, 0);
        return 0;
 }
 
-- 
2.50.1 (Apple Git-155)


Reply via email to