Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp592126ybl; Tue, 7 Jan 2020 11:30:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzkfeUoGtNqHo/fC3MzWb8HlqVDMnopu03SthLqmkX9EAsg66F0B/ovHN020nW4jtkhhFTo X-Received: by 2002:a9d:799a:: with SMTP id h26mr1345074otm.240.1578425445626; Tue, 07 Jan 2020 11:30:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578425445; cv=none; d=google.com; s=arc-20160816; b=px7jX0VsQhwpxmEREn5QycKcBqKu2cmNvKTHCTSct7gTqJVuunHdHsYDzVj9Qjp9hr W/45TlRdcV3iP9T2iMm62VaaEYSAfY7KCQBY6wdRyke1MrabgkH8H0FmmCuggyeJ9GXQ cXOiS6Ur4HxqjAI8xWNqfNTpui9vjKJQpqtPjh5DR9urmDO33hT/WqktuvYSdxx9r6ge 3TMQeiNw1XQpmioYP73ykoTRKJ+ly4gwsPfxTGAYx8728gbJJEMXE34Vu3l3NglhLua/ Tu0OCsKRHTHCKaPdiNiGo8ILK3MP79OVS7RnInXQMa5c8RIHxTY00LCUz+iv33pts2OD HHNQ== 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=vHcS5MGixSiDikhb0k92gL0arFETtVoaijzCLdHtLs4=; b=OMks1Ahyj09gI56R6Dh+iklXVhKcwRRlCJJkBNlD0UvoHg0sua3LpUVfhtdcfJJLVM iq5JKcD/kHo7vDYHLRmkVkhhWqeip3OT4igTOdwsXP94+pHAVLKs7clj3yArIL8tyeya pdYIYN8Avv0zsXf8nGIDeBXY6qmTSLSgY3SYG6ZyBHwrDIQcPhxcMf5att6v2p6eh77O 1wqoSmXpSGrbvfXtYAJnPomhIb31Oted+HkVwxiGNT6zYLVXuSXoxPJcBSPKCw1mkWVd CLF3aHrPhmK0M9ePML/592Rk/atrTk6XkBOKwyJ9/t+Avvdd0IXvir1SxxdbEvZ/aJ/8 eycg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Doa0xXd4; 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 v4si472292otr.123.2020.01.07.11.30.32; Tue, 07 Jan 2020 11:30:45 -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=Doa0xXd4; 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 S1728653AbgAGT3X (ORCPT + 99 others); Tue, 7 Jan 2020 14:29:23 -0500 Received: from mail-pj1-f68.google.com ([209.85.216.68]:40338 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728358AbgAGT3X (ORCPT ); Tue, 7 Jan 2020 14:29:23 -0500 Received: by mail-pj1-f68.google.com with SMTP id bg7so210204pjb.5; Tue, 07 Jan 2020 11:29:23 -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=vHcS5MGixSiDikhb0k92gL0arFETtVoaijzCLdHtLs4=; b=Doa0xXd4L03LriDOdzUb4PU2OvOqF2EQ8JOzdGLm73k7Vxe/dz15NwT7qpKFg8RrNJ 65cNAAU4n7s14QuA25hrNAMpkYen3wc6txbuBvmkpRgQvOY3zSfU9Kt6DtpqFVmwFFty IR/ORtSpbVlygr3LEUQwC9kKqZWpt/myftShQUzkBPuN0sZ0IgtTI34IVdXtQJE8VIHw MDjsz/M4AqyXXrBtJOFfLD2fPWfSjUgt6BxH5ZDSFwelFWyIA7/W4dRdHhCtWL+oLDOd 1lhLfZ5sQ7/mfya9t5ChQCM/176AKI/2Jl6+r+bZuIZ9TSMv8syU0lh7RCMnq9lZjp/D Rm8A== 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=vHcS5MGixSiDikhb0k92gL0arFETtVoaijzCLdHtLs4=; b=jTXYhoxUs3KCC1Tn8dqKrgGHBq9pTDaN0KeWnFt3Rch9IRjmGkd5N11TZNq861VbE0 yMK/4GvoFTkYrVyQvWHgd9UriKCFHjnamQuiYwMsakCFp3jRq9Mxe1jdWbjXh+I4BuMH b8iTXmKoh1vYprCfHSIInuT+ffteermz40Y7meX89CoJrrnYgsIvFPLEzzgcedJtg93D I89r3jPnd6PcLTRQ6v5LTs2/JbF1twbV0lRprBvXz/XNXRdHnA2LACEZMZ1Pg9Zdvea5 wVNuXxe/5RPDfFthNpmw3JviFJo4axTrUDxQhnTQ/z6UCxPO5nNbk1neI6bv2tpN0LpZ jm6A== X-Gm-Message-State: APjAAAUbJrZlkwjiIQw0STWAKZMw9GSybWWpaFicYPJbKNR+YcfeNrGq 3DUZsOwmNtFzyNbxblhqi5Y= X-Received: by 2002:a17:902:426:: with SMTP id 35mr1291908ple.176.1578425362592; Tue, 07 Jan 2020 11:29:22 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee3:fd53:8500:6ea8:4ef2:c9be]) by smtp.gmail.com with ESMTPSA id w7sm333554pjb.31.2020.01.07.11.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 11:29:22 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, dledford@redhat.com, paulmck@kernel.org Cc: rcu@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Madhuparna Bhowmik Subject: [PATCH 1/3] infiniband: hw: hfi1: verbs.c: Use built-in RCU list checking Date: Wed, 8 Jan 2020 00:59:12 +0530 Message-Id: <20200107192912.22691-1-madhuparnabhowmik04@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 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/infiniband/hw/hfi1/verbs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hfi1/verbs.c b/drivers/infiniband/hw/hfi1/verbs.c index 089e201d7550..e6abdbcb4ffb 100644 --- a/drivers/infiniband/hw/hfi1/verbs.c +++ b/drivers/infiniband/hw/hfi1/verbs.c @@ -515,7 +515,8 @@ static inline void hfi1_handle_packet(struct hfi1_packet *packet, opa_get_lid(packet->dlid, 9B)); if (!mcast) goto drop; - list_for_each_entry_rcu(p, &mcast->qp_list, list) { + list_for_each_entry_rcu(p, &mcast->qp_list, list, + lock_is_held(&(ibp->rvp.lock).dep_map)) { packet->qp = p->qp; if (hfi1_do_pkey_check(packet)) goto drop; -- 2.17.1