Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3342538ybl; Mon, 19 Aug 2019 17:06:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDvyo2e9vlZQUcRuEca1KEAIN6jUdoJLgCw8RarSsv1E24fSSvI/b0V7b68Cnb3bjbKpVB X-Received: by 2002:a17:90a:5806:: with SMTP id h6mr22817308pji.126.1566259573094; Mon, 19 Aug 2019 17:06:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566259573; cv=none; d=google.com; s=arc-20160816; b=Zt1kq6Gm0mS36US9RObKsqU2pq2z5n4jGEc8KqLmI+V0hFrMRcq9mmijX+0u2fxn1X KI4UJbaQOiXWOTlW73JSAvdAQSELuGpf0oqF+PsJ2Zz3HlnihI1iukDIv027XFyW/kAf 7e2b8iesueuzG2eBGw1BqL9fXJ3hPn6lHVHPdeeKS7ieRHgbhpLb2xfkAvNzXv/IB6Sb Qz5H+3grr5DTA/VxBFH4h1pRk9b1/Tc0WVJtDC7HASioJjg8gEpH0GRefhPTblO5NAjW Izwobv6VYG7Ng2VvFXNr6AZ0gofMui1DJEsXQM5hjBSSsp9nO7HezJenKjQ/T1qoroWG k7Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=EqawCVMNR5ggkVvM3Y8TbC/GggOP05ogNA2z4zWjBzA=; b=R8wySvMsmAq7EwG+Ra2s8i6YN0IQARP3lR0Tcz8BDpP6gLCZxJgTEv47Ll9ZGjHObd EQASMpPs7PUvqk+cc6UuCun9eVft8hPIOHSQaYsBEWf8OP0TWq39DIVuKz4mOh7VYXNj eHMUdPdfeXAskt5F90boO6IlBAPpnQWuAnmwBOdjQxfAakND28cUkWgpv2zfGpbBzRzb pXMBA1d10bkr+iNdw4lEMn+M68F8lWJli8w9AwaIaQ6Ea8niz4q6mj9arO6yTIgr29Mn V7cJJ9x96Yom1nMJHSv7w0KxeAeLYD8xbCw55YYs/UI1cCJGlDsORUkaKwrPp6BC6NTx 2Lqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="W2ZnE/px"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69si10851714pla.262.2019.08.19.17.05.57; Mon, 19 Aug 2019 17:06:13 -0700 (PDT) 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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b="W2ZnE/px"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728731AbfHTAFE (ORCPT + 99 others); Mon, 19 Aug 2019 20:05:04 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36476 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728578AbfHTAFD (ORCPT ); Mon, 19 Aug 2019 20:05:03 -0400 Received: by mail-qt1-f195.google.com with SMTP id z4so4010523qtc.3 for ; Mon, 19 Aug 2019 17:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=EqawCVMNR5ggkVvM3Y8TbC/GggOP05ogNA2z4zWjBzA=; b=W2ZnE/pxltTX4kXiXH96rp142zmXmi2sD4mi6KTNLHIp3seAnOcVlhN0dqf6iMWn4x RXqhV3hcByajFyP9UJKzVpbTZspbLawweQJWhwe3YVlJ9g6iW/KPDZSemRIltIlOeQd+ D4/1LhNRdtgfjVEKONKun8bNqwtRTvgHPDMkXzVPA0J2HEQXzUN6X9+92PixFL6TLsS7 w4BHqL/BJNcqkSmJdFS9cLDFS3btD9pC/aDz8ko6Nyg3I7POzUYsEM+U4ZGMWiJP0nM4 8po2viFqcGLQLq9Y1lRGyNujerL0eRYMcYunMrGhW5kYC79Y93PRe8Kc2lL8EtKmxnM1 MPAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=EqawCVMNR5ggkVvM3Y8TbC/GggOP05ogNA2z4zWjBzA=; b=RmVU7ufzQb1G2GVldfjwgf/ShyXDM8j4P/BOKVsJOeSQmEQlCz3WSOnMCS/SzL0P8J ICweONvWJbYbETDiyytJjl3m/fVI8u6WTAPSMlbzRce4t3fMttfE9JGfFDQf6Qa7zA8f EGNU+gbjsZC3M4lDbz0+UrVNJe22Sy8cc3yrMSKHF7cexc79SZXfroFPUW5N0Vbiojtv RFYpOeBaGz3a0K/Iei3IfAFWA3cxtZk/VuB9ukPh6L0N7Td39tgxO1dErHEFttQOyAnl 3vdUxrsWnvFRMgCLgFSkXIIWKMzTaHqpw363ubKTZkoHyy4uCddzH4CZQ1snvcsjAh9r LeKw== X-Gm-Message-State: APjAAAWYLoanjGpl84gE9pg2A5uddsJvR0q8dgMUEu4bzIsjGFTva6a9 2d6DIfgobBAGAeRQ3S6Qq7uT/Q== X-Received: by 2002:a0c:b209:: with SMTP id x9mr2784510qvd.217.1566259502266; Mon, 19 Aug 2019 17:05:02 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id o27sm7646908qkm.37.2019.08.19.17.05.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2019 17:05:02 -0700 (PDT) Date: Mon, 19 Aug 2019 17:04:53 -0700 From: Jakub Kicinski To: Thomas Bogendoerfer Cc: Jonathan Corbet , Ralf Baechle , Paul Burton , James Hogan , Dmitry Torokhov , Lee Jones , "David S. Miller" , Srinivas Kandagatla , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Jiri Slaby , Evgeniy Polyakov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-input@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [PATCH v5 11/17] net: sgi: ioc3-eth: no need to stop queue set_multicast_list Message-ID: <20190819170440.37ff18d4@cakuba.netronome.com> In-Reply-To: <20190819163144.3478-12-tbogendoerfer@suse.de> References: <20190819163144.3478-1-tbogendoerfer@suse.de> <20190819163144.3478-12-tbogendoerfer@suse.de> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Aug 2019 18:31:34 +0200, Thomas Bogendoerfer wrote: > netif_stop_queue()/netif_wake_qeue() aren't needed for changing > multicast filters. Use spinlocks instead for proper protection > of private struct. >=20 > Signed-off-by: Thomas Bogendoerfer > --- > drivers/net/ethernet/sgi/ioc3-eth.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/s= gi/ioc3-eth.c > index d862f28887f9..7f85a3bfef14 100644 > --- a/drivers/net/ethernet/sgi/ioc3-eth.c > +++ b/drivers/net/ethernet/sgi/ioc3-eth.c > @@ -1542,8 +1542,7 @@ static void ioc3_set_multicast_list(struct net_devi= ce *dev) > struct netdev_hw_addr *ha; > u64 ehar =3D 0; > =20 > - netif_stop_queue(dev); /* Lock out others. */ > - > + spin_lock_irq(&ip->ioc3_lock); What does this lock protect? =F0=9F=A4=94 No question that stopping TX queu= es makes little sense, but this function is only called from ndo_set_rx_mode(), so with rtnl_lock held.=20 I thought it may protect ip->emcr, but that one is accessed with no locking from the ioc3_timer() -> ioc3_setup_duplex() path.. > if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ > ip->emcr |=3D EMCR_PROMISC; > writel(ip->emcr, ®s->emcr); > @@ -1572,7 +1571,7 @@ static void ioc3_set_multicast_list(struct net_devi= ce *dev) > writel(ip->ehar_l, ®s->ehar_l); > } > =20 > - netif_wake_queue(dev); /* Let us get going again. */ > + spin_unlock_irq(&ip->ioc3_lock); > } > =20 > module_pci_driver(ioc3_driver);