From: <gregkh@linuxfoundation.org>
To: jasowang@redhat.com, kuba@kernel.org, mst@redhat.com,
xuanzhuo@linux.alibaba.com
Cc: <stable@vger.kernel.org>
Subject: FAILED: patch "[PATCH] virtio-net: fix race between set queues and probe" failed to apply to 4.14-stable tree
Date: Tue, 01 Aug 2023 07:51:53 +0200 [thread overview]
Message-ID: <2023080152-roundish-doornail-415a@gregkh> (raw)
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x 25266128fe16d5632d43ada34c847d7b8daba539
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2023080152-roundish-doornail-415a@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..
Possible dependencies:
25266128fe16 ("virtio-net: fix race between set queues and probe")
50c0ada627f5 ("virtio-net: fix race between ndo_open() and virtio_device_ready()")
c7114b1249fa ("drivers/net/virtio_net: Added basic RSS support.")
a02e8964eaf9 ("virtio-net: ethtool configurable LRO")
0c465be183c7 ("virtio_net: ethtool tx napi configuration")
ba5e4426e80e ("virtio_net: Extend virtio to use VF datapath when available")
9805069d14c1 ("virtio_net: Introduce VIRTIO_NET_F_STANDBY feature bit")
cfc80d9a1163 ("net: Introduce net_failover driver")
f4ee703ace84 ("virtio_net: sparse annotation fix")
d7fad4c840f3 ("virtio_net: fix adding vids on big-endian")
12e571693837 ("virtio_net: split out ctrl buffer")
faa9b39f0e9d ("virtio_net: propagate linkspeed/duplex settings from the hypervisor")
754b8a21a96d ("virtio_net: setup xdp_rxq_info")
83c9e13aa39a ("netdevsim: add software driver for testing offloads")
e69b6c02b4c3 ("net: Add support for networking over Thunderbolt cable")
186b3c998c50 ("virtio-net: support XDP_REDIRECT")
312403453532 ("virtio-net: add packet len average only when needed during XDP")
9457642a405f ("virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 25266128fe16d5632d43ada34c847d7b8daba539 Mon Sep 17 00:00:00 2001
From: Jason Wang <jasowang@redhat.com>
Date: Tue, 25 Jul 2023 03:20:49 -0400
Subject: [PATCH] virtio-net: fix race between set queues and probe
A race were found where set_channels could be called after registering
but before virtnet_set_queues() in virtnet_probe(). Fixing this by
moving the virtnet_set_queues() before netdevice registering. While at
it, use _virtnet_set_queues() to avoid holding rtnl as the device is
not even registered at that time.
Cc: stable@vger.kernel.org
Fixes: a220871be66f ("virtio-net: correctly enable multiqueue")
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230725072049.617289-1-jasowang@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0db14f6b87d3..1270c8d23463 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -4219,6 +4219,8 @@ static int virtnet_probe(struct virtio_device *vdev)
if (vi->has_rss || vi->has_rss_hash_report)
virtnet_init_default_rss(vi);
+ _virtnet_set_queues(vi, vi->curr_queue_pairs);
+
/* serialize netdev register + virtio_device_ready() with ndo_open() */
rtnl_lock();
@@ -4257,8 +4259,6 @@ static int virtnet_probe(struct virtio_device *vdev)
goto free_unregister_netdev;
}
- virtnet_set_queues(vi, vi->curr_queue_pairs);
-
/* Assume link up if device can't report link status,
otherwise get link status from config. */
netif_carrier_off(dev);
reply other threads:[~2023-08-01 5:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023080152-roundish-doornail-415a@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=stable@vger.kernel.org \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox