From patchwork Thu Nov 10 06:45:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noor Azura Ahmad Tarmizi X-Patchwork-Id: 17989 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp766187wru; Wed, 9 Nov 2022 22:59:53 -0800 (PST) X-Google-Smtp-Source: AMsMyM4tdPy5aomallYnKCkIN3FEhn3Y3rzIBf/R/yA7sCoDUJOOlB4XR1CzoLdf5cglKjnxx87c X-Received: by 2002:a05:6a00:1c92:b0:56d:643e:e116 with SMTP id y18-20020a056a001c9200b0056d643ee116mr54639135pfw.15.1668063592849; Wed, 09 Nov 2022 22:59:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668063592; cv=none; d=google.com; s=arc-20160816; b=hUrx09h+sQJaGAKTJEG2L3jmKqCGQxtTbXyZIxoi/3Ojzrruh0JY233kiZyju9sNvD kZhi2+erPsKZLE/vUkyHd90SmXIkG3Pj8WT8rg+yW/PIDc3q3k+KPhyyqlWylQEPnJsQ QAsyXTqkhXS6rMBGfaz9XiMtydw0xxUGp7VnDvHvxNNNeX6wDri/stRoXRpRlDD8nLhH nPMvOTgeLDGtRlfhiT2ZlLavjjFBiV/jtXSM9tCHP9GVuorin3GamuN+5N5PAsheVfuQ KyriJqftEhUEUdXSUl+4RuRonIRYXgyt3dDyRP9FHEMNql7dn2IjurEdJJ3Y29oIZpwe Syuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=h6XMcyILoglY8SvqA/Ed12Hu/C+A2l0d8LSvk+uxIBU=; b=0PsRIpIZ4cKTmgqlxy2zA/kavzsPrgwNyHrDtCfseEFUfkkQD7EF5fszZDHAbuGE9T ihXGf2ZV1rx93f5c0nKcy6Ew8fQ9RybpvowKtvRwGNn4aGqcqbONr9vA15PQTgCaIVN0 eZFgrbNQRzZoTIFxDsqqRMmagZEoAF7EvbJiuaep6yZPuEPMW9BFA/DZjEWsSdtyQ/De 8zU2aNOJfknF4g5n0JcLQi4M5qc1rw2QC9Q1N6LrTAx6VLL8zCbc5F3g6yG/NhoaLtqY b3ceW54G6iam1YChCYMX9tXQpTPXvisXR+T34dD7ZIMjJRX1kRFrm+W35fBkxTJY8G2k pkkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cm0+HXoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a17090a9d8600b00213f1db312esi3553291pjp.111.2022.11.09.22.59.37; Wed, 09 Nov 2022 22:59:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Cm0+HXoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbiKJG4m (ORCPT + 99 others); Thu, 10 Nov 2022 01:56:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230254AbiKJG4l (ORCPT ); Thu, 10 Nov 2022 01:56:41 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82C681570B; Wed, 9 Nov 2022 22:56:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668063400; x=1699599400; h=from:to:cc:subject:date:message-id; bh=Mwsy1axZV+PTNKiw6w+BLcbXyV1HVAU1m3qtT1Ss6a8=; b=Cm0+HXoqkqYmKZ1uEeSxEj4e/0WNl1V4+NOmhADuQDn0ylRfLeB8W+6v oLt0WMAL6XD6yZs/+H5NYz+U778Q6BKsuI55JT9rNRmNuapPOTz+uF1r3 kucBfQPqur6xtjwBqhBxottYYn/SwM/wgBc9nUUHRFq8/Zrsv3jgt4reR jZOWdYg7MFf5JViwLzYBIMtCeCO8SARrVbBIg4f0tswr+daEmYFXn7kj+ tEQN+REkhOVtexaWstbzg13F318uvmBBssU+PupCRxET/sEYLB+Xq4/Aq NHYLIHy8uMj2OrJsJD8Za49jqpdL1VGPtyUVAOjynVBlorPHbWjFalSWj w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="290950751" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="290950751" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 22:56:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="588061142" X-IronPort-AV: E=Sophos;i="5.96,153,1665471600"; d="scan'208";a="588061142" Received: from linux.intel.com ([10.54.29.200]) by orsmga003.jf.intel.com with ESMTP; 09 Nov 2022 22:56:39 -0800 Received: from noorazur1-iLBPG12.png.intel.com (noorazur1-iLBPG12.png.intel.com [10.88.229.87]) by linux.intel.com (Postfix) with ESMTP id 6417A580C99; Wed, 9 Nov 2022 22:56:35 -0800 (PST) From: Noor Azura Ahmad Tarmizi To: "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Ong Boon Leong Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Song Yoong Siang , Mohd Faizal Abdul Rahim Subject: [PATCH net 1/1] net: stmmac: ensure tx function is not running in stmmac_xdp_release() Date: Thu, 10 Nov 2022 14:45:52 +0800 Message-Id: <20221110064552.22504-1-noor.azura.ahmad.tarmizi@linux.intel.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-4.3 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749091449709140813?= X-GMAIL-MSGID: =?utf-8?q?1749091449709140813?= From: Mohd Faizal Abdul Rahim When stmmac_xdp_release() is called, there is a possibility that tx function is still running on other queues which will lead to tx queue timed out and reset adapter. This commit ensure that tx function is not running xdp before release flow continue to run. Fixes: ac746c8520d9 ("net: stmmac: enhance XDP ZC driver level switching performance") Signed-off-by: Song Yoong Siang Signed-off-by: Mohd Faizal Abdul Rahim Signed-off-by: Noor Azura Ahmad Tarmizi --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 8273e6a175c8..6b43da78cdf0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6548,6 +6548,9 @@ void stmmac_xdp_release(struct net_device *dev) struct stmmac_priv *priv = netdev_priv(dev); u32 chan; + /* Ensure tx function is not running */ + netif_tx_disable(dev); + /* Disable NAPI process */ stmmac_disable_all_queues(priv);