DPDK patches and discussions
 help / color / mirror / Atom feed
From: Phil Yang <Phil.Yang@arm.com>
To: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>,
	"zhiyong.yang@intel.com" <zhiyong.yang@intel.com>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>,
	"olivier.matz@6wind.com" <olivier.matz@6wind.com>,
	"pablo.de.lara.guarch@intel.com" <pablo.de.lara.guarch@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, nd <nd@arm.com>
Subject: Re: [dpdk-dev] [PATCH] lpm: fix allocation of an existing object
Date: Wed, 31 Jan 2018 04:47:34 +0000	[thread overview]
Message-ID: <AM4PR08MB0913ADBAFDD23FFF32B7347AE9FB0@AM4PR08MB0913.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20180130185154.20095-1-pbhagavatula@caviumnetworks.com>


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

  reply	other threads:[~2018-01-31  4:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 18:51 Pavan Nikhilesh
2018-01-31  4:47 ` Phil Yang [this message]
2018-01-31 13:30 ` Burakov, Anatoly
2018-01-31 23:36   ` Thomas Monjalon
2018-02-01  1:52 ` Yang, Zhiyong

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=AM4PR08MB0913ADBAFDD23FFF32B7347AE9FB0@AM4PR08MB0913.eurprd08.prod.outlook.com \
    --to=phil.yang@arm.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=nd@arm.com \
    --cc=olivier.matz@6wind.com \
    --cc=pablo.de.lara.guarch@intel.com \
    --cc=pbhagavatula@caviumnetworks.com \
    --cc=thomas@monjalon.net \
    --cc=zhiyong.yang@intel.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).