Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6204297ybv; Tue, 18 Feb 2020 12:00:13 -0800 (PST) X-Google-Smtp-Source: APXvYqyu5SFCbTymwXyRrpGexpWPjctCPKKUy7WYlDUZcfuixjmm2g1idpAhNRotACEAOG3/zyVh X-Received: by 2002:a05:6830:1289:: with SMTP id z9mr17849348otp.317.1582056013023; Tue, 18 Feb 2020 12:00:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582056013; cv=none; d=google.com; s=arc-20160816; b=RRGbPzfze4keOkY9JE/QNHerVG2t8XhKOjW+GftgK4Y9wFPdarIOPWjgWmpruB2dxC lloeIOQZVkakbqiD4rrR7I0NZw3HIIN04QKWJ5dueZKf5rrGoooSWi1YrbjKsRpxsBjj y+jL6I9gws+1jH7mJofXLchPWAe5G6oIaz0R1nLCExNW0hKihPctveeVWuisgRS8n5aU Temo2gGPFbJ/L8xQrZq1PtKBSNlEO7GmVlrsjuGLCaL3BeO9WEUVE6JJ4OH5UY85lE2G 2uTqCZXRkDkFIjhp3zD5PTEyOELG4s9LcIalb6UhIOVAeKiItG33mzHhBIkIRYg5By+T fsjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=QiZww/RzBIiqsbrHHxIYSu/iuDgV4YFLQLrfy6sFiNk=; b=IZCLrM/fK0cI1PIBBpIDdho6ir0arUc9qVLwv/kxb9sIAS9IxKy7gkgJhPyvVGZmvu cgOOsOGXIDcaZGJXo6zGwKBne5PTuEUrBX1aEHp/Fnc14zD/oGK3H2CYILMbd5XjBqTj 56HGakMQL8OwjbLSDHJ9HwtB7hZbuKnNu0a3CuX/0pWf0U5BXmfQ09NOQmZHAYgn7Kws ABWltKtpV+br8tC8BWt9Ng5ofuLnXZIcvD8I/Gb4LZ9VrKzuAGmwBbVig0I30I722RMx 12jNt9fiHDmk9xWRJlzPZpdGW5FqXd6l2c2yaeOP3uuBkWKyeD0zjinSzYT0gwm3coLu AmrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cjnbef0k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si8389693oie.116.2020.02.18.12.00.00; Tue, 18 Feb 2020 12:00:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Cjnbef0k; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728230AbgBRT6h (ORCPT + 99 others); Tue, 18 Feb 2020 14:58:37 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39734 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728179AbgBRT6a (ORCPT ); Tue, 18 Feb 2020 14:58:30 -0500 Received: by mail-pl1-f196.google.com with SMTP id g6so8511100plp.6; Tue, 18 Feb 2020 11:58:29 -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=QiZww/RzBIiqsbrHHxIYSu/iuDgV4YFLQLrfy6sFiNk=; b=Cjnbef0k4m3B/ywmq6dWoUbGU3Ag1/Zc52LYCXAhwdYSC+or3uUZwbzROS2iVMTzAi YLO/erejLW1NG2U06RoeMfO1zgQmJmqz+yEvzqfRgMJQ0vvXzD2K0qAYliuPrqsSu7+t 71G2NPYLlCmUTztI1DY+qu3oCHsl+Ww+xbdsUfnr6DHkjxmkyutlIF+MufPXN1YNzqVa PAmYLF77yJwYfhVIasqfzPGJUeU7bmVxrvWjLK8Rx+T8YdhMhn4Fxpb5gfsrZtiXywAH DWI5q18zqSpsKLE1sCtbYUZdsP+g8qrmRnqK3okYMZcAjNqktRCVduYKjHvFRkg0K6BR v+FA== 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=QiZww/RzBIiqsbrHHxIYSu/iuDgV4YFLQLrfy6sFiNk=; b=bpoCdpDXG3SsgQsd9TD4rNAHyoSXcl4dv5w9VA3JRvntuFH+l+pDfKZ6lvU4Gr0pyW KG0Ru6KYdQVWptk3Wgy588sOzfj3RJchpyoIQbzmlnNsILexWYgDx5XjDGkvOFqRVIJS QvF9p4n6ZoYKYzyfRRoEUTS7oY/sgO70hK+OsRikxTG5TXSoyqEJei5NPexzImJr8xM8 NXWAtstTverRINi+h3BFGkZs2bO+uyz6oYe4XQmnFm2K2oyqB4QuDselIcXTq9VU5ihV Zx9ThtAX9LQDEmNnhdktCjcYxEWcq2eYThU6D77g6FLc4pipzkWbb8NBAy55DlOpYWRq pkog== X-Gm-Message-State: APjAAAWogzaVEdXlbBgI63cCwwzYVOscuvRp2liOfKPX03M/Huez8R25 gMzT0rhzj8re67RJSlBZzxl52m0= X-Received: by 2002:a17:902:6ac2:: with SMTP id i2mr22116151plt.221.1582055909574; Tue, 18 Feb 2020 11:58:29 -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 k4sm5118883pfg.40.2020.02.18.11.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Feb 2020 11:58:28 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: pshelar@ovn.org, davem@davemloft.net Cc: netdev@vger.kernel.org, dev@openvswitch.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, paulmck@kernel.org, Madhuparna Bhowmik Subject: [PATCH 4/4] flow_table.c: Use built-in RCU list checking Date: Wed, 19 Feb 2020 01:28:20 +0530 Message-Id: <20200218195820.2769-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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/flow_table.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c index 5904e93e5765..fd8a01ca7a2d 100644 --- a/net/openvswitch/flow_table.c +++ b/net/openvswitch/flow_table.c @@ -585,7 +585,8 @@ static struct sw_flow *masked_flow_lookup(struct table_instance *ti, head = find_bucket(ti, hash); (*n_mask_hit)++; - hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver]) { + hlist_for_each_entry_rcu(flow, head, flow_table.node[ti->node_ver], + lockdep_ovsl_is_held()) { if (flow->mask == mask && flow->flow_table.hash == hash && flow_cmp_masked_key(flow, &masked_key, &mask->range)) return flow; @@ -769,7 +770,8 @@ struct sw_flow *ovs_flow_tbl_lookup_ufid(struct flow_table *tbl, hash = ufid_hash(ufid); head = find_bucket(ti, hash); - hlist_for_each_entry_rcu(flow, head, ufid_table.node[ti->node_ver]) { + hlist_for_each_entry_rcu(flow, head, ufid_table.node[ti->node_ver], + lockdep_ovsl_is_held()) { if (flow->ufid_table.hash == hash && ovs_flow_cmp_ufid(flow, ufid)) return flow; -- 2.17.1