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 4299E42A39; Tue, 2 May 2023 07:36:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 177BB410FB; Tue, 2 May 2023 07:36:21 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id ECCE640E2D for ; Tue, 2 May 2023 07:36:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683005779; x=1714541779; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=W4zX4jfdX7JMa/VirShufoaS+ICtjTVm9ILUPqiCkCk=; b=eBlrEl1RQ9DIFXr2Q678mPBwHjALhEoMJ+cW5Z3bp3Vg7xMIiX481Sri ZmBKx7cBIsuC8GMU4UJ9qE63vsSf8zsQWQbOa7gOrQqat9LPvCrJX1lCL lCj91LGwmODNKpsRP7nhP+d8bIpf3i8Vr6OqjQLiIzT/pBzD1zoFb8g85 b9FQjkdWGZuTiZhcF8nUWWtLSz/FJc6ZPscJtP9xu5Mm5KrmMKxP6wjdE qS9IKW7kyRT0krieo2TW1y/FnRCd1nmEfNMG9j89qwXa5o2rQjXaJhz3u CT4tUunqdsodBOLTBtThP/HUPQk29WzvXU15V3Xn0r5gJQafqhrbT4aZG Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="351292584" X-IronPort-AV: E=Sophos;i="5.99,243,1677571200"; d="scan'208";a="351292584" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 May 2023 22:36:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10697"; a="765624779" X-IronPort-AV: E=Sophos;i="5.99,243,1677571200"; d="scan'208";a="765624779" Received: from txandevlnx322.an.intel.com ([10.123.117.44]) by fmsmga004.fm.intel.com with ESMTP; 01 May 2023 22:36:17 -0700 From: Naga Harish K S V To: jerinj@marvell.com Cc: dev@dpdk.org, jay.jayatheerthan@intel.com Subject: [PATCH] eventdev/eth_tx: fix runtime parameter set API Date: Tue, 2 May 2023 00:36:13 -0500 Message-Id: <20230502053613.1131362-1-s.v.naga.harish.k@intel.com> X-Mailer: git-send-email 2.23.0 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 TX adapter capability check logic is simplified. Fixes: 1d176c7add08581 ("eventdev/eth_tx: support runtime set/get parameters") Signed-off-by: Naga Harish K S V --- lib/eventdev/rte_event_eth_tx_adapter.c | 33 +++++-------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c index 131e11e01d..360d5caf6a 100644 --- a/lib/eventdev/rte_event_eth_tx_adapter.c +++ b/lib/eventdev/rte_event_eth_tx_adapter.c @@ -1310,36 +1310,15 @@ rte_event_eth_tx_adapter_runtime_params_init( } static int -txa_caps_check(uint8_t id, struct txa_service_data *txa) +txa_caps_check(struct txa_service_data *txa) { - uint32_t caps = 0; - struct rte_eth_dev *eth_dev = NULL; - struct txa_service_ethdev *tdi; - int i; - if (!txa->dev_count) return -EINVAL; - /* The eth_dev used is always the same type. - * Hence first valid eth_dev is taken. - */ - for (i = 0; i < txa->dev_count; i++) { - tdi = &txa->txa_ethdev[i]; - if (tdi->nb_queues) { - eth_dev = tdi->dev; - break; - } - } - if (eth_dev == NULL) - return -EINVAL; - - if (txa_dev_caps_get(id)) - txa_dev_caps_get(id)(txa_evdev(id), eth_dev, &caps); - - if (caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT) - return -ENOTSUP; + if (txa->service_id != TXA_INVALID_SERVICE_ID) + return 0; - return 0; + return -ENOTSUP; } int @@ -1361,7 +1340,7 @@ rte_event_eth_tx_adapter_runtime_params_set(uint8_t id, if (txa == NULL) return -EINVAL; - ret = txa_caps_check(id, txa); + ret = txa_caps_check(txa); if (ret) return ret; @@ -1392,7 +1371,7 @@ rte_event_eth_tx_adapter_runtime_params_get(uint8_t id, if (txa == NULL) return -EINVAL; - ret = txa_caps_check(id, txa); + ret = txa_caps_check(txa); if (ret) return ret; -- 2.23.0