DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] run ip_fragmentation with cores in different socket will cause core dump
@ 2016-06-13  7:41 Ding, HengX
  2016-06-13  8:46 ` Olivier Matz
  0 siblings, 1 reply; 4+ messages in thread
From: Ding, HengX @ 2016-06-13  7:41 UTC (permalink / raw)
  To: Ding, HengX, olivier.matz; +Cc: Xu, Qian Q, dev


The following command will cause ip_fragmentation app fail:
examples/ip_fragmentation/build/ip_fragmentation -c 0x40002 -n 4 -- -p 0x3 -q 2
while setting core mask to 0x2 or 0x40000 will not cause this issue.

error message is shown below:

EAL:   Not managed by a supported kernel driver, skipped
IP_FRAG: Creating direct mempool on socket 0
IP_FRAG: Creating indirect mempool on socket 0
IP_FRAG: Creating LPM table on socket 0
IP_FRAG: Creating LPM6 table on socket 0
IP_FRAG: Creating direct mempool on socket 1
IP_FRAG: Creating indirect mempool on socket 1
IP_FRAG: Creating LPM table on socket 1
IP_FRAG: Creating LPM6 table on socket 1
IP_FRAG: Cannot create LPM table
PANIC in main():
Cannot initialize memory structures!
5: [examples/ip_fragmentation/build/ip_fragmentation() [0x42df85]]
4: [/lib64/libc.so.6(__libc_start_main+0xf5) [0x3a8a421d65]]
3: [examples/ip_fragmentation/build/ip_fragmentation() [0x42d163]]
2: [examples/ip_fragmentation/build/ip_fragmentation(__rte_panic+0xc9) [0x426c0c]]
1: [examples/ip_fragmentation/build/ip_fragmentation(rte_dump_stack+0x1a) [0x4980aa]]
Aborted (core dumped)

And the bisect result:

f82f705b635d31a63446a16bc4526dbebf293c5a is the first bad commit
commit f82f705b635d31a63446a16bc4526dbebf293c5a
Author: Olivier Matz <olivier.matz@6wind.com>
Date:   Wed Apr 6 15:27:58 2016 +0200

    lpm: fix allocation of an existing object

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

    These functions were returning a pointer to the existing object in that
    case, but it is a problem as the caller did not know if the object had
    to be freed or not.

    Doing this change also makes the lpm API more consistent with the other
    APIs (mempool, rings, ...).

    Fixes: 916e4f4f4e ("memory: fix for multi process support")

    Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
    Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

:040000 040000 a7450772f279b8d459c96dd7a7b193d01bb4ecf6 0a41cee86a23d7968218183c93a4b60a6bfff1c3 M      app
:040000 040000 88dd7b9fadc50cbf7824e28195d892635d45581d 72e3179c9835c6bea6909a29a56a1c7835540368 M      doc
:040000 040000 8478c771116ac841eeca65c6b08e263229a96d57 76e2294cca653e366456a73755efbbff687630d2 M      lib


Thanks
Ding Heng

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

* Re: [dpdk-dev] run ip_fragmentation with cores in different socket will cause core dump
  2016-06-13  7:41 [dpdk-dev] run ip_fragmentation with cores in different socket will cause core dump Ding, HengX
@ 2016-06-13  8:46 ` Olivier Matz
  2016-06-13  9:43   ` [dpdk-dev] [PATCH] examples: fix duplicated lpm6 name Olivier Matz
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Matz @ 2016-06-13  8:46 UTC (permalink / raw)
  To: Ding, HengX; +Cc: Xu, Qian Q, dev

Hi,

On 06/13/2016 09:41 AM, Ding, HengX wrote:
> The following command will cause ip_fragmentation app fail:
> examples/ip_fragmentation/build/ip_fragmentation -c 0x40002 -n 4 -- -p 0x3 -q 2
> while setting core mask to 0x2 or 0x40000 will not cause this issue.
> 
> error message is shown below:
> 
> EAL:   Not managed by a supported kernel driver, skipped
> IP_FRAG: Creating direct mempool on socket 0
> IP_FRAG: Creating indirect mempool on socket 0
> IP_FRAG: Creating LPM table on socket 0
> IP_FRAG: Creating LPM6 table on socket 0
> IP_FRAG: Creating direct mempool on socket 1
> IP_FRAG: Creating indirect mempool on socket 1
> IP_FRAG: Creating LPM table on socket 1
> IP_FRAG: Creating LPM6 table on socket 1
> IP_FRAG: Cannot create LPM table
> PANIC in main():
> Cannot initialize memory structures!
> 5: [examples/ip_fragmentation/build/ip_fragmentation() [0x42df85]]
> 4: [/lib64/libc.so.6(__libc_start_main+0xf5) [0x3a8a421d65]]
> 3: [examples/ip_fragmentation/build/ip_fragmentation() [0x42d163]]
> 2: [examples/ip_fragmentation/build/ip_fragmentation(__rte_panic+0xc9) [0x426c0c]]
> 1: [examples/ip_fragmentation/build/ip_fragmentation(rte_dump_stack+0x1a) [0x4980aa]]
> Aborted (core dumped)
> 
> And the bisect result:
> 
> f82f705b635d31a63446a16bc4526dbebf293c5a is the first bad commit
> commit f82f705b635d31a63446a16bc4526dbebf293c5a
> Author: Olivier Matz <olivier.matz@6wind.com>
> Date:   Wed Apr 6 15:27:58 2016 +0200
> 
>     lpm: fix allocation of an existing object
> 
>     Change rte_lpm*_create() functions to return NULL and set rte_errno to
>    EEXIST when the object name already exists. This is the behavior
>     described in the API documentation in the header file.
> 
>     These functions were returning a pointer to the existing object in that
>     case, but it is a problem as the caller did not know if the object had
>     to be freed or not.
> 
>     Doing this change also makes the lpm API more consistent with the other
>     APIs (mempool, rings, ...).
> 
>     Fixes: 916e4f4f4e ("memory: fix for multi process support")
> 
>     Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
>     Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

>From what I see, the ip_fragmentation example does not check if
a lpm table already exists before creating it. I'll send a patch
to fix this, and also check if other applications examples are
impacted.

Thanks for reporting.

Regards,
Olivier

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

* [dpdk-dev] [PATCH] examples: fix duplicated lpm6 name
  2016-06-13  8:46 ` Olivier Matz
@ 2016-06-13  9:43   ` Olivier Matz
  2016-06-15 14:30     ` Thomas Monjalon
  0 siblings, 1 reply; 4+ messages in thread
From: Olivier Matz @ 2016-06-13  9:43 UTC (permalink / raw)
  To: hengx.ding, qian.q.xu, konstantin.ananyev, dev

When starting the ip_fragmentation or ip_reassembly example
on several sockets, it fails.

The name of the lpm6 table is the same on every socket,
resulting in a table creation failure (-EEXIST). The failure
appeared after:
commit f82f705b635d ("lpm: fix allocation of an existing object")

Indeed, before this commit the returned value when the existing
table, which was probably a bug in that case: one table for 2
sockets for lpm6, and one per socket for lpm.

Fixes: 74de12b7b63a ("examples/ip_fragmentation: overhaul")
Fixes: b84fb4cb88ff ("examples/ip_reassembly: overhaul")
Reported-by: Ding Heng <hengx.ding@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 examples/ip_fragmentation/main.c | 2 +-
 examples/ip_reassembly/main.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index b00f1e6..2f45264 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -785,7 +785,7 @@ init_mem(void)
 			RTE_LOG(INFO, IP_FRAG, "Creating LPM6 table on socket %i\n", socket);
 			snprintf(buf, sizeof(buf), "IP_FRAG_LPM_%i", socket);
 
-			lpm6 = rte_lpm6_create("IP_FRAG_LPM6", socket, &lpm6_config);
+			lpm6 = rte_lpm6_create(buf, socket, &lpm6_config);
 			if (lpm6 == NULL) {
 				RTE_LOG(ERR, IP_FRAG, "Cannot create LPM table\n");
 				return -1;
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index a8aabdc..ef09a2e 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -963,7 +963,7 @@ init_mem(void)
 			RTE_LOG(INFO, IP_RSMBL, "Creating LPM6 table on socket %i\n", socket);
 			snprintf(buf, sizeof(buf), "IP_RSMBL_LPM_%i", socket);
 
-			lpm6 = rte_lpm6_create("IP_RSMBL_LPM6", socket, &lpm6_config);
+			lpm6 = rte_lpm6_create(buf, socket, &lpm6_config);
 			if (lpm6 == NULL) {
 				RTE_LOG(ERR, IP_RSMBL, "Cannot create LPM table\n");
 				return -1;
-- 
2.8.0.rc3

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

* Re: [dpdk-dev] [PATCH] examples: fix duplicated lpm6 name
  2016-06-13  9:43   ` [dpdk-dev] [PATCH] examples: fix duplicated lpm6 name Olivier Matz
@ 2016-06-15 14:30     ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-06-15 14:30 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, hengx.ding, qian.q.xu, konstantin.ananyev

2016-06-13 11:43, Olivier Matz:
> When starting the ip_fragmentation or ip_reassembly example
> on several sockets, it fails.
> 
> The name of the lpm6 table is the same on every socket,
> resulting in a table creation failure (-EEXIST). The failure
> appeared after:
> commit f82f705b635d ("lpm: fix allocation of an existing object")
> 
> Indeed, before this commit the returned value when the existing
> table, which was probably a bug in that case: one table for 2
> sockets for lpm6, and one per socket for lpm.
> 
> Fixes: 74de12b7b63a ("examples/ip_fragmentation: overhaul")
> Fixes: b84fb4cb88ff ("examples/ip_reassembly: overhaul")
> Reported-by: Ding Heng <hengx.ding@intel.com>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

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

end of thread, other threads:[~2016-06-15 14:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13  7:41 [dpdk-dev] run ip_fragmentation with cores in different socket will cause core dump Ding, HengX
2016-06-13  8:46 ` Olivier Matz
2016-06-13  9:43   ` [dpdk-dev] [PATCH] examples: fix duplicated lpm6 name Olivier Matz
2016-06-15 14:30     ` Thomas Monjalon

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