Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5642148rwl; Tue, 4 Apr 2023 01:11:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvEuuLjP2QxMzwKp0Uf6cmK77KvGkkR5vpy/82M9igUYVsgtDOVM0d4HSNsOawd9Tf0Je1 X-Received: by 2002:a17:906:5659:b0:931:99b5:6791 with SMTP id v25-20020a170906565900b0093199b56791mr1255850ejr.72.1680595913267; Tue, 04 Apr 2023 01:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680595913; cv=none; d=google.com; s=arc-20160816; b=ltCtUESpA10xraH/Q1G0QnVPyUV0CaHpT0Dp+UXhZgXbTtFW8HNiJx2SZXegK8AJoW z4HN/8mJ9j+qeL9yRh9u0ZhGlaL8h53GfxrDMnusH0BUWnrczfTtyxEArmgxjgfaXYh+ UBGJODMP5L7tsKSuXSp8OTdc0yosfQKMDz0c+yrU4E4Mr2JfunPWPRBROuu7XBhdbNRu 30LOs1gqtMTH+/FKb9iFAIOmY0hLvgzfQbm20Qbs1NIuBbGg044FmnMm24NmRDfLHPch ReifHPtMI110VHetV1MfyGIXMK7obOpVcTrEFqcHBRdRfRc2OeW+Ic4TMTOFzJffpv8U t3HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=uLC0a7DxplgQxhIinAhxaMbouy0O0EScetwGutLULnU=; b=MtDzcJKsUIAaOHlOUavxFPBuHSfIf3HBhstCiMm9dKMPkEYtW+JDyajJRcDBa+2W83 mZ1oaJkcnoTjyn0TxRTXdRjPyuiGrxnviUlC34YCNKnccBlMXgStsuLa1SU0O3Nw0/ul QnwvwrxshVM9nL2HYYbu7l/jdv2FoGQOV9cEhbO4d1w5R7cjs+FGguF1MnTTtENcybJU uK/MDHdBkIA/y8+X9RfG9e0ObACUt7NFWNd6x+ybTKq5x8nKKGa1mnZ/aNU4m4rx9kfN yyRYGJUzqu0N/I0y62RkCtBqzyttwKfBOSUKXDjS28Mt6bmT3Ik50sYecLura4kMsnT8 t/VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=C3umL2sL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x9-20020a170906134900b008cc8a6fea26si10515260ejb.561.2023.04.04.01.11.29; Tue, 04 Apr 2023 01:11:53 -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=@google.com header.s=20210112 header.b=C3umL2sL; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233992AbjDDIDi (ORCPT + 99 others); Tue, 4 Apr 2023 04:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234042AbjDDIDg (ORCPT ); Tue, 4 Apr 2023 04:03:36 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B1DE19A4 for ; Tue, 4 Apr 2023 01:03:35 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id e18so31793142wra.9 for ; Tue, 04 Apr 2023 01:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680595414; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uLC0a7DxplgQxhIinAhxaMbouy0O0EScetwGutLULnU=; b=C3umL2sL2L6g2WqZKMb0qBoqC/R/7Wc4c9y3uWodvXoc+RVrPC19CYhM2St2UIMx3b 5p5L6w1mNQZgefefOcHQ9umqINmgluIKQK40iGF7qlayGUn2FYFCGtE8MgN7tM0Nx3+S GldxFgDidl6qU2lnBrYEY++kpoDXMX88krsysAVeoiMYVF97fPVfRIXLNDaPdWpiPsRU mIwfUDqmrswLWJ9IDgxx5EkbNl55nSViMxcFpKcaeAdZhf6JJBPvXrcNcWvw62OpR5Xz FfsOxZ07bJ1AdPogkmQLXBquyahpxXBFwbDW/49vEG7x2UgSFd4L/5plxjYjo88nxWJV FJow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680595414; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uLC0a7DxplgQxhIinAhxaMbouy0O0EScetwGutLULnU=; b=rJzLKfa8Q3X/Q6ormPe9TZizJCUEh1jvrfXMAua3j7i98AD/3s6UzxBljqdOtX7ETv d47JSQwOMK91bICnv6/pIf5QoDZ2BcdC6d4AdKBYxJh29n2aaGnSakYWvNFyYj4Vu3ho 0BvzlWcCJHSgWaGWQKkOWovcsFFXEuZNtC4GfIaURzKbnVYT15b8Z5PpZs2DqlxuDuyk sim45OBlUVBGHwiky7s9Kbyu8rF/YKjAqO4f9EouyFqY33VyDM3el9utVQy40I4WO+19 K1azgOObEOc7jMYh5PMafnoHJzPE4amSTRAegMdrc5bgBDfJrBH77QumbruYQ0tKAoMJ OdVA== X-Gm-Message-State: AAQBX9cl+DF3wQVUWWq0DvpljWaYPbN0Z5MUI2L+xwHnn6+62UYjFox9 poaM01SfpdTdr5hObG5FQLHpqqWgmdpSM+8IUcAKtg== X-Received: by 2002:a5d:5649:0:b0:2e4:cbef:9f36 with SMTP id j9-20020a5d5649000000b002e4cbef9f36mr278319wrw.12.1680595413631; Tue, 04 Apr 2023 01:03:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Dumazet Date: Tue, 4 Apr 2023 10:03:21 +0200 Message-ID: Subject: Re: [PATCH net v2] net: openvswitch: fix race on port output To: Felix Huettner Cc: netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org, pshelar@ovn.org, davem@davemloft.net, luca.czesla@mail.schwarz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 Tue, Apr 4, 2023 at 9:33=E2=80=AFAM Felix Huettner wrote: > > assume the following setup on a single machine: > 1. An openvswitch instance with one bridge and default flows > 2. two network namespaces "server" and "client" > 3. two ovs interfaces "server" and "client" on the bridge > 4. for each ovs interface a veth pair with a matching name and 32 rx and > tx queues > 5. move the ends of the veth pairs to the respective network namespaces > 6. assign ip addresses to each of the veth ends in the namespaces (needs > to be the same subnet) > 7. start some http server on the server network namespace > 8. test if a client in the client namespace can reach the http server > > when following the actions below the host has a chance of getting a cpu > stuck in a infinite loop: > 1. send a large amount of parallel requests to the http server (around > 3000 curls should work) > 2. in parallel delete the network namespace (do not delete interfaces or > stop the server, just kill the namespace) > > Fixes: 7f8a436eaa2c ("openvswitch: Add conntrack action") > Co-developed-by: Luca Czesla > Signed-off-by: Luca Czesla > Signed-off-by: Felix Huettner > --- > v2: > - replace BUG_ON with DEBUG_NET_WARN_ON_ONCE > - use netif_carrier_ok() instead of checking for NETREG_REGISTERED > v1: https://lore.kernel.org/netdev/ZCaXfZTwS9MVk8yZ@kernel-bug-kernel-bug= / > > net/core/dev.c | 1 + > net/openvswitch/actions.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 253584777101..37b26017f458 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)) { > + DEBUG_NET_WARN_ON_ONCE(unlikely(qcount =3D=3D 0)); No need for unlikely(), it is already done in DEBUG_NET_WARN_ON_ONCE() Thanks.