Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3952505rdb; Mon, 11 Dec 2023 05:05:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5qyGPyyDmpGMCtWl1TQd481avyfrJtlftFqrj6wBAcazVROIn+OqoSGjFhHRNqczSks3F X-Received: by 2002:a05:6a00:1a8e:b0:6ce:f525:6fa1 with SMTP id e14-20020a056a001a8e00b006cef5256fa1mr1207642pfv.46.1702299905922; Mon, 11 Dec 2023 05:05:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702299905; cv=none; d=google.com; s=arc-20160816; b=S96iZREFe7wDsShjG9ju4Gh9xprYYnPTfUpXFjjeIt+tULvLNiCSX8d363uaTutJY9 Sov07TpkVYmE0VIh70CjxWs34LNsItG9wM3fWrElG8t9+Jdr6icN7/8Nc7/3qsRiq3JF oryEl6mp7BhO9pqGE7oiG95s4UqovLM3iZs3VRof0Gjr7EDpVVFmDLgHt/k1NHZsuzx4 zgEF+LvFLbGzEP9gPYMztfZZaWO7NChpTpXHKvEfbjObRi7/vga+ySsb3RJxZH7fdIF6 efItKFDFBfEpYrwVfsTBnbBP4mg17ndV+EhKJGH7FHR8beryjjID1j0zZCaDl0jAja6b FvUg== 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id 189-20020a6300c6000000b005c615702198si5937390pga.703.2023.12.11.05.05.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:05:05 -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 8570180A688A; Mon, 11 Dec 2023 05:05:03 -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 Content-Transfer-Encoding: 8bit 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:03 -0800 (PST) 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); -- 2.43.0