DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eventdev/eth_tx: fix queue delete logic
@ 2022-10-20 16:28 Naga Harish K S V
  2022-10-21  6:43 ` [PATCH v2] " Naga Harish K S V
  0 siblings, 1 reply; 3+ messages in thread
From: Naga Harish K S V @ 2022-10-20 16:28 UTC (permalink / raw)
  To: jay.jayatheerthan, jerinj; +Cc: dev, stable

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 <s.v.naga.harish.k@intel.com>
---
 lib/eventdev/rte_event_eth_tx_adapter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eventdev/rte_event_eth_tx_adapter.c b/lib/eventdev/rte_event_eth_tx_adapter.c
index c2a848103b..f60b7a82ef 100644
--- a/lib/eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/eventdev/rte_event_eth_tx_adapter.c
@@ -934,7 +934,7 @@ txa_service_queue_del(uint8_t id,
 		uint16_t i, q, nb_queues;
 		int ret = 0;
 
-		nb_queues = txa->txa_ethdev[port_id].nb_queues;
+		nb_queues = txa->txa_ethdev[port_id].dev->data->nb_tx_queues;
 		if (nb_queues == 0)
 			return 0;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] eventdev/eth_tx: fix queue delete logic
  2022-10-20 16:28 [PATCH] eventdev/eth_tx: fix queue delete logic Naga Harish K S V
@ 2022-10-21  6:43 ` Naga Harish K S V
  2022-10-21  9:32   ` Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Naga Harish K S V @ 2022-10-21  6:43 UTC (permalink / raw)
  To: jay.jayatheerthan, jerinj; +Cc: dev, stable

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 <s.v.naga.harish.k@intel.com>
---
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] eventdev/eth_tx: fix queue delete logic
  2022-10-21  6:43 ` [PATCH v2] " Naga Harish K S V
@ 2022-10-21  9:32   ` Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2022-10-21  9:32 UTC (permalink / raw)
  To: Naga Harish K S V; +Cc: jay.jayatheerthan, jerinj, dev, stable

On Fri, Oct 21, 2022 at 12:16 PM Naga Harish K S V
<s.v.naga.harish.k@intel.com> wrote:
>
> 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 <s.v.naga.harish.k@intel.com>
> ---
> v2:
> * fix segfault during unit test and modify logic

Fixed following issue:
### eventdev/eth_tx: fix queue delete logic

WARNING:BAD_FIXES_TAG: Please use correct Fixes: style 'Fixes: <12
chars of sha1> ("<title line>")' - ie: 'Fixes: 741b499e6421
("eventdev/eth_tx: fix queue delete logic")'
#19:

Updated the git commit as follows and applied to
dpdk-next-net-eventdev/for-main. Thanks
    eventdev/eth_tx: fix queue delete logic

    To delete all the queues of a ethdev 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 ethdev 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: 741b499e6421 ("eventdev/eth_tx: fix queue delete logic")
    Cc: stable@dpdk.org

    Signed-off-by: Naga Harish K S V <s.v.naga.harish.k@intel.com>

> ---
> ---
>  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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-21  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 16:28 [PATCH] eventdev/eth_tx: fix queue delete logic Naga Harish K S V
2022-10-21  6:43 ` [PATCH v2] " Naga Harish K S V
2022-10-21  9:32   ` Jerin Jacob

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).