Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9079983pxu; Mon, 28 Dec 2020 06:09:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXZJvY1j0mq/L1v6VfhrnfMYdZCP2xIKgCwd1buTkKum6k9OpWAeGzSiLoo2Rm5qbR0vpt X-Received: by 2002:a05:6402:310f:: with SMTP id dc15mr42257105edb.225.1609164586322; Mon, 28 Dec 2020 06:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164586; cv=none; d=google.com; s=arc-20160816; b=oYtJlB7SqgyWrG7AjhO40ubN+s8CGLLRECDsj/6N2WmJeUVH7kBoyXhlxdgyl6loIG HwaH9tUjN9c8h9qDOgEuYzd5tAiV1H/Fq3EkL6F+PN7ZaKl4CGYqtg93Uv5McbBfANsR /Qo0GrJO9ErTJwJKo0tlfs3gbt9V6/w4jMXwZpNzPkgQ0PT/ZIilIGwklh64T0Vkmpnl yUcLrc636cl6RSZsGlH13R6fOQgju9krluSOnykhsonGAloNLCXg1f0SpH4bhmc6YGzM 5zceE6E/wMgPHOE7mSVplR3VjtlMzCOfG0mfxGkDjx0V+f53neKzYmljOr/M6I8y1NAF Hr9Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O0ZRyIyllhVjZcs797dgwGZQYl8xdL6/aNZO5ro4ESE=; b=L5iz5r8aIXhuA4PpexB4Rhiz8srukEbwHKrqVAY2GY4Q1RuPEb3SNgb/VPf2y0CdOT q8PBdV5cAGzJaCVkVUbeqhhF3+8/+8AFLQlpPTVE3GX9b4zmC78TVZO8Yb0YIXW/IfT4 yQcHiCV6lNQ40pLJNNxGgyDreGyh+yd0CIGRWU3YxwzoebDtPYITFT5tevYekhgErSdY mcwZyPQFARQ8E71WDVf/z0l576tHCIJt8mjQYA4wmMzWegkPy6Bl/UIAO5d0UYJPqDGC pxyvTaSZyMNEZPvISPMjujOdRYIQS9T1MabS+uf8+xY9hGewCffzQV9rQBnID/IFQT5b ZikQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RzRa3RGs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb19si17344146ejc.496.2020.12.28.06.09.23; Mon, 28 Dec 2020 06:09:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RzRa3RGs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391683AbgL1OHX (ORCPT + 99 others); Mon, 28 Dec 2020 09:07:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:41002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438076AbgL1OG2 (ORCPT ); Mon, 28 Dec 2020 09:06:28 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2ED62207AB; Mon, 28 Dec 2020 14:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164347; bh=0HljBkdmGUiGlvx6pH+LJX5mNOiVb1MxeSjR+OzNY2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RzRa3RGs7P8RTzj5QefS9IdN3JWtHLnaQODMhRAfQO7S+yIEI+AG4ieVlt0KT1/NQ cCJlbV+gBpkXWyveqhdygWQknIEErGEqvctq4Z/44Ad7itznaQtT3iLLONn5lHXCL+ M2k6khDNBQLt3qwmh3+/WoVijfYNlEyFRXBgTJ6A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shannon Nelson , Saeed Mahameed , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 117/717] ionic: change set_rx_mode from_ndo to can_sleep Date: Mon, 28 Dec 2020 13:41:55 +0100 Message-Id: <20201228125026.567160474@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shannon Nelson [ Upstream commit 81dbc24147f9250c186ae5875b3ed3136e9e293b ] Instead of having two different ways of expressing the same sleepability concept, using opposite logic, we can rework the from_ndo to can_sleep for a more consistent usage. Fixes: 1800eee16676 ("net: ionic: Replace in_interrupt() usage.") Signed-off-by: Shannon Nelson Reviewed-by: Saeed Mahameed Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../net/ethernet/pensando/ionic/ionic_lif.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_lif.c b/drivers/net/ethernet/pensando/ionic/ionic_lif.c index 7ad9f0cc1af66..c968c5c5a60a0 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_lif.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_lif.c @@ -1129,7 +1129,7 @@ static void ionic_lif_rx_mode(struct ionic_lif *lif, unsigned int rx_mode) lif->rx_mode = rx_mode; } -static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) +static void ionic_set_rx_mode(struct net_device *netdev, bool can_sleep) { struct ionic_lif *lif = netdev_priv(netdev); struct ionic_deferred_work *work; @@ -1149,10 +1149,10 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) * we remove our overflow flag and check the netdev flags * to see if we can disable NIC PROMISC */ - if (from_ndo) - __dev_uc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del); - else + if (can_sleep) __dev_uc_sync(netdev, ionic_addr_add, ionic_addr_del); + else + __dev_uc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del); nfilters = le32_to_cpu(lif->identity->eth.max_ucast_filters); if (netdev_uc_count(netdev) + 1 > nfilters) { rx_mode |= IONIC_RX_MODE_F_PROMISC; @@ -1164,10 +1164,10 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) } /* same for multicast */ - if (from_ndo) - __dev_mc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del); - else + if (can_sleep) __dev_mc_sync(netdev, ionic_addr_add, ionic_addr_del); + else + __dev_mc_sync(netdev, ionic_ndo_addr_add, ionic_ndo_addr_del); nfilters = le32_to_cpu(lif->identity->eth.max_mcast_filters); if (netdev_mc_count(netdev) > nfilters) { rx_mode |= IONIC_RX_MODE_F_ALLMULTI; @@ -1179,7 +1179,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) } if (lif->rx_mode != rx_mode) { - if (from_ndo) { + if (!can_sleep) { work = kzalloc(sizeof(*work), GFP_ATOMIC); if (!work) { netdev_err(lif->netdev, "%s OOM\n", __func__); @@ -1197,7 +1197,7 @@ static void ionic_set_rx_mode(struct net_device *netdev, bool from_ndo) static void ionic_ndo_set_rx_mode(struct net_device *netdev) { - ionic_set_rx_mode(netdev, true); + ionic_set_rx_mode(netdev, false); } static __le64 ionic_netdev_features_to_nic(netdev_features_t features) @@ -1764,7 +1764,7 @@ static int ionic_txrx_init(struct ionic_lif *lif) if (lif->netdev->features & NETIF_F_RXHASH) ionic_lif_rss_init(lif); - ionic_set_rx_mode(lif->netdev, false); + ionic_set_rx_mode(lif->netdev, true); return 0; -- 2.27.0