From patchwork Wed Jul 12 05:35:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhichao Zeng X-Patchwork-Id: 129485 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1BFA442E4E; Wed, 12 Jul 2023 07:29:11 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E28E340A7D; Wed, 12 Jul 2023 07:29:10 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id B6B10406BA; Wed, 12 Jul 2023 07:29:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689139749; x=1720675749; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3jylZgj7wNtdKYTzyN1QNRFiX634WOIAYhr5Zvbbnns=; b=PXj0tZHr5Xh/raJ6sebpRUDEwX/335PY7KC9VrKr/eJ/7t0vX4qpPrHe iIt557KCwWfvql0EFQdgo4YC4XtnQuPgC2lndLlX2nK3HEsq87kyhq/BQ hv4mobUQyhkNhVYHfkV6Oon/legNhVswRlVL6g+XG+UCh358NySnodZqX 88LQIoLZTEtyUX2cy8wjed7ajcpvyaT4FKzFoSSTOh2R/4GRoMi8QZw4J RWjzBXHehjHNPE3caWoyJVKJ5uuX6XmymiYep73bHPcINlvMVtrCEZqw4 maIE2mISrOZsZeNvCb8nJ0AnXJfVYYIhJRovuIhvWNtp9/nIGGE2GULnb w==; X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="345118345" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="345118345" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 22:29:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10768"; a="721362131" X-IronPort-AV: E=Sophos;i="6.01,198,1684825200"; d="scan'208";a="721362131" Received: from unknown (HELO zhichao-dpdk..) ([10.239.252.103]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jul 2023 22:29:04 -0700 From: Zhichao Zeng To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, bartoszx.staszewski@intel.com, Zhichao Zeng , Jingjing Wu , Beilei Xing , Ferruh Yigit , Leyi Rong Subject: [PATCH] net/iavf: fix the order of closing Rx queue Date: Wed, 12 Jul 2023 13:35:37 +0800 Message-Id: <20230712053537.88491-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The current implementation stops queue before disabling the Rx interrupt, and when there are still unprocessed packets remaining in the queue, this may cause the Rx ring to timeout, leading to IOMMU fault. This patch disables the Rx interrupt before stopping the queue, ensuring that no packets received when disabling the queues. Fixes: 02d212ca3125 ("net/iavf: rename remaining avf strings") Cc: stable@dpdk.org Signed-off-by: Bartosz Staszewski Signed-off-by: Zhichao Zeng Acked-by: Qi Zhang --- drivers/net/iavf/iavf_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index ac7154d720..f2fc5a5621 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -1087,8 +1087,6 @@ iavf_dev_stop(struct rte_eth_dev *dev) if (adapter->stopped == 1) return 0; - iavf_stop_queues(dev); - /* Disable the interrupt for Rx */ rte_intr_efd_disable(intr_handle); /* Rx interrupt vector mapping free */ @@ -1101,6 +1099,8 @@ iavf_dev_stop(struct rte_eth_dev *dev) iavf_add_del_mc_addr_list(adapter, vf->mc_addrs, vf->mc_addrs_num, false); + iavf_stop_queues(dev); + adapter->stopped = 1; dev->data->dev_started = 0;