s390/qeth: invoke softirqs after napi_schedule()
authorJulian Wiedmann <jwi@linux.ibm.com>
Mon, 17 Sep 2018 15:36:06 +0000 (17:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:52:25 +0000 (09:52 +0100)
[ Upstream commit 4d19db777a2f32c9b76f6fd517ed8960576cb43e ]

Calling napi_schedule() from process context does not ensure that the
NET_RX softirq is run in a timely fashion. So trigger it manually.

This is no big issue with current code. A call to ndo_open() is usually
followed by a ndo_set_rx_mode() call, and for qeth this contains a
spin_unlock_bh(). Except for OSN, where qeth_l2_set_rx_mode() bails out
early.
Nevertheless it's best to not depend on this behaviour, and just fix
the issue at its source like all other drivers do. For instance see
commit 83a0c6e58901 ("i40e: Invoke softirqs after napi_reschedule").

Fixes: a1c3ed4c9ca0 ("qeth: NAPI support for l2 and l3 discipline")
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/net/qeth_l2_main.c
drivers/s390/net/qeth_l3_main.c

index 6ba4e921d2fd31ba2fa8cdbe8d01850f66043389..51152681aba6e6fe2a7f032fb25120bee2854291 100644 (file)
@@ -991,7 +991,10 @@ static int __qeth_l2_open(struct net_device *dev)
 
        if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) {
                napi_enable(&card->napi);
+               local_bh_disable();
                napi_schedule(&card->napi);
+               /* kick-start the NAPI softirq: */
+               local_bh_enable();
        } else
                rc = -EIO;
        return rc;
index 6e6ba1baf9c489759be6ba3adaf66e1cd16541f0..b40a61d9ad9ecb97df01cf225fac9678ccef520e 100644 (file)
@@ -3005,7 +3005,10 @@ static int __qeth_l3_open(struct net_device *dev)
 
        if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) {
                napi_enable(&card->napi);
+               local_bh_disable();
                napi_schedule(&card->napi);
+               /* kick-start the NAPI softirq: */
+               local_bh_enable();
        } else
                rc = -EIO;
        return rc;