patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/mvpp2: fix non-EAL thread support
@ 2020-06-16  9:47 David Marchand
  2020-06-16  9:49 ` [dpdk-stable] [EXT] " Liron Himi
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2020-06-16  9:47 UTC (permalink / raw)
  To: dev; +Cc: stable, Liron Himi, Natalie Samsonov

Caught by code inspection, for a non-EAL thread identified with
rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses
lcore 0 while there is no guarantee this lcore is used.

Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c
index b98b1fd667..9037274327 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(priv, core_id);
 
@@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 
 	core_id = rte_lcore_id();
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(rxq->priv, core_id);
 	if (!hif)
@@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	if (!q)
 		return;
-- 
2.23.0


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

* Re: [dpdk-stable] [EXT] [PATCH] net/mvpp2: fix non-EAL thread support
  2020-06-16  9:47 [dpdk-stable] [PATCH] net/mvpp2: fix non-EAL thread support David Marchand
@ 2020-06-16  9:49 ` " Liron Himi
  2020-06-26  4:45   ` [dpdk-stable] [dpdk-dev] " Jerin Jacob
  0 siblings, 1 reply; 3+ messages in thread
From: Liron Himi @ 2020-06-16  9:49 UTC (permalink / raw)
  To: David Marchand, dev; +Cc: stable, Liron Himi


Acked-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: David Marchand <david.marchand@redhat.com> 
Sent: Tuesday, 16 June 2020 12:47
To: dev@dpdk.org
Cc: stable@dpdk.org; Liron Himi <lironh@marvell.com>; Natalie Samsonov <nsamsono@marvell.com>
Subject: [EXT] [PATCH] net/mvpp2: fix non-EAL thread support

External Email

----------------------------------------------------------------------
Caught by code inspection, for a non-EAL thread identified with
rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses lcore 0 while there is no guarantee this lcore is used.

Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index b98b1fd667..9037274327 100644
--- a/drivers/net/mvpp2/mrvl_ethdev.c
+++ b/drivers/net/mvpp2/mrvl_ethdev.c
@@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(priv, core_id);
 
@@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
 
 	core_id = rte_lcore_id();
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	hif = mrvl_get_hif(rxq->priv, core_id);
 	if (!hif)
@@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq)
 	unsigned int core_id = rte_lcore_id();
 
 	if (core_id == LCORE_ID_ANY)
-		core_id = 0;
+		core_id = rte_get_master_lcore();
 
 	if (!q)
 		return;
--
2.23.0


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

* Re: [dpdk-stable] [dpdk-dev] [EXT] [PATCH] net/mvpp2: fix non-EAL thread support
  2020-06-16  9:49 ` [dpdk-stable] [EXT] " Liron Himi
@ 2020-06-26  4:45   ` " Jerin Jacob
  0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2020-06-26  4:45 UTC (permalink / raw)
  To: Liron Himi; +Cc: David Marchand, dev, stable

On Tue, Jun 16, 2020 at 3:19 PM Liron Himi <lironh@marvell.com> wrote:
>
>
> Acked-by: Liron Himi <lironh@marvell.com>


Applied to dpdk-next-net-mrvl/master. Thanks



>
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, 16 June 2020 12:47
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Liron Himi <lironh@marvell.com>; Natalie Samsonov <nsamsono@marvell.com>
> Subject: [EXT] [PATCH] net/mvpp2: fix non-EAL thread support
>
> External Email
>
> ----------------------------------------------------------------------
> Caught by code inspection, for a non-EAL thread identified with
> rte_lcore_id() == LCORE_ID_ANY, the code currently arbitrarily uses lcore 0 while there is no guarantee this lcore is used.
>
> Fixes: 3588aaa68eab ("net/mrvl: fix HIF objects allocation")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  drivers/net/mvpp2/mrvl_ethdev.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index b98b1fd667..9037274327 100644
> --- a/drivers/net/mvpp2/mrvl_ethdev.c
> +++ b/drivers/net/mvpp2/mrvl_ethdev.c
> @@ -816,7 +816,7 @@ mrvl_flush_bpool(struct rte_eth_dev *dev)
>         unsigned int core_id = rte_lcore_id();
>
>         if (core_id == LCORE_ID_ANY)
> -               core_id = 0;
> +               core_id = rte_get_master_lcore();
>
>         hif = mrvl_get_hif(priv, core_id);
>
> @@ -1620,7 +1620,7 @@ mrvl_fill_bpool(struct mrvl_rxq *rxq, int num)
>
>         core_id = rte_lcore_id();
>         if (core_id == LCORE_ID_ANY)
> -               core_id = 0;
> +               core_id = rte_get_master_lcore();
>
>         hif = mrvl_get_hif(rxq->priv, core_id);
>         if (!hif)
> @@ -1770,7 +1770,7 @@ mrvl_rx_queue_release(void *rxq)
>         unsigned int core_id = rte_lcore_id();
>
>         if (core_id == LCORE_ID_ANY)
> -               core_id = 0;
> +               core_id = rte_get_master_lcore();
>
>         if (!q)
>                 return;
> --
> 2.23.0
>

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  9:47 [dpdk-stable] [PATCH] net/mvpp2: fix non-EAL thread support David Marchand
2020-06-16  9:49 ` [dpdk-stable] [EXT] " Liron Himi
2020-06-26  4:45   ` [dpdk-stable] [dpdk-dev] " Jerin Jacob

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox