From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 425E3C433DF for ; Fri, 16 Oct 2020 23:46:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C637A22200 for ; Fri, 16 Oct 2020 23:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602891971; bh=Dnv8ptGKZA37R38BIVdH4VBeUuevLU0PNBY/75vdbwQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=YKhsqvwmtNiQ9itd+JZgxE/SpFE2SKVKhlekz0Ksxol/X3TQ04bnIk1/tvEPPggx+ X8cLZCy9dlFOy6BnNiIsM+Ky7/mf8eMZomil4ehEGD5Wb6rj3bINbeGVPXE924uH9m Ecm2Remt7dAiOFu1Sy5xHgSmdXfKtW4nsf3bEM0I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2409775AbgJPXpW (ORCPT ); Fri, 16 Oct 2020 19:45:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:59368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392392AbgJPXpV (ORCPT ); Fri, 16 Oct 2020 19:45:21 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 327F1221FD; Fri, 16 Oct 2020 23:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602891969; bh=Dnv8ptGKZA37R38BIVdH4VBeUuevLU0PNBY/75vdbwQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xiAjw70t6VN/+8UBFS/SI0uqvLZIZL1m9/OVa6fhhghfduFdcx2/9PIf2wOZFBPsz RzpL90WBx7HSuNs8Q/6SLU0mpn2dgeDNtHKsbIZN8NtDZo0Q8GUMkLazPTV/s427zW 2yLW+N8MRQXbazNOX6Gxx5wbzPkomzzpt4nwEW/c= Date: Fri, 16 Oct 2020 16:46:07 -0700 From: Jakub Kicinski To: Eelco Chaudron Cc: netdev@vger.kernel.org, davem@davemloft.net, dev@openvswitch.org, pabeni@redhat.com, pshelar@ovn.org, jlelli@redhat.com, bigeasy@linutronix.de, i.maximets@ovn.org Subject: Re: [PATCH net v3] net: openvswitch: fix to make sure flow_lookup() is not preempted Message-ID: <20201016164607.4244ca24@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <160278168341.905188.913081997609088316.stgit@ebuild> References: <160278168341.905188.913081997609088316.stgit@ebuild> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, 15 Oct 2020 19:09:33 +0200 Eelco Chaudron wrote: > The flow_lookup() function uses per CPU variables, which must be called > with BH disabled. However, this is fine in the general NAPI use case > where the local BH is disabled. But, it's also called from the netlink > context. The below patch makes sure that even in the netlink path, the > BH is disabled. > > In addition, u64_stats_update_begin() requires a lock to ensure one writer > which is not ensured here. Making it per-CPU and disabling NAPI (softirq) > ensures that there is always only one writer. > > Fixes: eac87c413bf9 ("net: openvswitch: reorder masks array based on usage") > Reported-by: Juri Lelli > Signed-off-by: Eelco Chaudron Hi Eelco, looks like this doesn't apply after the 5.10 merges. Please respin on top of the current net.