From nobody Fri May 3 07:52:34 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1579093053; cv=none; d=zohomail.com; s=zohoarc; b=ZiGd2ULlVfj3WZjeXlRgIaY/lScJUdR/SpRmlD80/+OHjj2GfprX1RjB2WP+n/JSCu1G8rFoOxn/IhwbkmexoH+ierATh/v98lb2/tiuMvR1cViwErmgveuj0SmpDKPHxVlcJwkQ9Jx8I+KZAtnzXUpgwQy/aDkB2QnEtQnPwxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579093053; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=vKW0/HrMv3if2JCAwrkKkfrfheUOsC0SebJScxn8h50=; b=IfhzOM64PcvKmN2voF8XYYZ9EcRuB3yVVCngn8lGLa9X3fvcJA5Hdn5htzXlnhUkepMQL5jjWdEaqIguXZc61O69ViUwymlOpEkWUlN0x/KYSx51KT270CQHkfCEktcIEpmVY9DbKnfL7j7hsDOIgHX+2q0zII6qd4SnGyy67jM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 157909305347321.931122707566374; Wed, 15 Jan 2020 04:57:33 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iriEA-0001mQ-9q; Wed, 15 Jan 2020 12:56:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1irhzu-0008Ng-Dv for xen-devel@lists.xenproject.org; Wed, 15 Jan 2020 12:42:10 +0000 Received: from mail-pj1-x1044.google.com (unknown [2607:f8b0:4864:20::1044]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 71d72d22-3794-11ea-ac27-bc764e2007e4; Wed, 15 Jan 2020 12:42:09 +0000 (UTC) Received: by mail-pj1-x1044.google.com with SMTP id n59so7670907pjb.1 for ; Wed, 15 Jan 2020 04:42:09 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee2:fbb9:75ba:e01f:bdbc:c547]) by smtp.gmail.com with ESMTPSA id y23sm12638990pjj.3.2020.01.15.04.42.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2020 04:42:08 -0800 (PST) X-Inumbo-ID: 71d72d22-3794-11ea-ac27-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=S3wXxo3Bh9oayGWM8jZCD/Gnpt0hNiPJrwn1QYGnm2M=; b=auOyDPgVe8RTFRbA5W4EWOXH32dZQVkLy+zdkE2NamNJ/gwg8H60PNu7Lv559iQMy8 +Uf1+gYH+3O1bRayk3SvFe+zasRl5E+RgFunTFI3s7zr7bU7UuUa1QBxGBGG0LzjsDze bQi12uwfRkAMQ5ouovUAbj1CdKvwlrV11g8viM4XpvGwjw2uUTQyDBK5JpP66aykCgEz vY4fGSxWClC5AyfgITKjn2lhV5F/HnF4oPzRneGRvIa3bOxw9iqRyEE2i+Uo3Kw/jc2L Y+091uGOMmax/zqpjYMMcGDh7guRcl1dBh8eCVyHEDYj1tDqyt/XpXF5PcMLIDmaHqeV 6Ijg== 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=S3wXxo3Bh9oayGWM8jZCD/Gnpt0hNiPJrwn1QYGnm2M=; b=bGe3/V95J6pBO47CG5RqfsoUy4C1GFjyUhkgjlu9Zvjtm5W2ybVPG+FxRh78Nnk81C iblmw+E0K/4xIhz/A2ZTORA0fDQcaLc3dSoIHjWLftjQQIxTX5VcVbw8eCodCuawMWPN HKNqXHWsHIvfGhLMMa4Mly2u5xt5nTmKg5qJyJqm4Pqx5RvV/+ZRdAwqAzbHSZrs3b56 8zsp+QzzJDGta0M57PzV5GANsRhOHE/MiBUIEO0r2UzJffANLRqeFObysU8SfdpOyy2L E/k1h97ETSI+8Chw2XgcCJXtcgcEHKMRzNVePha+D+HjJ29bCLl1ENeNAca2nt085cPI f/Vg== X-Gm-Message-State: APjAAAUE4E3xAlHGG2USYIwdc4S/sZH3PjhGxChE343V8DaMC0xttlmN a6/9eamXzu+x80r7pQdhXYw= X-Google-Smtp-Source: APXvYqzyYSD1kqH06PWZT5j+hjPxOJVeYfDpiBoVq5NBAlR42H2eqCY0MexVhcMO00FKLXtnuMtjCw== X-Received: by 2002:a17:902:bd08:: with SMTP id p8mr31051161pls.39.1579092128653; Wed, 15 Jan 2020 04:42:08 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: wei.liu@kernel.org, paul@xen.org, davem@davemloft.net Date: Wed, 15 Jan 2020 18:11:28 +0530 Message-Id: <20200115124129.5684-1-madhuparnabhowmik04@gmail.com> X-Mailer: git-send-email 2.17.1 X-Mailman-Approved-At: Wed, 15 Jan 2020 12:56:53 +0000 Subject: [Xen-devel] [PATCH] net: xen-netbank: 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c index 10d580c3dea3..30709bc9d170 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, =20 found =3D false; oldest =3D 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 =3D=3D len && memcmp(entry->tag, tag, len) =3D=3D 0) @@ -102,7 +103,8 @@ static void xenvif_flush_hash(struct xenvif *vif) =20 spin_lock_irqsave(&vif->hash.cache.lock, flags); =20 - 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)) { list_del_rcu(&entry->link); vif->hash.cache.count--; kfree_rcu(entry, rcu); --=20 2.17.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel