Skip to contentSkip to conversation

RTE_LCORE_FOREACH goes over unactive cores with dynamic linking on BlueField 2

dpdk-dev [email protected] 1 participant 2 messages Oct 5, 2021 – Oct 13, 2021

lore
Share & tools
lore
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=824

Bug ID: 824
Summary: RTE_LCORE_FOREACH goes over unactive cores with
dynamic linking on BlueField 2
Product: DPDK
Version: 21.08
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: core
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---

This may not only happen on BlueField 2 only, but this is where I catched the bug...

test.c

Quoted 10 lines

#include <rte_lcore.h>
#include <rte_eal.h>
int
main(int argc, char **argv)
{
int ret;
int lcore_id;
/* init EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)

Quoted 6 lines
    rte_exit(EXIT_FAILURE, "Invalid EAL parameters\n");
  printf("Have %d cores\n", rte_lcore_count());
  RTE_LCORE_FOREACH(lcore_id) {
    printf("Core %d\n",lcore_id);

}
}

Then compile using dynamic linking:

Quoted 2 lines

gcc -o mytest test.c $(pkg-config --libs libdpdk) $(pkg-config --cflags libdpdk)

Run:

Quoted 6 lines

./mytest
Have 8 cores
Core 0
Core 1
...
Core 63

With --static --libs it works fine

Maybe a check should be done to verify the core is active in RTE_LCORE_FOREACH but I did not see any doc and there is no such things in the example.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.
#1 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=824

Tom Barbette ([email protected]) changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |INVALID
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #4 from Tom Barbette ([email protected]) ---
I can't reproduce with a fresh install. So I think it must be because I used 21.08 headers but linked with some older libs installed on the BlueField DOCA package. Sorry for the false alarm.

Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.