From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B148A0032; Fri, 21 Oct 2022 08:46:10 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A8B642836; Fri, 21 Oct 2022 08:46:10 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 920E54282D; Fri, 21 Oct 2022 08:46: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=1666334769; x=1697870769; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EMiAzh6inhKLaoopW4DZIFfIBcOgqKwymwU1VpAU0wQ=; b=RisDoxwXLHCZzTgO+Bv9EAVkowomfFBu6FGkPioWdymLLOtjMGPr/qtU GEldIZY4DAtdDVuW8v8GPotT1im4wFpCnzIyW/Z6VcmPYjMcgYBGLF0x8 0tZh5W1C36lFLFwMNjlDMcHsNi22ZJqhBZZzUwUugdI46T0AaBPzTyd4e X6mxNV2rNTYHBdt9xr07cjWaRk7NFWUcmDVOwz/P5IgHSlMzLIZrzcn8n x8zqD+QaDCa/YdUfVYdGEV0i1zdegdvZtUYJSp1EZIAwLbZ7XnDTpfQhx XF6uQqg+hlIj0TA3rwy7N/XkWXSPbLO3SnAY5s7vxw40SEc69VXQdr+Gl Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="308027249" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208";a="308027249" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 23:43:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10506"; a="661427755" X-IronPort-AV: E=Sophos;i="5.95,200,1661842800"; d="scan'208";a="661427755" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by orsmga008.jf.intel.com with ESMTP; 20 Oct 2022 23:43:17 -0700 From: Naga Harish K S V To: jay.jayatheerthan@intel.com, jerinj@marvell.com Cc: dev@dpdk.org, stable@dpdk.org Subject: [PATCH v2] eventdev/eth_tx: fix queue delete logic Date: Fri, 21 Oct 2022 01:43:14 -0500 Message-Id: <20221021064314.1937897-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20221020162849.1645281-1-s.v.naga.harish.k@intel.com> References: <20221020162849.1645281-1-s.v.naga.harish.k@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 To delete all the queues of a ethernet device associated with adapter instance the queue_id can be passed as -1 to the queue delete API. When a subset of queues of a ethernet device are associated, the queue delete logic is exiting without deleting the queues in some cases (higher numbered associated queues) for above scenario as the queue delete logic is not checking all the queue association status. This patch fixes this issue by checking the queue association status of all the queues of the ethernet device. Fixes: 741b499e642 ("eventdev/eth_tx: fix queue delete logic") Cc: stable@dpdk.org Signed-off-by: Naga Harish K S V --- v2: * fix segfault during unit test and modify logic --- --- lib/eventdev/rte_event_eth_tx_adapter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index c2a848103b..88309d2aaa 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -934,6 +934,8 @@ txa_service_queue_del(uint8_t id, uint16_t i, q, nb_queues; int ret = 0; + if (txa->txa_ethdev == NULL) + return 0; nb_queues = txa->txa_ethdev[port_id].nb_queues; if (nb_queues == 0) return 0; @@ -946,10 +948,10 @@ txa_service_queue_del(uint8_t id, if (tqi[q].added) { ret = txa_service_queue_del(id, dev, q); + i++; if (ret != 0) break; } - i++; q++; } return ret; -- 2.25.1