From: Naga Harish K S V <s.v.naga.harish.k@intel.com>
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 [thread overview]
Message-ID: <20230502053613.1131362-1-s.v.naga.harish.k@intel.com> (raw)
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 <s.v.naga.harish.k@intel.com>
---
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
next reply other threads:[~2023-05-02 5:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 5:36 Naga Harish K S V [this message]
2023-05-02 5:57 ` [PATCH v2] eventdev/eth_tx: fix runtime parameter test Naga Harish K S V
2023-05-17 5:19 ` Jerin Jacob
2023-05-17 5:39 ` Naga Harish K, S V
2023-05-17 8:15 ` Jerin Jacob
2023-05-17 10:37 ` Naga Harish K, S V
2023-05-17 10:35 ` [PATCH v3] " Naga Harish K S V
2023-05-17 15:10 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230502053613.1131362-1-s.v.naga.harish.k@intel.com \
--to=s.v.naga.harish.k@intel.com \
--cc=dev@dpdk.org \
--cc=jay.jayatheerthan@intel.com \
--cc=jerinj@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).