From patchwork Tue Oct 27 13:48:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ACE4C838B3 for ; Tue, 27 Oct 2020 15:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E5C8524196 for ; Tue, 27 Oct 2020 15:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813667; bh=2CERZp7JXvwfrqf51KqbnJQEQDA7tw+oLMlKSUyRrOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=t1SbN9DS1lassQ8d/tr/GvTwRBfzMdDGcEHDBFsZN4kcPy3REx/PsamaRqCjOmO69 hKdi+F//IiX4NH19VK9duAJPqLsfNF1pWOTyeUfm0qmLEpn2MyBrxf0OXZvLCF1FpU kbxt//ald4jQj8IPZw8Fo8cVeFy/x2v/14VLX2UA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1802124AbgJ0Ppm (ORCPT ); Tue, 27 Oct 2020 11:45:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:46336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1798719AbgJ0P3v (ORCPT ); Tue, 27 Oct 2020 11:29:51 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C2CFF22202; Tue, 27 Oct 2020 15:29:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812590; bh=2CERZp7JXvwfrqf51KqbnJQEQDA7tw+oLMlKSUyRrOE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KzRMqvLpxX7xzypKSOU95eBPN6wQOlmJwZpMWNLomT/jik1XtcW2u/MZLr/Q9wQhx QxC2qdQMcbZ3fD+hgh9ZRcfJs1xiYMpaDc/BwElVTqryR6lh51oPPth7UnbCxc0xx6 FAx3YjxZ9FW+AJImRuj62cBp3jb8DKkOdbXTSQiU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aashish Verma , Ong Boon Leong , "David S. Miller" , Sasha Levin Subject: [PATCH 5.9 262/757] net: stmmac: Fix incorrect location to set real_num_rx|tx_queues Date: Tue, 27 Oct 2020 14:48:32 +0100 Message-Id: <20201027135502.869371870@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Aashish Verma [ Upstream commit 686cff3d7022ddf35d7e38bc80191eb92de5989a ] netif_set_real_num_tx_queues() & netif_set_real_num_rx_queues() should be used to inform network stack about the real Tx & Rx queue (active) number in both stmmac_open() and stmmac_resume(), therefore, we move the code from stmmac_dvr_probe() to stmmac_hw_setup(). Fixes: c02b7a914551 net: stmmac: use netif_set_real_num_{rx,tx}_queues Signed-off-by: Aashish Verma Signed-off-by: Ong Boon Leong Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b56b13d64ab48..1af25da4461da 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2740,6 +2740,10 @@ static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) stmmac_enable_tbs(priv, priv->ioaddr, enable, chan); } + /* Configure real RX and TX queues */ + netif_set_real_num_rx_queues(dev, priv->plat->rx_queues_to_use); + netif_set_real_num_tx_queues(dev, priv->plat->tx_queues_to_use); + /* Start the ball rolling... */ stmmac_start_all_dma(priv); @@ -4827,10 +4831,6 @@ int stmmac_dvr_probe(struct device *device, stmmac_check_ether_addr(priv); - /* Configure real RX and TX queues */ - netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); - netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use); - ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |