DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] lpm: fix allocation of an existing object
@ 2018-01-30 18:51 Pavan Nikhilesh
  2018-01-31  4:47 ` Phil Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pavan Nikhilesh @ 2018-01-30 18:51 UTC (permalink / raw)
  To: thomas, zhiyong.yang, ferruh.yigit, olivier.matz, pablo.de.lara.guarch
  Cc: dev, Pavan Nikhilesh

Fix rte_lpm_create_*() functions to return NULL and set rte_errno to
EEXIST when lpm object name already exists.
This is the behavior described in the API documentation in the header
file.

Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---

 This was already fixed in a previous patch by Olivier commit id
 f82f705b635d31a63446a16bc4526dbebf293c5a.
 But for some reason was undone in 134975073af3.
 lpm6 is untouched.
 Fixes currently broken 'func_reentrancy_autotest'.

 lib/librte_lpm/rte_lpm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c
index d464dbda9..d00b13d93 100644
--- a/lib/librte_lpm/rte_lpm.c
+++ b/lib/librte_lpm/rte_lpm.c
@@ -180,6 +180,7 @@ rte_lpm_create_v20(const char *name, int socket_id, int max_rules,
 	}

 	if (te != NULL) {
+		lpm = NULL;
 		rte_errno = EEXIST;
 		goto exit;
 	}
@@ -256,6 +257,7 @@ rte_lpm_create_v1604(const char *name, int socket_id,
 	}

 	if (te != NULL) {
+		lpm = NULL;
 		rte_errno = EEXIST;
 		goto exit;
 	}
--
2.16.0

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

* Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
  2018-01-30 18:51 [dpdk-dev] [PATCH] lpm: fix allocation of an existing object Pavan Nikhilesh
@ 2018-01-31  4:47 ` Phil Yang
  2018-01-31 13:30 ` Burakov, Anatoly
  2018-02-01  1:52 ` Yang, Zhiyong
  2 siblings, 0 replies; 5+ messages in thread
From: Phil Yang @ 2018-01-31  4:47 UTC (permalink / raw)
  To: Pavan Nikhilesh, thomas, zhiyong.yang, ferruh.yigit,
	olivier.matz, pablo.de.lara.guarch
  Cc: dev, nd


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pavan Nikhilesh
> Sent: Wednesday, January 31, 2018 2:52 AM
> To: thomas@monjalon.net; zhiyong.yang@intel.com; ferruh.yigit@intel.com;
> olivier.matz@6wind.com; pablo.de.lara.guarch@intel.com
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
> 
> Fix rte_lpm_create_*() functions to return NULL and set rte_errno to EEXIST
> when lpm object name already exists.
> This is the behavior described in the API documentation in the header file.
> 
> Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>

Acked-by: Phil Yang <phil.yang@arm.com>

> ---
> 
>  This was already fixed in a previous patch by Olivier commit id
> f82f705b635d31a63446a16bc4526dbebf293c5a.
>  But for some reason was undone in 134975073af3.
>  lpm6 is untouched.
>  Fixes currently broken 'func_reentrancy_autotest'.
> 
>  lib/librte_lpm/rte_lpm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index
> d464dbda9..d00b13d93 100644
> --- a/lib/librte_lpm/rte_lpm.c
> +++ b/lib/librte_lpm/rte_lpm.c
> @@ -180,6 +180,7 @@ rte_lpm_create_v20(const char *name, int socket_id,
> int max_rules,
>  	}
> 
>  	if (te != NULL) {
> +		lpm = NULL;
>  		rte_errno = EEXIST;
>  		goto exit;
>  	}
> @@ -256,6 +257,7 @@ rte_lpm_create_v1604(const char *name, int socket_id,
>  	}
> 
>  	if (te != NULL) {
> +		lpm = NULL;
>  		rte_errno = EEXIST;
>  		goto exit;
>  	}
> --
> 2.16.0

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

* Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
  2018-01-30 18:51 [dpdk-dev] [PATCH] lpm: fix allocation of an existing object Pavan Nikhilesh
  2018-01-31  4:47 ` Phil Yang
@ 2018-01-31 13:30 ` Burakov, Anatoly
  2018-01-31 23:36   ` Thomas Monjalon
  2018-02-01  1:52 ` Yang, Zhiyong
  2 siblings, 1 reply; 5+ messages in thread
From: Burakov, Anatoly @ 2018-01-31 13:30 UTC (permalink / raw)
  To: dev

On 30-Jan-18 6:51 PM, Pavan Nikhilesh wrote:
> Fix rte_lpm_create_*() functions to return NULL and set rte_errno to
> EEXIST when lpm object name already exists.
> This is the behavior described in the API documentation in the header
> file.
> 
> Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---

Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
  2018-01-31 13:30 ` Burakov, Anatoly
@ 2018-01-31 23:36   ` Thomas Monjalon
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2018-01-31 23:36 UTC (permalink / raw)
  To: Pavan Nikhilesh; +Cc: dev, Burakov, Anatoly

31/01/2018 14:30, Burakov, Anatoly:
> On 30-Jan-18 6:51 PM, Pavan Nikhilesh wrote:
> > Fix rte_lpm_create_*() functions to return NULL and set rte_errno to
> > EEXIST when lpm object name already exists.
> > This is the behavior described in the API documentation in the header
> > file.
> > 
> > Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")
> > 
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> 
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks

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

* Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
  2018-01-30 18:51 [dpdk-dev] [PATCH] lpm: fix allocation of an existing object Pavan Nikhilesh
  2018-01-31  4:47 ` Phil Yang
  2018-01-31 13:30 ` Burakov, Anatoly
@ 2018-02-01  1:52 ` Yang, Zhiyong
  2 siblings, 0 replies; 5+ messages in thread
From: Yang, Zhiyong @ 2018-02-01  1:52 UTC (permalink / raw)
  To: Pavan Nikhilesh, thomas, Yigit, Ferruh, olivier.matz,
	De Lara Guarch, Pablo
  Cc: dev

Hi Pavan,

Good catch!  Thank you for fixing it.  It's my negligence.  

Thanks
Zhiyong

> -----Original Message-----
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Wednesday, January 31, 2018 2:52 AM
> To: thomas@monjalon.net; Yang, Zhiyong <zhiyong.yang@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>; olivier.matz@6wind.com; De Lara Guarch,
> Pablo <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
> 
> Fix rte_lpm_create_*() functions to return NULL and set rte_errno to EEXIST
> when lpm object name already exists.
> This is the behavior described in the API documentation in the header file.
> 
> Fixes: 134975073af3 ("lib: remove unnecessary pointer cast")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
> ---

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

end of thread, other threads:[~2018-02-01  1:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 18:51 [dpdk-dev] [PATCH] lpm: fix allocation of an existing object Pavan Nikhilesh
2018-01-31  4:47 ` Phil Yang
2018-01-31 13:30 ` Burakov, Anatoly
2018-01-31 23:36   ` Thomas Monjalon
2018-02-01  1:52 ` Yang, Zhiyong

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