Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1956896rwl; Fri, 31 Mar 2023 21:48:31 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDQVyxQEPDaBm2VuBbUQxOEDKSN13JN66tOSxbnLVs2ONZ/OIa48abtEOt7a16Lm655oPK X-Received: by 2002:a05:6a20:6914:b0:e3:ffc1:552a with SMTP id q20-20020a056a20691400b000e3ffc1552amr8008583pzj.2.1680324511632; Fri, 31 Mar 2023 21:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680324511; cv=none; d=google.com; s=arc-20160816; b=EgIJJXkZl3QYIM2q9yn4LErILf0RFeCmTda7sMdHBroN40jc5eSgfTHlbKHjSQiQS8 EM8EgiQZbkxaSFrVF7x+Vk7BRTdv6gQRAiIH1wIOLT+Y0fRhTdqWqgqB52KUfNIt7kHb IBvG1ASPZ3WG4tBHnwXp4/SINUkkATfHMPu87MIaFKa6f1X2X+WOJuInSCFaNnBlCwpa esL6tqiKRI7D3i/i2wJJw8ydOAUGh2aPEq4LEkwyFFB+Buk9MflPxkFnCWMS5SUFlR7x ntlxS91q1yQ6TKy4fKfqcZ6rcx8FUM7Vee5i4X6X7JaLW1/2Br3LSWlNEa+RRslnUEVx fo7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XPyQfnQDvzVyCdyiWWIMDduQ2k01ZwdbndB2nfyW5ng=; b=ek7cPO0ozbxdfyGJuh9/h45eIA420sxHhtnlnWFAkHmyiTy2e+0lCab3wpRxniMOqs tcbxWG4ssXF/SmdVnKEC+r9zWtgp1zLmWg1N8/iG4gpxeKQ1wyUSSmbgX9LavzClgYrt mwtv+LIKqbfu3ZLEajMXceSu1xZv+3DWf9jvL9FgEqcB00eEBZyWW5yu6qleTfv5A2FA tZ5RIjINXlBDzehtIg3smt1znHl4FjNH7wEYD9UMQ4qb0Z4cD4YzL9z1XelIDBCCa3i2 fJrHRt2uaKCfcinQJa4XXeOmhTC6BmTT9+y7jwXoNEs+ocUhVTkcLz3qDAE8M9hCWvOm SLCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oq5blUMg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n33-20020a635921000000b0050fac33eb8bsi3978482pgb.144.2023.03.31.21.48.15; Fri, 31 Mar 2023 21:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Oq5blUMg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233466AbjDAEZS (ORCPT + 99 others); Sat, 1 Apr 2023 00:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232111AbjDAEZR (ORCPT ); Sat, 1 Apr 2023 00:25:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B60E1DFB1; Fri, 31 Mar 2023 21:25:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0BB6A6190D; Sat, 1 Apr 2023 04:25:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 236DDC433EF; Sat, 1 Apr 2023 04:25:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680323115; bh=rhQMdQ3loA1jFhJxJX38tMeXfbzlLIFjCjXfge58ZhU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Oq5blUMgfIcgfRWn8LsZJ4qNCplw+HmdW6UTG1ORC3xp8aac4WT1nBXjQpWIiO+F8 mXGiQiFTyYi4EhFgjeGgcZh1/8o2N88Ou2HGNG6pzhqR9+YX9Uk27RhGyT1kHKobFC WzcZu0yrG+2yeIVtGocwuZNX1dshsFaWRv0NTZAYgVJ2wUkg3QxiXlJdSh+yiOuzXH l8DFhDzRhbTCI1fUmoqAtTPg3V4Ok4YpSvB0jR+iEJrRKkE3JQ+vCAInNMnBRljR1T AfX7z68QufWpFMayvl2PKaIKbUVyamyuXWPAAmGrSFvRCx7gR/b5IgsA9ytRN/1YXz w9GGuYZ/IQUDw== Date: Fri, 31 Mar 2023 21:25:14 -0700 From: Jakub Kicinski To: Felix =?UTF-8?B?SMO8dHRuZXI=?= Cc: "netdev@vger.kernel.org" , "dev@openvswitch.org" , "linux-kernel@vger.kernel.org" , Luca Czesla Subject: Re: [PATCH] net: openvswitch: fix race on port output Message-ID: <20230331212514.7a9ee3d9@kernel.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 Mar 2023 06:25:13 +0000 Felix H=C3=BCttner 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, > } >=20 > if (skb_rx_queue_recorded(skb)) { > + BUG_ON(unlikely(qcount =3D=3D 0)); DEBUG_NET_WARN_ON() > hash =3D skb_get_rx_queue(skb); > if (hash >=3D qoffset) > hash -=3D 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 =3D ovs_vport_rcu(dp, out_port); >=20 > - if (likely(vport)) { > + if (likely(vport && vport->dev->reg_state =3D=3D NETREG_REGISTERE= D)) { Without looking too closely netif_carrier_ok() seems like a more appropriate check for liveness on the datapath? > u16 mru =3D OVS_CB(skb)->mru; > u32 cutlen =3D OVS_CB(skb)->cutlen; >=20 > -- > 2.40.0 >=20 > Diese E Mail enth=C3=A4lt m=C3=B6glicherweise vertrauliche Inhalte und is= t nur f=C3=BCr die Verwertung durch den vorgesehenen Empf=C3=A4nger bestimm= t. Sollten Sie nicht der vorgesehene Empf=C3=A4nger sein, setzen Sie den Ab= sender bitte unverz=C3=BCglich in Kenntnis und l=C3=B6schen diese E Mail. H= inweise zum Datenschutz finden Sie hier. You gotta get rid of this to work upstream.