Thread (5 messages) 5 messages, 5 authors, 2018-02-01

Re: [PATCH] lpm: fix allocation of an existing object

From: Phil Yang <hidden>
Date: 2018-01-31 04:47:36

-----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 <redacted>
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 <redacted>
Acked-by: Phil Yang <redacted>
quoted hunk ↗ jump to hunk
---

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help