From patchwork Tue Feb 18 19:57:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhuparna Bhowmik X-Patchwork-Id: 1240308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=UQ+9pXbD; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48MWqW1zTmz9sSR for ; Wed, 19 Feb 2020 06:57:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B520B86578; Tue, 18 Feb 2020 19:57:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ur1tS-NfdMOB; Tue, 18 Feb 2020 19:57:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id C1D42865F6; Tue, 18 Feb 2020 19:57:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A9939C08A0; Tue, 18 Feb 2020 19:57:56 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id F3410C08A0 for ; Tue, 18 Feb 2020 19:57:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EF56020372 for ; Tue, 18 Feb 2020 19:57:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mkEql38d11mO for ; Tue, 18 Feb 2020 19:57:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by silver.osuosl.org (Postfix) with ESMTPS id 7A7D92000E for ; Tue, 18 Feb 2020 19:57:55 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id i6so11197934pfc.1 for ; Tue, 18 Feb 2020 11:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=93cUwvRz5DcbF2nQaz+gagk6IvPBCJp98CU5NTDjQMY=; b=UQ+9pXbDMmbdwA6F96Qv1VTxfWIz+JpDgMRfBgEwsI2/DxQA8d1YYv3LhqeSWvFyG3 KySMupXsPLTKR8WIfSgIj374RP/tpNY6rn9kI85B2bdUZKNIAI4bBtweOJJkv+UufbfL OsHJC1WfHbmkTo4aTz0APkZDFAdFavuyyZd6ZXl1OwPo93zeo/bz8FthImtkeCMnvSFS vLhtX0zbw3wAuwNmOtJU6nw6SWTGmqPVqAubM0XpVuoS5kogsoQOXzF6YzD7MGj+PfLU FaP2WqUchlHEnqt0TtGb4plEPa9QcyJBK/mJcXAwrN+vzxkqCENzHeZu0Lh3Yb+lIkhs cIYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=93cUwvRz5DcbF2nQaz+gagk6IvPBCJp98CU5NTDjQMY=; b=eTM1z1+y5+qJOIUJ2AGNjw310XKkEAkQK5ikSHVidc1W7qHPGZn4PyiuaZQ5G6eYUp Ml9EoumZSyQxLqAW83uOU6MBAAPm8//0xw10vMzy67rkZfCnnkfnOxsqnjkW8zDczgKp P588fm9wY8G820Po8Gas6XtlR4FthyWYTg+ZUJi8LSjjAznsvkIu7UsBSR5pAfLjrqUh QP5UTgah06o4pSNbIxKb1wEFXe77whPJKYE8OR3Qzh9WYeDVp9AZv94B7q7xeENYaaTI YpGdAAOAzjx8nHa3lEcNaX5u6L3/rZxJ2Vc1AkNswyDM/xSlMDO2RNVALGtRz8ZaQ5Ly A2QQ== X-Gm-Message-State: APjAAAXiy8y0dTZWmdW3GHOhjBig4djQll2rmPNrj0dwcMcBrwb2tBLN Ku/mOBrkWpzaEr4wbYrw32D8Z+M= X-Google-Smtp-Source: APXvYqzmmai+702KiOlcfbcc3ZFX7jmIWdGXi8fVhYaR8Nc3GJgeHndI1Pldb3SlGbLRf31qGdaxsA== X-Received: by 2002:a63:4525:: with SMTP id s37mr24073227pga.418.1582055875098; Tue, 18 Feb 2020 11:57:55 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee3:ff08:f869:e1e5:121e:cdbf]) by smtp.gmail.com with ESMTPSA id d4sm4038413pjz.12.2020.02.18.11.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:57:54 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: pshelar@ovn.org, davem@davemloft.net Date: Wed, 19 Feb 2020 01:27:42 +0530 Message-Id: <20200218195742.2636-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: dev@openvswitch.org, paulmck@kernel.org, frextrite@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Madhuparna Bhowmik , joel@joelfernandes.org, linux-kernel-mentees@lists.linuxfoundation.org Subject: [ovs-dev] [PATCH 2/4] vport.c: Use built-in RCU list checking X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Madhuparna Bhowmik hlist_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled by default. Signed-off-by: Madhuparna Bhowmik --- net/openvswitch/vport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 5da9392b03d6..47febb4504f0 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -96,7 +96,8 @@ struct vport *ovs_vport_locate(const struct net *net, const char *name) struct hlist_head *bucket = hash_bucket(net, name); struct vport *vport; - hlist_for_each_entry_rcu(vport, bucket, hash_node) + hlist_for_each_entry_rcu(vport, bucket, hash_node, + lockdep_ovsl_is_held()) if (!strcmp(name, ovs_vport_name(vport)) && net_eq(ovs_dp_get_net(vport->dp), net)) return vport;