ethdev: rename functions checking queue validity
Checks
Commit Message
Two functions helping to check Rx/Tx queues validity
were added in DPDK 23.07-rc1.
As the release is not closed, it is still time to rename.
The name proposed originally
rte_eth_dev_is_valid_*xq
is consistent with this function:
rte_eth_dev_is_valid_port()
However, the suffixes "rxq" and "txq" are uncommon in ethdev functions.
Also for shortness, many functions are dropping "_dev_"
as these functions which manage the queues:
rte_eth_*x_queue_info_get()
rte_eth_*x_queue_setup()
rte_eth_*x_hairpin_queue_setup
For completeness, there are some old functions having "_dev_":
rte_eth_dev_*x_queue_start()
rte_eth_dev_*x_queue_stop()
Anyway in all above examples, the subject is after the prefix,
and the verb is at the end.
That's why I propose renaming into:
rte_eth_*x_queue_is_valid()
Fixes: 7ea7e0cd3a08 ("ethdev: add functions to check queue validity")
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
app/test-pmd/cmdline.c | 6 +++---
lib/ethdev/rte_ethdev.c | 4 ++--
lib/ethdev/rte_ethdev.h | 4 ++--
lib/ethdev/version.map | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
Comments
On 6/14/2023 4:20 PM, Thomas Monjalon wrote:
> Two functions helping to check Rx/Tx queues validity
> were added in DPDK 23.07-rc1.
> As the release is not closed, it is still time to rename.
>
> The name proposed originally
> rte_eth_dev_is_valid_*xq
> is consistent with this function:
> rte_eth_dev_is_valid_port()
> However, the suffixes "rxq" and "txq" are uncommon in ethdev functions.
>
> Also for shortness, many functions are dropping "_dev_"
> as these functions which manage the queues:
> rte_eth_*x_queue_info_get()
> rte_eth_*x_queue_setup()
> rte_eth_*x_hairpin_queue_setup
> For completeness, there are some old functions having "_dev_":
> rte_eth_dev_*x_queue_start()
> rte_eth_dev_*x_queue_stop()
> Anyway in all above examples, the subject is after the prefix,
> and the verb is at the end.
>
> That's why I propose renaming into:
> rte_eth_*x_queue_is_valid()
>
> Fixes: 7ea7e0cd3a08 ("ethdev: add functions to check queue validity")
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>>
Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
On Wed, 14 Jun 2023 17:20:59 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:
> Two functions helping to check Rx/Tx queues validity
> were added in DPDK 23.07-rc1.
> As the release is not closed, it is still time to rename.
>
> The name proposed originally
> rte_eth_dev_is_valid_*xq
> is consistent with this function:
> rte_eth_dev_is_valid_port()
> However, the suffixes "rxq" and "txq" are uncommon in ethdev functions.
>
> Also for shortness, many functions are dropping "_dev_"
> as these functions which manage the queues:
> rte_eth_*x_queue_info_get()
> rte_eth_*x_queue_setup()
> rte_eth_*x_hairpin_queue_setup
> For completeness, there are some old functions having "_dev_":
> rte_eth_dev_*x_queue_start()
> rte_eth_dev_*x_queue_stop()
> Anyway in all above examples, the subject is after the prefix,
> and the verb is at the end.
>
> That's why I propose renaming into:
> rte_eth_*x_queue_is_valid()
>
> Fixes: 7ea7e0cd3a08 ("ethdev: add functions to check queue validity")
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Shorter is better.
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
On 6/14/23 19:44, Stephen Hemminger wrote:
> On Wed, 14 Jun 2023 17:20:59 +0200
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
>> Two functions helping to check Rx/Tx queues validity
>> were added in DPDK 23.07-rc1.
>> As the release is not closed, it is still time to rename.
>>
>> The name proposed originally
>> rte_eth_dev_is_valid_*xq
>> is consistent with this function:
>> rte_eth_dev_is_valid_port()
>> However, the suffixes "rxq" and "txq" are uncommon in ethdev functions.
>>
>> Also for shortness, many functions are dropping "_dev_"
>> as these functions which manage the queues:
>> rte_eth_*x_queue_info_get()
>> rte_eth_*x_queue_setup()
>> rte_eth_*x_hairpin_queue_setup
>> For completeness, there are some old functions having "_dev_":
>> rte_eth_dev_*x_queue_start()
>> rte_eth_dev_*x_queue_stop()
>> Anyway in all above examples, the subject is after the prefix,
>> and the verb is at the end.
>>
>> That's why I propose renaming into:
>> rte_eth_*x_queue_is_valid()
>>
>> Fixes: 7ea7e0cd3a08 ("ethdev: add functions to check queue validity")
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>
> Shorter is better.
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
On 6/19/2023 10:41 AM, Andrew Rybchenko wrote:
> On 6/14/23 19:44, Stephen Hemminger wrote:
>> On Wed, 14 Jun 2023 17:20:59 +0200
>> Thomas Monjalon <thomas@monjalon.net> wrote:
>>
>>> Two functions helping to check Rx/Tx queues validity
>>> were added in DPDK 23.07-rc1.
>>> As the release is not closed, it is still time to rename.
>>>
>>> The name proposed originally
>>> rte_eth_dev_is_valid_*xq
>>> is consistent with this function:
>>> rte_eth_dev_is_valid_port()
>>> However, the suffixes "rxq" and "txq" are uncommon in ethdev functions.
>>>
>>> Also for shortness, many functions are dropping "_dev_"
>>> as these functions which manage the queues:
>>> rte_eth_*x_queue_info_get()
>>> rte_eth_*x_queue_setup()
>>> rte_eth_*x_hairpin_queue_setup
>>> For completeness, there are some old functions having "_dev_":
>>> rte_eth_dev_*x_queue_start()
>>> rte_eth_dev_*x_queue_stop()
>>> Anyway in all above examples, the subject is after the prefix,
>>> and the verb is at the end.
>>>
>>> That's why I propose renaming into:
>>> rte_eth_*x_queue_is_valid()
>>>
>>> Fixes: 7ea7e0cd3a08 ("ethdev: add functions to check queue validity")
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>
>> Shorter is better.
>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
>
Applied to dpdk-next-net/main, thanks.
@@ -12283,7 +12283,7 @@ cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
int rc;
if (!strcmp(res->cmd_keyword, "rxq")) {
- if (rte_eth_dev_is_valid_rxq(res->cmd_pid, res->cmd_qid) != 0) {
+ if (rte_eth_rx_queue_is_valid(res->cmd_pid, res->cmd_qid) != 0) {
fprintf(stderr,
"Invalid input: port id = %d, queue id = %d\n",
res->cmd_pid, res->cmd_qid);
@@ -12304,7 +12304,7 @@ cmd_show_rx_tx_desc_status_parsed(void *parsed_result,
else
printf("Desc status = UNAVAILABLE\n");
} else if (!strcmp(res->cmd_keyword, "txq")) {
- if (rte_eth_dev_is_valid_txq(res->cmd_pid, res->cmd_qid) != 0) {
+ if (rte_eth_tx_queue_is_valid(res->cmd_pid, res->cmd_qid) != 0) {
fprintf(stderr,
"Invalid input: port id = %d, queue id = %d\n",
res->cmd_pid, res->cmd_qid);
@@ -12389,7 +12389,7 @@ cmd_show_rx_queue_desc_used_count_parsed(void *parsed_result,
struct cmd_show_rx_queue_desc_used_count_result *res = parsed_result;
int rc;
- if (rte_eth_dev_is_valid_rxq(res->cmd_pid, res->cmd_qid) != 0) {
+ if (rte_eth_rx_queue_is_valid(res->cmd_pid, res->cmd_qid) != 0) {
fprintf(stderr,
"Invalid input: port id = %d, queue id = %d\n",
res->cmd_pid, res->cmd_qid);
@@ -771,7 +771,7 @@ eth_dev_validate_tx_queue(const struct rte_eth_dev *dev, uint16_t tx_queue_id)
}
int
-rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id)
+rte_eth_rx_queue_is_valid(uint16_t port_id, uint16_t queue_id)
{
struct rte_eth_dev *dev;
@@ -782,7 +782,7 @@ rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id)
}
int
-rte_eth_dev_is_valid_txq(uint16_t port_id, uint16_t queue_id)
+rte_eth_tx_queue_is_valid(uint16_t port_id, uint16_t queue_id)
{
struct rte_eth_dev *dev;
@@ -2683,7 +2683,7 @@ int rte_eth_dev_is_valid_port(uint16_t port_id);
* - 0 if Rx queue is valid.
*/
__rte_experimental
-int rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id);
+int rte_eth_rx_queue_is_valid(uint16_t port_id, uint16_t queue_id);
/**
* @warning
@@ -2702,7 +2702,7 @@ int rte_eth_dev_is_valid_rxq(uint16_t port_id, uint16_t queue_id);
* - 0 if Tx queue is valid.
*/
__rte_experimental
-int rte_eth_dev_is_valid_txq(uint16_t port_id, uint16_t queue_id);
+int rte_eth_tx_queue_is_valid(uint16_t port_id, uint16_t queue_id);
/**
* Start specified Rx queue of a port. It is used when rx_deferred_start
@@ -301,8 +301,8 @@ EXPERIMENTAL {
rte_flow_async_create_by_index;
# added in 23.07
- rte_eth_dev_is_valid_rxq;
- rte_eth_dev_is_valid_txq;
+ rte_eth_rx_queue_is_valid;
+ rte_eth_tx_queue_is_valid;
rte_flow_action_list_handle_create;
rte_flow_action_list_handle_destroy;
rte_flow_action_list_handle_query_update;