From patchwork Mon Dec 11 13:04:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vacek X-Patchwork-Id: 176705 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7030844vqy; Mon, 11 Dec 2023 05:05:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/NsF6iNgfG2AL0wIdFTkFAetg6IyRkmN00YZD90slSwlyhI3eQqjEY5vXCZF9SKhVsBPZ X-Received: by 2002:a17:902:a386:b0:1d0:4539:dbd with SMTP id x6-20020a170902a38600b001d045390dbdmr1825990pla.3.1702299906608; Mon, 11 Dec 2023 05:05:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702299906; cv=none; d=google.com; s=arc-20160816; b=Pifa/H2yUGRMQh1hetS4o52EdxfwfhTlmiNNKzZIBRCouZuS7pKD/venbc7PaOdy9V QpTAC9/BabhehfiLPXhSktWqp3UP9K3maSxX2DPOuL/KKSG7iGqaGrpK9AfdUrg6QETt 5RX0ADgQjEYYFbVBdC14FPz0gyK4VFsU7k5UUps032jJs6oPaNjprH6+QRaUkCu2cykY 2sxpXHCvfoSxwtbg1g7UlSsTTl84yqE0Y30fDNdlhgCVbQJ8menjO0PKFVxcAaJK+s8/ utl5I/xRpNQ63nLR2AA+35ePxJ57NH5rcpWaQddybOpHS9vIf06W1OOkZXUAEb2EG/2O 3vcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=giFVLOTqkebo2x+oA3YA6G6HzBfr3m1iYomgrY5Darc=; fh=kUHVXghdBMLDUJvQ4SlMugBa0raJHHo/i5LV5D2iUJQ=; b=eCHIqYIUvQWTpQ/sCUp/KbSg9/lvEIkU+WmpxRMaDynHo+Nwsw7sEBOmvgUG54zrzj KPlhBoGKIgILBc1RBgLWURIWY/udSXHiZJpWgXVGFuR4+qq+gsbiFmz2VB1OYxuux30/ 2Ev//vvXkbR8dJmv8qj4EkzPGJ1S+AEimoTQ5IbFHDCrkkUs0yjMMQloB0AUYxuxztTD CNdgTPPGWjWO2mmsCaPBhFCCyauCq2BiKRWJk/B7jM8L62YgEYbxmHCKQHBegvdJZygs j+KGHuxUwRHIiSsYGNKv7Y5WqAf9PSN3sQ7EqP5/0Hc5j7j6pczf0jQ4mMxVsatMrpBs V64Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WW+xx/EF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u5-20020a170903124500b001d07b6a0af2si6094334plh.204.2023.12.11.05.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:05:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="WW+xx/EF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 1ED298059147; Mon, 11 Dec 2023 05:05:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343596AbjLKNEc (ORCPT + 99 others); Mon, 11 Dec 2023 08:04:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343576AbjLKNEb (ORCPT ); Mon, 11 Dec 2023 08:04:31 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64E32C6 for ; Mon, 11 Dec 2023 05:04:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702299877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=giFVLOTqkebo2x+oA3YA6G6HzBfr3m1iYomgrY5Darc=; b=WW+xx/EFCET7haeCoIXNIYTQmBszVT/HZ3owFg/9KMaVldbyeRxSjwM3wSuvNua0IA4fX0 MVnJbq/1JLMCcyiZglOIsnteuQKPnCQTSTgnVFZBbBtgITZca/n/ueqIFOwbf3WMVuGJD9 s6EFR1vihPoZJXw3pZTGWyUVtVyzt3A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-111-X5XFshiTM9O69vzQtEUuRQ-1; Mon, 11 Dec 2023 08:04:35 -0500 X-MC-Unique: X5XFshiTM9O69vzQtEUuRQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D514D830F32; Mon, 11 Dec 2023 13:04:34 +0000 (UTC) Received: from metal.redhat.com (unknown [10.45.224.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 804F51C060B1; Mon, 11 Dec 2023 13:04:33 +0000 (UTC) From: Daniel Vacek To: Jason Gunthorpe , Leon Romanovsky Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Vacek Subject: [PATCH 2/2] IB/ipoib: Clean up redundant netif_addr_lock Date: Mon, 11 Dec 2023 14:04:25 +0100 Message-ID: <20231211130426.1500427-3-neelx@redhat.com> In-Reply-To: <20231211130426.1500427-1-neelx@redhat.com> References: <20231211130426.1500427-1-neelx@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 05:05:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784990827143190665 X-GMAIL-MSGID: 1784990827143190665 A single memory load does not need to be protected by any lock. The same priv->flags are fetched 15 lines ago without locking anyways. Signed-off-by: Daniel Vacek --- drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 8e4f2c8839be..f54e0d212630 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c @@ -572,13 +572,9 @@ void ipoib_mcast_join_task(struct work_struct *work) return; } priv->local_lid = port_attr.lid; - netif_addr_lock_bh(dev); - if (!test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags)) { - netif_addr_unlock_bh(dev); + if (!test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags)) return; - } - netif_addr_unlock_bh(dev); mutex_lock(&priv->mcast_mutex); spin_lock_irq(&priv->lock);