From patchwork Wed Jan 15 14:18:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madhuparna Bhowmik X-Patchwork-Id: 11334975 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8D8BD1398 for ; Wed, 15 Jan 2020 14:21:52 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66B6A214AF for ; Wed, 15 Jan 2020 14:21:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kIWJKZcs" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66B6A214AF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irjWF-0000dz-Q2; Wed, 15 Jan 2020 14:19:39 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irjWE-0000du-GN for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 14:19:38 +0000 X-Inumbo-ID: 0fbdf9dc-37a2-11ea-b89f-bc764e2007e4 Received: from mail-pg1-x544.google.com (unknown [2607:f8b0:4864:20::544]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 0fbdf9dc-37a2-11ea-b89f-bc764e2007e4; Wed, 15 Jan 2020 14:19:38 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id q127so8284599pga.4 for ; Wed, 15 Jan 2020 06:19:38 -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=rv/DqUwBL0cLyteq+cLEvFpPEt4GgePPdmAX2ItXChM=; b=kIWJKZcsvkuUZvwRivtFvgIWWDo/Tti9TY17prXqhn8ou+0J4BFvJ8oIYES3K08qiV R2Vd/rvzIe6i8Dil+hZ1hPy5ShyssowGgZBxu6/JRIa6PsjSIBRLZaXZ8XByGPpMGHXb HMEh9ZxA9USfjlI/OVFGBEnv4FMtGnmgrp8YW8Bne7Sob31aw40Lz7ldLM/hNyY+ouRL nO67kdJRx5Qqwd6mEg1nF2oLI06lV89EutTw90xedrb8KftavppvbuE85RQRPFz+aWLB jofInZLvvseBm3dWeaCgohHSctkr/z6cg19t3fVZFRNbnLUnK+IO6HNECzCuhrooY2aC 7PAg== 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=rv/DqUwBL0cLyteq+cLEvFpPEt4GgePPdmAX2ItXChM=; b=etaDSMxXezF54vRir39loGzVM5Z90fjoN/0VenN85sspvezVjCDoHzclW+fjJp+i+/ lbUQcKHpeYveqFVrdJJo2wQmfZF/MIxEQX+ZnPYnbeEfPoURn0VyZC6kz5eRXrnhwHnZ cLiPiVcNqSJB4r8ekauCGh3kXNfoXJbKS3XzVkXOkasA9ULX5fJ16Z3g0P+V3qWIqKaf zavMTWtC8ARFe7OlxsA8uHi+cdajPjQ6/HaB2kEQwve8j6UjjgqxR2N+QMArvSPDb8I6 FSgT7/emzWzdUgZx+Wnpr/hreXS+JjvOlRJpceOd6fM9r5H5GiaoK/sEWX0G+LmZMU2j oOzw== X-Gm-Message-State: APjAAAVyjGmi1bcjzy78c3OxJ8x3cJF7CtNZXgtBp91vfKBwordT2MWU GEQQC/fwEC3EK8LXoW6BKjU= X-Google-Smtp-Source: APXvYqw/Ek4M3Mu/gGAWjG9C64Bz9YXgOVv1wSXGZqMVwUNkMRrlLduGljYrzFwonam0LSkXgoxpww== X-Received: by 2002:a63:534d:: with SMTP id t13mr31890500pgl.89.1579097977017; Wed, 15 Jan 2020 06:19:37 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee8:ed72:75ba:e01f:bdbc:c547]) by smtp.gmail.com with ESMTPSA id p35sm21208425pgl.47.2020.01.15.06.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 06:19:36 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: wei.liu@kernel.org, paul@xen.org Date: Wed, 15 Jan 2020 19:48:40 +0530 Message-Id: <20200115141840.10553-1-madhuparnabhowmik04@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [Xen-devel] [PATCH] net: xen-netback: hash.c: Use built-in RCU list checking X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: paulmck@kernel.org, frextrite@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, xen-devel@lists.xenproject.org, linux-kernel-mentees@lists.linuxfoundation.org, Madhuparna Bhowmik MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Madhuparna Bhowmik list_for_each_entry_rcu has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu. Signed-off-by: Madhuparna Bhowmik --- drivers/net/xen-netback/hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c index 10d580c3dea3..3f9783f70a75 100644 --- a/drivers/net/xen-netback/hash.c +++ b/drivers/net/xen-netback/hash.c @@ -51,7 +51,8 @@ static void xenvif_add_hash(struct xenvif *vif, const u8 *tag, found = false; oldest = NULL; - list_for_each_entry_rcu(entry, &vif->hash.cache.list, link) { + list_for_each_entry_rcu(entry, &vif->hash.cache.list, link, + lockdep_is_held(&vif->hash.cache.lock)) { /* Make sure we don't add duplicate entries */ if (entry->len == len && memcmp(entry->tag, tag, len) == 0)