From: Jakub Kicinski <kuba@kernel.org>
To: "Felix Hüttner" <felix.huettner@mail.schwarz>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"dev@openvswitch.org" <dev@openvswitch.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Luca Czesla <Luca.Czesla@mail.schwarz>
Subject: Re: [PATCH] net: openvswitch: fix race on port output
Date: Fri, 31 Mar 2023 21:25:14 -0700 [thread overview]
Message-ID: <20230331212514.7a9ee3d9@kernel.org> (raw)
In-Reply-To: <DU0PR10MB5244A38E7712028763169A93EA8F9@DU0PR10MB5244.EURPRD10.PROD.OUTLOOK.COM>
On Fri, 31 Mar 2023 06:25:13 +0000 Felix Hüttner wrote:
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 253584777101..6628323b7bea 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3199,6 +3199,7 @@ static u16 skb_tx_hash(const struct net_device *dev,
> }
>
> if (skb_rx_queue_recorded(skb)) {
> + BUG_ON(unlikely(qcount == 0));
DEBUG_NET_WARN_ON()
> hash = skb_get_rx_queue(skb);
> if (hash >= qoffset)
> hash -= qoffset;
> diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
> index ca3ebfdb3023..33b317e5f9a5 100644
> --- a/net/openvswitch/actions.c
> +++ b/net/openvswitch/actions.c
> @@ -913,7 +913,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
> {
> struct vport *vport = ovs_vport_rcu(dp, out_port);
>
> - if (likely(vport)) {
> + if (likely(vport && vport->dev->reg_state == NETREG_REGISTERED)) {
Without looking too closely netif_carrier_ok() seems like a more
appropriate check for liveness on the datapath?
> u16 mru = OVS_CB(skb)->mru;
> u32 cutlen = OVS_CB(skb)->cutlen;
>
> --
> 2.40.0
>
> Diese E Mail enthält möglicherweise vertrauliche Inhalte und ist nur für die Verwertung durch den vorgesehenen Empfänger bestimmt. Sollten Sie nicht der vorgesehene Empfänger sein, setzen Sie den Absender bitte unverzüglich in Kenntnis und löschen diese E Mail. Hinweise zum Datenschutz finden Sie hier<https://www.datenschutz.schwarz>.
You gotta get rid of this to work upstream.
next prev parent reply other threads:[~2023-04-01 4:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-31 6:25 [PATCH] net: openvswitch: fix race on port output Felix Hüttner
2023-04-01 4:25 ` Jakub Kicinski [this message]
2023-04-03 11:18 ` Felix Hüttner
2023-04-03 18:50 ` Jakub Kicinski
2023-04-04 7:25 ` Felix Hüttner
-- strict thread matches above, loose matches on Subject: below --
2023-03-31 8:19 Felix Huettner
2023-04-01 4:26 ` Jakub Kicinski
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=20230331212514.7a9ee3d9@kernel.org \
--to=kuba@kernel.org \
--cc=Luca.Czesla@mail.schwarz \
--cc=dev@openvswitch.org \
--cc=felix.huettner@mail.schwarz \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).