Skip to contentSkip to conversation

Move EAL common functions.

PATCH Superseded Ravi Kerur 2 participants 27 messages Apr 23, 2015 – May 1, 2015 21 messages not in the archive

v7 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Ravi Kerur

author
#0 lore raw

v7 cover Move EAL common functions.

Changes in v7 includes
Fix clang and ICC compilation errors reported by Bruce. Remove pthread _setname_ APIs introduced in v6 as a separate patch is sent.

Testing:
Linux - Ubuntu x86_64 14.04
Compilation successful (x86_64-native-linuxapp-gcc and x86_64-native-linuxapp-clang).
"make test" results match baseline code. testpmd utility on I217/I218 Intel chipset.

FreeBSD 10.0 x86_64
Compilation successful (x86_64-native-bsdapp-gcc). helloworld.

Ravi Kerur (6):
Move common functions in eal_thread.c
Move common functions in eal.c
Move common functions in eal_lcore.c
Move common functions in eal_timer.c
Move common functions in eal_memory.c
Move common functions in eal_pci.c

 lib/librte_eal/bsdapp/eal/Makefile           |   8 +-
 lib/librte_eal/bsdapp/eal/eal.c              | 271 +++---------------------
 lib/librte_eal/bsdapp/eal/eal_lcore.c        |  72 ++-----
 lib/librte_eal/bsdapp/eal/eal_memory.c       |  47 ++---
 lib/librte_eal/bsdapp/eal/eal_pci.c          |  72 +------
 lib/librte_eal/bsdapp/eal/eal_thread.c       | 152 --------------
 lib/librte_eal/bsdapp/eal/eal_timer.c        |  52 +----
 lib/librte_eal/common/eal_common_app_usage.c |  63 ++++++
 lib/librte_eal/common/eal_common_lcore.c     | 107 ++++++++++
 lib/librte_eal/common/eal_common_mem_cfg.c   | 217 ++++++++++++++++++++
 lib/librte_eal/common/eal_common_memory.c    |  38 +++-
 lib/librte_eal/common/eal_common_pci.c       |  72 +++++++
 lib/librte_eal/common/eal_common_proc_type.c |  58 ++++++
 lib/librte_eal/common/eal_common_sysfs.c     | 163 +++++++++++++++
 lib/librte_eal/common/eal_common_thread.c    | 147 ++++++++++++-
 lib/librte_eal/common/eal_common_timer.c     | 102 +++++++++
 lib/librte_eal/common/eal_hugepages.h        |   1 +
 lib/librte_eal/common/eal_private.h          | 171 +++++++++++++++-
 lib/librte_eal/common/include/rte_eal.h      |   4 +
 lib/librte_eal/linuxapp/eal/Makefile         |   7 +
 lib/librte_eal/linuxapp/eal/eal.c            | 296 ++++-----------------------
 lib/librte_eal/linuxapp/eal/eal_lcore.c      |  66 +-----
 lib/librte_eal/linuxapp/eal/eal_memory.c     |  36 +---
 lib/librte_eal/linuxapp/eal/eal_pci.c        |  75 +------
 lib/librte_eal/linuxapp/eal/eal_thread.c     | 152 +-------------
 lib/librte_eal/linuxapp/eal/eal_timer.c      |  55 +----
 26 files changed, 1282 insertions(+), 1222 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_app_usage.c
 create mode 100644 lib/librte_eal/common/eal_common_lcore.c
 create mode 100644 lib/librte_eal/common/eal_common_mem_cfg.c
 create mode 100644 lib/librte_eal/common/eal_common_proc_type.c
 create mode 100644 lib/librte_eal/common/eal_common_sysfs.c
 create mode 100644 lib/librte_eal/common/eal_common_timer.c
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1429824909-9360-1-git-send-email-rkerur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

author
#2 lore raw

PATCH v7 1/6 Move common functions in eal_thread.c

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152 ------------------------------
 lib/librte_eal/common/eal_common_thread.c | 147 ++++++++++++++++++++++++++++-
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152 +-----------------------------
 4 files changed, 148 insertions(+), 305 deletions(-)
lib/librte_eal/bsdapp/eal/Makefile +1 -1
index 2357cfa..55971b9 100644
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -152

163 lines not on this page · raw message

lib/librte_eal/common/eal_common_thread.c +146 -1

170 lines not on this page · raw message

lib/librte_eal/linuxapp/eal/eal_thread.c +1 -151

164 lines not on this page · raw message

Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1429824936-9399-1-git-send-email-rkerur-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

author
#4 lore raw

PATCH v7 2/6 Move common functions in eal.c

Changes in v7
Fix clang and ICC compilation errors.

Changes in v6
Split eal_common_system.c and eal_common_runtime.c into eal_common_sysfs.c
eal_common_mem_cfg.c
eal_common_proc_type.c
eal_comm_app_usage.c
based on functionality.

Changes in v5
Rebase to latest code.

Changes in v4
Remove eal_externs.h file, instead use _get_ and _set_ APIS to access those variables.
Split eal_common.c into eal_common_system.c and
and eal_common_runtime.c
rte_eal prefix functions are moved to _runtime_ and eal prefix functions are moved to _system_ files respectively.

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
In function rte_eal_config_create remove #ifdef _BSDAPP_ and initialize mem_cfg_addr unconditionally.

Changes in v1
Move common functions in eal.c to librte_eal/common/eal_common.c.

Following functions are moved to eal_common.c file.

struct rte_config *rte_eal_get_configuration(void);
int eal_parse_sysfs_value(const char *filename, unsigned long *val); static void rte_eal_config_create(void);
enum rte_proc_type_t eal_proc_type_detect(void);
void rte_eal_config_init(void);
rte_usage_hook_t rte_set_application_usage_hook(rte_usage_hook_t usage_func);
inline size_t eal_get_hugepage_mem_size(void);
void eal_check_mem_on_local_socket(void);
int sync_func(__attribute__((unused)) void *arg);
inline void rte_eal_mcfg_complete(void);
int rte_eal_has_hugepages(void);
enum rte_lcore_role_t rte_eal_lcore_role(unsigned lcore_id); enum rte_proc_type_t rte_eal_process_type(void);

Makefile changes to reflect new files added.
Fix checkpatch warnings and errors.

---
 lib/librte_eal/bsdapp/eal/Makefile           |   4 +
 lib/librte_eal/bsdapp/eal/eal.c              | 271 +++---------------------
 lib/librte_eal/common/eal_common_app_usage.c |  63 ++++++
 lib/librte_eal/common/eal_common_mem_cfg.c   | 217 ++++++++++++++++++++
 lib/librte_eal/common/eal_common_proc_type.c |  58 ++++++
 lib/librte_eal/common/eal_common_sysfs.c     | 163 +++++++++++++++
 lib/librte_eal/common/eal_hugepages.h        |   1 +
 lib/librte_eal/common/eal_private.h          |  78 +++++++
 lib/librte_eal/common/include/rte_eal.h      |   4 +
 lib/librte_eal/linuxapp/eal/Makefile         |   4 +
 lib/librte_eal/linuxapp/eal/eal.c            | 296 ++++-----------------------
 11 files changed, 668 insertions(+), 491 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_app_usage.c
 create mode 100644 lib/librte_eal/common/eal_common_mem_cfg.c
 create mode 100644 lib/librte_eal/common/eal_common_proc_type.c
 create mode 100644 lib/librte_eal/common/eal_common_sysfs.c
lib/librte_eal/bsdapp/eal/Makefile +4 -0
index 55971b9..5076a05 100644
@@ -78,6 +78,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_devargs.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_options.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_thread.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_sysfs.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_mem_cfg.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_proc_type.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_app_usage.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 #CFLAGS_eal_thread.o := -D_GNU_SOURCE
lib/librte_eal/bsdapp/eal/eal.c +33 -238

341 lines not on this page · raw message

lib/librte_eal/common/eal_common_app_usage.c new file +63 -0

63 lines not on this page · raw message

lib/librte_eal/common/eal_common_mem_cfg.c new file +217 -0

217 lines not on this page · raw message

lib/librte_eal/common/eal_common_proc_type.c new file +58 -0

58 lines not on this page · raw message

lib/librte_eal/common/eal_common_sysfs.c new file +163 -0

163 lines not on this page · raw message

lib/librte_eal/common/eal_hugepages.h +1 -0
index 38edac0..d79ef8a 100644
@@ -63,5 +63,6 @@ struct hugepage_file {
  * for the EAL to use
  */
 int eal_hugepage_info_init(void);
+size_t eal_get_hugepage_mem_size(void);
 
 #endif /* EAL_HUGEPAGES_H */
lib/librte_eal/common/eal_private.h +78 -0

88 lines not on this page · raw message

lib/librte_eal/common/include/rte_eal.h +4 -0
index 1385a73..daf2ee0 100644
@@ -51,6 +51,10 @@ extern "C" {
 
 #define RTE_MAGIC 19820526 /**< Magic number written by the main partition when ready. */
 
+#define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL)
+
+#define SOCKET_MEM_STRLEN (RTE_MAX_NUMA_NODES * 10)
+
 /**
  * The lcore role (used in RTE or not).
  */
lib/librte_eal/linuxapp/eal/Makefile +4 -0
index 01f7b70..329d9e4 100644
@@ -90,6 +90,10 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_devargs.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_dev.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_options.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_thread.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 CFLAGS_eal_interrupts.o := -D_GNU_SOURCE
lib/librte_eal/linuxapp/eal/eal.c +43 -253

407 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#5 lore raw

PATCH v7 3/6 Move common functions in eal_lcore.c

In reply to a message not in the archive

Changes in v7
None

Changes in v6
None

Changes in v5
Rebase to latest code.

Changes in v4
Implement cpu_detected() for BSD.
Have common RTE_LOG for Linux and BSD in rte_eal_cpu_init(). Remove RTE_EXEC_ENV_BSDAPP in common file.

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
Move common function in eal_lcore.c to librte_eal/common/ eal_common_lcore.c file.

Following function is moved to eal_common_lcore.c file

int rte_eal_cpu_init(void);

Use RTE_EXEC_ENV_BSDAPP to differentiate minor differences in common function.
Makefile changes to reflect new file added.
Fix checkpatch warnings and errors.

---
 lib/librte_eal/bsdapp/eal/Makefile       |   1 +
 lib/librte_eal/bsdapp/eal/eal_lcore.c    |  72 +++++----------------
 lib/librte_eal/common/eal_common_lcore.c | 107 +++++++++++++++++++++++++++++++
 lib/librte_eal/common/eal_private.h      |  14 ++++
 lib/librte_eal/linuxapp/eal/Makefile     |   2 +
 lib/librte_eal/linuxapp/eal/eal_lcore.c  |  66 ++-----------------
 6 files changed, 143 insertions(+), 119 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_lcore.c
lib/librte_eal/bsdapp/eal/Makefile +1 -0
index 5076a05..1da0410 100644
@@ -82,6 +82,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_sysfs.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_mem_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_proc_type.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_app_usage.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_lcore.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 #CFLAGS_eal_thread.o := -D_GNU_SOURCE
lib/librte_eal/bsdapp/eal/eal_lcore.c +15 -57

89 lines not on this page · raw message

lib/librte_eal/common/eal_common_lcore.c new file +107 -0

107 lines not on this page · raw message

lib/librte_eal/common/eal_private.h +14 -0
index bcf603f..76e47a9 100644
@@ -310,4 +310,18 @@ void rte_eal_config_attach(void);
  */
 void rte_eal_config_reattach(void);
 
+/**
+ * This function gets cpu core_id
+ *
+ * This function is private to the EAL.
+ */
+unsigned eal_cpu_core_id(unsigned lcore_id);
+
+/**
+ * This function check if cpu is present
+ *
+ * This function is private to the EAL.
+ */
+int eal_cpu_detected(unsigned lcore_id);
+
 #endif /* _EAL_PRIVATE_H_ */
lib/librte_eal/linuxapp/eal/Makefile +2 -0
index 329d9e4..7259bd7 100644
@@ -94,6 +94,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_lcore.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 CFLAGS_eal_interrupts.o := -D_GNU_SOURCE
@@ -108,6 +109,7 @@ CFLAGS_eal_pci_vfio.o := -D_GNU_SOURCE
 CFLAGS_eal_common_whitelist.o := -D_GNU_SOURCE
 CFLAGS_eal_common_options.o := -D_GNU_SOURCE
 CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
+CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE
 
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
lib/librte_eal/linuxapp/eal/eal_lcore.c +4 -62

81 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#6 lore raw

PATCH v7 4/6 Move common functions in eal_timer.c

In reply to a message not in the archive

Changes in v7
None

Changes in v6
Added new line between Copyright and header file inclusion in eal_common_timer.c.

Changes in v5
Rebase to latest code.

Changes in v4
Removed extern declaration of eal_tsc_resolution_hz, instead provided _set_ API.
Make set_tsc_freq_from_clock as wrapper function for BSD.

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
Use common function name set_tsc_freq_from_sysctl for BSD and Linux. Update comments about its actuality in function declaration.

Changes in v1
Move common functions in eal_timer.c to librte_eal/common/ eal_common_timer.c file.

Following functions are moved to eal_common_timer.c file

void rte_delay_us(unsigned us);
uint64_t rte_get_tsc_hz(void);
static void set_tsc_freq_fallback(void);
void set_tsc_freq(void);

Makefile changes to reflect new file added.
Fix checkpatch warnings and errors.

---
 lib/librte_eal/bsdapp/eal/Makefile       |   1 +
 lib/librte_eal/bsdapp/eal/eal_timer.c    |  52 +++-------------
 lib/librte_eal/common/eal_common_timer.c | 102 +++++++++++++++++++++++++++++++
 lib/librte_eal/common/eal_private.h      |  24 ++++++++
 lib/librte_eal/linuxapp/eal/Makefile     |   1 +
 lib/librte_eal/linuxapp/eal/eal_timer.c  |  55 ++---------------
 6 files changed, 140 insertions(+), 95 deletions(-)
 create mode 100644 lib/librte_eal/common/eal_common_timer.c
lib/librte_eal/bsdapp/eal/Makefile +1 -0
index 1da0410..d8e6ced 100644
@@ -83,6 +83,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_mem_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_proc_type.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_app_usage.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_lcore.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_BSDAPP) += eal_common_timer.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 #CFLAGS_eal_thread.o := -D_GNU_SOURCE
lib/librte_eal/bsdapp/eal/eal_timer.c +8 -44

79 lines not on this page · raw message

lib/librte_eal/common/eal_common_timer.c new file +102 -0

102 lines not on this page · raw message

lib/librte_eal/common/eal_private.h +24 -0
index 76e47a9..8de4ebb 100644
@@ -324,4 +324,28 @@ unsigned eal_cpu_core_id(unsigned lcore_id);
  */
 int eal_cpu_detected(unsigned lcore_id);
 
+/**
+ * This function measures TSC frequency
+ *
+ * This function is private to the EAL.
+ */
+void set_tsc_freq(void);
+
+/**
+ * This function sets TSC frequency from sysctl
+ * for BSD and from clock for Linux.
+ * Is a wrapper function for BSD which will
+ * internally call set_tsc_freq_from_sysctl.
+ *
+ * This function is private to the EAL.
+ */
+int set_tsc_freq_from_clock(void);
+
+/**
+ * This function sets TSC frequency
+ *
+ * This function is private to the EAL.
+ */
+void rte_set_tsc_hz(uint64_t tsc_hz);
+
 #endif /* _EAL_PRIVATE_H_ */
lib/librte_eal/linuxapp/eal/Makefile +1 -0
index 7259bd7..a1c277e 100644
@@ -95,6 +95,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
 SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_lcore.c
+SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_timer.c
 
 CFLAGS_eal.o := -D_GNU_SOURCE
 CFLAGS_eal_interrupts.o := -D_GNU_SOURCE
lib/librte_eal/linuxapp/eal/eal_timer.c +4 -51

91 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#7 lore raw

PATCH v7 5/6 Move common functions in eal_memory.c

In reply to a message not in the archive

Changes in v7
None

Changes in v6
Removed unnecessary comments in function declaration.

Changes in v5
Rebase to latest code.

Changes in v4
Make rte_eal_hugepage_init and rte_eal_hugepage_attach as wrapper functions for BSD.

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
Use common function names rte_eal_hugepage_init and rte_eal_hugepage_attach for BSD and Linux. Update comments about its actuality in function declaration.

Changes in v1
Move common functions in eal_memory.c to librte_eal/common/ eal_common_memory.c file.

Following functions are moved to eal_common_memory.c file

static int rte_eal_memdevice_init(void); int rte_eal_memory_init(void);

Fix checkpatch warnings and errors.

---
 lib/librte_eal/bsdapp/eal/eal_memory.c    | 47 +++++++++++--------------------
 lib/librte_eal/common/eal_common_memory.c | 38 +++++++++++++++++++++++--
 lib/librte_eal/common/eal_private.h       | 20 +++++++++++--
 lib/librte_eal/linuxapp/eal/eal_memory.c  | 36 ++---------------------
 4 files changed, 72 insertions(+), 69 deletions(-)
lib/librte_eal/bsdapp/eal/eal_memory.c +16 -31
index 33ebd0f..77c27b3 100644
@@ -59,7 +59,7 @@ rte_mem_virt2phy(const void *virtaddr)
 	return RTE_BAD_PHYS_ADDR;
 }
 
-static int
+static inline int
 rte_eal_contigmem_init(void)
 {
 	struct rte_mem_config *mcfg;
@@ -131,7 +131,16 @@ rte_eal_contigmem_init(void)
 	return 0;
 }
 
-static int
+/*
+ * Wrapper function to initialize contigmem.
+ */
+int
+rte_eal_hugepage_init(void)
+{
+	return rte_eal_contigmem_init();
+}
+
+static inline int
 rte_eal_contigmem_attach(void)
 {
 	const struct hugepage_info *hpi;
@@ -192,35 +201,11 @@ error:
 	return -1;
 }
 
-
-static int
-rte_eal_memdevice_init(void)
-{
-	struct rte_config *config;
-
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
-		return 0;
-
-	config = rte_eal_get_configuration();
-	config->mem_config->nchannel = internal_config.force_nchannel;
-	config->mem_config->nrank = internal_config.force_nrank;
-
-	return 0;
-}
-
-/* init memory subsystem */
+/*
+ * Wrapper function to attach contigmem.
+ */
 int
-rte_eal_memory_init(void)
+rte_eal_hugepage_attach(void)
 {
-	RTE_LOG(INFO, EAL, "Setting up physically contiguous memory...\n");
-	const int retval = rte_eal_process_type() == RTE_PROC_PRIMARY ?
-			rte_eal_contigmem_init() :
-			rte_eal_contigmem_attach();
-	if (retval < 0)
-		return -1;
-
-	if (internal_config.no_shconf == 0 && rte_eal_memdevice_init() < 0)
-		return -1;
-
-	return 0;
+	return rte_eal_contigmem_attach();
 }
lib/librte_eal/common/eal_common_memory.c +36 -2
index 9a07b1e..10ff0bc 100644
@@ -45,6 +45,7 @@
 #include <rte_log.h>
 
 #include "eal_private.h"
+#include "eal_internal_cfg.h"
 
 /*
  * Return a pointer to a read-only table of struct rte_physmem_desc
@@ -69,7 +70,7 @@ rte_eal_get_physmem_size(void)
 	/* get pointer to global configuration */
 	mcfg = rte_eal_get_configuration()->mem_config;
 
-	for (i=0; i<RTE_MAX_MEMSEG; i++) {
+	for (i = 0; i < RTE_MAX_MEMSEG; i++) {
 		if (mcfg->memseg[i].addr == NULL)
 			break;
 
@@ -89,7 +90,7 @@ rte_dump_physmem_layout(FILE *f)
 	/* get pointer to global configuration */
 	mcfg = rte_eal_get_configuration()->mem_config;
 
-	for (i=0; i<RTE_MAX_MEMSEG; i++) {
+	for (i = 0; i < RTE_MAX_MEMSEG; i++) {
 		if (mcfg->memseg[i].addr == NULL)
 			break;
 
@@ -118,3 +119,36 @@ unsigned rte_memory_get_nrank(void)
 {
 	return rte_eal_get_configuration()->mem_config->nrank;
 }
+
+static int
+rte_eal_memdevice_init(void)
+{
+	struct rte_config *config;
+
+	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
+		return 0;
+
+	config = rte_eal_get_configuration();
+	config->mem_config->nchannel = internal_config.force_nchannel;
+	config->mem_config->nrank = internal_config.force_nrank;
+
+	return 0;
+}
+
+/* init memory subsystem */
+int
+rte_eal_memory_init(void)
+{
+	RTE_LOG(INFO, EAL, "Setting up physically contiguous memory...\n");
+	const int retval = rte_eal_process_type() == RTE_PROC_PRIMARY ?
+			rte_eal_hugepage_init() :
+			rte_eal_hugepage_attach();
+
+	if (retval < 0)
+		return -1;
+
+	if (internal_config.no_shconf == 0 && rte_eal_memdevice_init() < 0)
+		return -1;
+
+	return 0;
+}
lib/librte_eal/common/eal_private.h +18 -2
index 8de4ebb..a51a68e 100644
@@ -334,8 +334,6 @@ void set_tsc_freq(void);
 /**
  * This function sets TSC frequency from sysctl
  * for BSD and from clock for Linux.
- * Is a wrapper function for BSD which will
- * internally call set_tsc_freq_from_sysctl.
  *
  * This function is private to the EAL.
  */
@@ -348,4 +346,22 @@ int set_tsc_freq_from_clock(void);
  */
 void rte_set_tsc_hz(uint64_t tsc_hz);
 
+/**
+ * This function prepares physical memory mapping
+ * i.e. hugepages on Linux and
+ *      contigmem on BSD.
+ *
+ * This function is private to the EAL.
+ */
+int rte_eal_hugepage_init(void);
+
+/**
+ * This function creates memory mapping in secondary
+ * i.e. hugepages on Linux and
+ *      contigmem on BSD.
+ *
+ * This function is private to the EAL.
+ */
+int rte_eal_hugepage_attach(void);
+
 #endif /* _EAL_PRIVATE_H_ */
lib/librte_eal/linuxapp/eal/eal_memory.c +2 -34
index 5f9f92e..c83a2cb 100644
@@ -1030,7 +1030,7 @@ calc_num_pages_per_socket(uint64_t * memory,
  *  6. unmap the first mapping
  *  7. fill memsegs in configuration with contiguous zones
  */
-static int
+int
 rte_eal_hugepage_init(void)
 {
 	struct rte_mem_config *mcfg;
@@ -1368,7 +1368,7 @@ getFileSize(int fd)
  * configuration and finds the hugepages which form that segment, mapping them
  * in order to form a contiguous block in the virtual memory space
  */
-static int
+int
 rte_eal_hugepage_attach(void)
 {
 	const struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
@@ -1529,35 +1529,3 @@ error:
 	return -1;
 }
 
-static int
-rte_eal_memdevice_init(void)
-{
-	struct rte_config *config;
-
-	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
-		return 0;
-
-	config = rte_eal_get_configuration();
-	config->mem_config->nchannel = internal_config.force_nchannel;
-	config->mem_config->nrank = internal_config.force_nrank;
-
-	return 0;
-}
-
-
-/* init memory subsystem */
-int
-rte_eal_memory_init(void)
-{
-	RTE_LOG(INFO, EAL, "Setting up memory...\n");
-	const int retval = rte_eal_process_type() == RTE_PROC_PRIMARY ?
-			rte_eal_hugepage_init() :
-			rte_eal_hugepage_attach();
-	if (retval < 0)
-		return -1;
-
-	if (internal_config.no_shconf == 0 && rte_eal_memdevice_init() < 0)
-		return -1;
-
-	return 0;
-}
Signature · 1 line
1.9.1
author
#8 lore raw

PATCH v7 6/6 Move common functions in eal_pci.c

In reply to a message not in the archive

Changes in v7
Rebase to latest code.

Changes in v6
Split changes due to complexity. v6 includes moving rte_eal_pci_probe_one_driver function and its associated utility functions only.

Changes in v5
Rebase to latest code.
Removed RTE_EXEC_ENV_BSDAPP from earlier changes.

Changes in v4
Move common functions in eal_pci.c to librte_eal/common/ eal_common_pci.c file.

Following functions are moved to eal_common_pci.c file.

void *pci_map_resource(void *requested_addr, const int vfio_fd,

      const char *devname, off_t offset, size_t size);
int pci_addr_comparison(struct rte_pci_addr *addr,
                        struct rte_pci_addr *addr2);
int rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,
                        struct rte_pci_device *dev);

Use RTE_EXEC_ENV_BSDAPP to differentiate minor differences in common function.
Fix checkpatch warnings and errors.

Changes in v3
N/A

Changes in v2
N/A

Changes in v1
N/A

---
 lib/librte_eal/bsdapp/eal/eal_pci.c    | 72 +++++---------------------------
 lib/librte_eal/common/eal_common_pci.c | 72 ++++++++++++++++++++++++++++++++
 lib/librte_eal/common/eal_private.h    | 39 +++++++++++++-----
 lib/librte_eal/linuxapp/eal/eal_pci.c  | 75 +---------------------------------
 4 files changed, 113 insertions(+), 145 deletions(-)
lib/librte_eal/bsdapp/eal/eal_pci.c +11 -61
index 30f0232..f21b5b6 100644
@@ -111,7 +111,7 @@ static struct rte_tailq_elem rte_uio_tailq = {
 EAL_REGISTER_TAILQ(rte_uio_tailq)
 
 /* unbind kernel driver for this device */
-static int
+int
 pci_unbind_kernel_driver(struct rte_pci_device *dev __rte_unused)
 {
 	RTE_LOG(ERR, EAL, "RTE_PCI_DRV_FORCE_UNBIND flag is not implemented "
@@ -274,6 +274,13 @@ pci_uio_map_resource(struct rte_pci_device *dev)
 	return (0);
 }
 
+/* map the PCI resource of a PCI device in virtual memory */
+int
+pci_map_device(struct rte_pci_device *dev)
+{
+	return pci_uio_map_resource(dev);
+}
+
 /* Scan one pci sysfs entry, and fill the devices list from it. */
 static int
 pci_scan_one(int dev_pci_fd, struct pci_conf *conf)
@@ -426,68 +433,11 @@ error:
 }
 
 /*
- * If vendor/device ID match, call the devinit() function of the
- * driver.
+ * This function is a no-op in BSD.
  */
-int
-rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr, struct rte_pci_device *dev)
+void
+pci_config_space_set(struct rte_pci_device *dev __rte_unused)
 {
-	struct rte_pci_id *id_table;
-	int ret;
-
-	for (id_table = dr->id_table ; id_table->vendor_id != 0; id_table++) {
-
-		/* check if device's identifiers match the driver's ones */
-		if (id_table->vendor_id != dev->id.vendor_id &&
-				id_table->vendor_id != PCI_ANY_ID)
-			continue;
-		if (id_table->device_id != dev->id.device_id &&
-				id_table->device_id != PCI_ANY_ID)
-			continue;
-		if (id_table->subsystem_vendor_id != dev->id.subsystem_vendor_id &&
-				id_table->subsystem_vendor_id != PCI_ANY_ID)
-			continue;
-		if (id_table->subsystem_device_id != dev->id.subsystem_device_id &&
-				id_table->subsystem_device_id != PCI_ANY_ID)
-			continue;
-
-		struct rte_pci_addr *loc = &dev->addr;
-
-		RTE_LOG(DEBUG, EAL, "PCI device "PCI_PRI_FMT" on NUMA socket %i\n",
-				loc->domain, loc->bus, loc->devid, loc->function,
-				dev->numa_node);
-
-		RTE_LOG(DEBUG, EAL, "  probe driver: %x:%x %s\n", dev->id.vendor_id,
-				dev->id.device_id, dr->name);
-
-		/* no initialization when blacklisted, return without error */
-		if (dev->devargs != NULL &&
-			dev->devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) {
-
-			RTE_LOG(DEBUG, EAL, "  Device is blacklisted, not initializing\n");
-			return 0;
-		}
-
-		if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
-			/* map resources for devices that use igb_uio */
-			ret = pci_uio_map_resource(dev);
-			if (ret != 0)
-				return ret;
-		} else if (dr->drv_flags & RTE_PCI_DRV_FORCE_UNBIND &&
-		           rte_eal_process_type() == RTE_PROC_PRIMARY) {
-			/* unbind current driver */
-			if (pci_unbind_kernel_driver(dev) < 0)
-				return -1;
-		}
-
-		/* reference driver structure */
-		dev->driver = dr;
-
-		/* call the driver devinit() function */
-		return dr->devinit(dr, dev);
-	}
-	/* return positive value if driver is not found */
-	return 1;
 }
 
 /* Init the PCI EAL subsystem */
lib/librte_eal/common/eal_common_pci.c +72 -0

78 lines not on this page · raw message

lib/librte_eal/common/eal_private.h +28 -11
index a51a68e..6a9d13e 100644
@@ -156,17 +156,6 @@ struct rte_pci_driver;
 struct rte_pci_device;
 
 /**
- * Mmap memory for single PCI device
- *
- * This function is private to EAL.
- *
- * @return
- *   0 on success, negative on error
- */
-int rte_eal_pci_probe_one_driver(struct rte_pci_driver *dr,
-		struct rte_pci_device *dev);
-
-/**
  * Munmap memory for single PCI device
  *
  * This function is private to EAL.
@@ -364,4 +353,32 @@ int rte_eal_hugepage_init(void);
  */
 int rte_eal_hugepage_attach(void);
 
+/**
+ * This function unbinds kernel driver for this device
+ *
+ * This function is private to the EAL.
+ */
+int
+pci_unbind_kernel_driver(struct rte_pci_device *dev);
+
+/**
+ * This function maps resources for devices
+ * that use igb_uio on Linux and it's a
+ * wrapper for pci_uio_map_resource on BSD.
+ *
+ * This function is private to the EAL.
+ */
+int
+pci_map_device(struct rte_pci_device *dev);
+
+/**
+ * This function sets PCIe config space for
+ * high performance.
+ * It's a NO-OP on BSD.
+ *
+ * This function is private to the EAL.
+ */
+void
+pci_config_space_set(struct rte_pci_device *dev);
+
 #endif /* _EAL_PRIVATE_H_ */
lib/librte_eal/linuxapp/eal/eal_pci.c +2 -73

93 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

In reply to a message not in the archive
Quoted 70 lines · Ravi Kerur

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152 ------------------------------
 lib/librte_eal/common/eal_common_thread.c | 147 ++++++++++++++++++++++++++++-
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152 +-----------------------------
 4 files changed, 148 insertions(+), 305 deletions(-)
lib/librte_eal/bsdapp/eal/Makefile +1 -1
index 2357cfa..55971b9 100644
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -9
index 9a03437..5714b8f 100644
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 10 lines
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -7
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without going through the deprecation process.

Regards
Neil

A message that is not in the archive (sent off-list or not yet received): 20150424135114.GA32445-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#11 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 85 lines · Neil Horman
Quoted 30 lines · Ravi Kerur

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 6 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without going through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Thanks
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLCOkKsD92=x4ZaYSfnNh972wFJxLAkVgf5WghuZNbJ1Wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#13 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 87 lines · Ravi Kerur
Quoted 85 lines · Neil Horman
Quoted 30 lines · Ravi Kerur

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 9 lines
Quoted 6 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without going through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Then perhaps you forgot to export the symbol? Its showing up as removed on the ABI checker utility.

Neil

Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): 20150424152200.GB32445-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#15 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 95 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <[email protected]>

Quoted 92 lines · wrote:
Quoted 92 lines · Ravi Kerur
Quoted 30 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 18 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -9
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 10 lines
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -7
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without going through the
deprecation process.

Quoted 9 lines
Quoted 3 lines

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Then perhaps you forgot to export the symbol? Its showing up as removed on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being exported? I have only moved definitions to _common_ files, not sure why it should be exported now. I searched in the current code for RTE_DEFINE_PER_LCORE

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned, test) = 0x12345678; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset);
lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLDhKjtSoU4r7wJwFjKXpmOF1zwJC8+ZTA9jZwgckfGzhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#17 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 126 lines · Ravi Kerur
Quoted 95 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <[email protected]>

Quoted 92 lines · wrote:
Quoted 92 lines · Ravi Kerur
Quoted 30 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 18 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -9
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 10 lines
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -7
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without going through the
deprecation process.

Quoted 9 lines
Quoted 3 lines

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Then perhaps you forgot to export the symbol? Its showing up as removed on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being exported? I have only moved definitions to _common_ files, not sure why it should be exported now. I searched in the current code for RTE_DEFINE_PER_LCORE

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned, test) = 0x12345678; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset);

Quoted 18 lines

lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Its exported in the version map file:
per_lcore__lcore_id;

Neil

A message that is not in the archive (sent off-list or not yet received): 20150424185327.GE32445-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#19 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 144 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]>

Quoted 90 lines · wrote:
Quoted 90 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <[email protected]>

Quoted 86 lines · wrote:
Quoted 86 lines · Ravi Kerur
Quoted 30 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

going

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 10 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being exported? I have only moved definitions to _common_ files, not sure why it should be exported now. I searched in the current code for RTE_DEFINE_PER_LCORE

Quoted 8 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned, test) = 0x12345678; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 20 lines

_cpuset); lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 3 lines
Quoted 3 lines

Thanks
Ravi

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Regards

Quoted 3 lines

Neil

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have it. I compared .map file between "changed code" and the original, they are same for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

dpdk-common-eal-f-4 has all the common code movement changes dpdk-tmp is original code

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/linuxapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/linuxapp/eal/rte_eal_version.map

<No difference>

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/bsdapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/bsdapp/eal/rte_eal_version.map

<No difference>

Thanks,
Ravi

Neil

Quoted 2 lines

A message that is not in the archive (sent off-list or not yet received): CAFb4SLBPzaux+=y+iBSBM=bovC=zSY8HXh4-rGmSHO9J-efA8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#21 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 155 lines · Ravi Kerur
Quoted 144 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]>

Quoted 90 lines · wrote:
Quoted 90 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <[email protected]>

Quoted 86 lines · wrote:
Quoted 86 lines · Ravi Kerur
Quoted 30 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when available. Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD, move entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor differences. Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change. Fix checkpatch warnings.

Quoted 4 lines
---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

going

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and BSD.

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 10 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being exported? I have only moved definitions to _common_ files, not sure why it should be exported now. I searched in the current code for RTE_DEFINE_PER_LCORE

Quoted 8 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned, test) = 0x12345678; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 20 lines

_cpuset); lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t, _cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 3 lines
Quoted 3 lines

Thanks
Ravi

Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Regards

Quoted 3 lines

Neil

Its exported in the version map file:
per_lcore__lcore_id;

Quoted 6 lines

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have it. I compared .map file between "changed code" and the original, they are same for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

I did, and I'm retracting that, because I didn't think to check the ABI compatibility on this. But I ran it throught the ABI checking script this and this error popped out. You should run it as well, its in the scripts directory.

I see in your first patch you removed it and re-added it in the common section. But something about how its building is causing it to not show up as an exported symbol, which is problematic, as other applications are going to want access to it.

It also possible that the ABI checker is throwing a false positive, but either way, it needs to be looked into prior to moving forward with this.

Neil

Quoted 21 lines

dpdk-common-eal-f-4 has all the common code movement changes dpdk-tmp is original code

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/linuxapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/linuxapp/eal/rte_eal_version.map

<No difference>

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/bsdapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/bsdapp/eal/rte_eal_version.map

<No difference>

Thanks,
Ravi

Neil

Quoted 2 lines

A message that is not in the archive (sent off-list or not yet received): 20150424195153.GF32445-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#23 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 193 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <[email protected]>

Quoted 7 lines · wrote:
Quoted 7 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines · wrote:
Quoted 10 lines · Ravi Kerur
Quoted 8 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD,

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 60 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 18 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -9
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 10 lines
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -7
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

Quoted 7 lines
Quoted 7 lines

going

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c to eal_common_thread.c file since it is common to both Linux and

BSD.

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned,

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY; lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned, _socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have

it.

Quoted 1 line

I compared .map file between "changed code" and the original, they are

same

Quoted 4 lines

for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

I did, and I'm retracting that, because I didn't think to check the ABI compatibility on this. But I ran it throught the ABI checking script this and
this error popped out. You should run it as well, its in the scripts directory.

I see in your first patch you removed it and re-added it in the common section.
But something about how its building is causing it to not show up as an exported
symbol, which is problematic, as other applications are going to want access to
it.

Quoted 5 lines

It also possible that the ABI checker is throwing a false positive, but either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions changes for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove unneeded include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common functions in eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my case I see it even before my commit. If you are interested I can unicast you html report file. Please let me know how to proceed.

Quoted 25 lines

Neil

Quoted 6 lines

dpdk-common-eal-f-4 has all the common code movement changes dpdk-tmp is original code

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff
lib/librte_eal/linuxapp/eal/rte_eal_version.map

/home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/linuxapp/eal/rte_eal_version.map

Quoted 15 lines

<No difference>

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/bsdapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/bsdapp/eal/rte_eal_version.map

<No difference>

Thanks,
Ravi

Neil

Quoted 2 lines

A message that is not in the archive (sent off-list or not yet received): CAFb4SLD8nxfCtdQpKkzpA2Ljh2kn2X_g1qarq-9nPbESSKG_NA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#25 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 222 lines · Ravi Kerur
Quoted 197 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]

Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines · wrote:
Quoted 10 lines · Ravi Kerur
Quoted 8 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD,

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both Linux and

BSD.

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned,

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have

it.

Quoted 1 line

I compared .map file between "changed code" and the original, they are

same

Quoted 4 lines

for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

I did, and I'm retracting that, because I didn't think to check the ABI compatibility on this. But I ran it throught the ABI checking script this and
this error popped out. You should run it as well, its in the scripts directory.

I see in your first patch you removed it and re-added it in the common section.
But something about how its building is causing it to not show up as an exported
symbol, which is problematic, as other applications are going to want access to
it.

Quoted 5 lines

It also possible that the ABI checker is throwing a false positive, but either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions changes for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove unneeded include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common functions in eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Quoted 8 lines

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my case I see it even before my commit. If you are interested I can unicast you html report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will take eal.c as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In linuxapp/eal/Makefile if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new _common_ files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long* val ) @@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same way so not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

Quoted 27 lines

Neil

Quoted 24 lines
Quoted 7 lines

dpdk-common-eal-f-4 has all the common code movement changes dpdk-tmp is original code

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff
lib/librte_eal/linuxapp/eal/rte_eal_version.map

/home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/linuxapp/eal/rte_eal_version.map

Quoted 15 lines

<No difference>

#/home/rkerur/dpdk-common-eal-f-4/dpdk# diff lib/librte_eal/bsdapp/eal/rte_eal_version.map /home/rkerur/dpdk-tmp/dpdk/lib/librte_eal/bsdapp/eal/rte_eal_version.map

<No difference>

Thanks,
Ravi

Neil

Quoted 2 lines

A message that is not in the archive (sent off-list or not yet received): CAFb4SLAbjNm01GKJf9-praT5Z4xGA8ncM78TvuPbYpKPLi7Q9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#27 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 258 lines · Ravi Kerur
Quoted 222 lines · Ravi Kerur
Quoted 197 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]

Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines · wrote:
Quoted 10 lines · Ravi Kerur
Quoted 8 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD,

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both Linux and

BSD.

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned,

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have

it.

Quoted 1 line

I compared .map file between "changed code" and the original, they are

same

Quoted 4 lines

for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

I did, and I'm retracting that, because I didn't think to check the ABI compatibility on this. But I ran it throught the ABI checking script this and
this error popped out. You should run it as well, its in the scripts directory.

I see in your first patch you removed it and re-added it in the common section.
But something about how its building is causing it to not show up as an exported
symbol, which is problematic, as other applications are going to want access to
it.

Quoted 5 lines

It also possible that the ABI checker is throwing a false positive, but either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions changes for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove unneeded include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common functions in eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Quoted 8 lines

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my case I see it even before my commit. If you are interested I can unicast you html report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will take eal.c as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In linuxapp/eal/Makefile if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new _common_ files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...

validate-abi reports problem in binary compatibility and source compatiblity

Quoted 9 lines

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long* val ) @@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same way so not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that perhaps in the new version of the code we're not generating ithe same dwarf information out of it. In fact for some reason, I've checked both the build before and after your patch series, and the exported CFLAGS aren't getting passed to the build properly, implying that we're not building all the code in the validator with the -g flag, which the validator need to function properly. I'm looking into that
Neil

A message that is not in the archive (sent off-list or not yet received): 20150425123241.GB26734-0o1r3XBGOEbbgkc5XkKeNuvMHUBZFtU3YPYVAmT7z5s@public.gmane.org

#29 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 268 lines · Neil Horman
Quoted 258 lines · Ravi Kerur
Quoted 222 lines · Ravi Kerur
Quoted 197 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <[email protected]>

Quoted 8 lines · wrote:
Quoted 8 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <[email protected]

Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines · wrote:
Quoted 10 lines · Ravi Kerur
Quoted 8 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c file. Add pthread_setname_np/pthread_set_name_np for Linux/FreeBSD respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Use existing rte_get_systid() in RTE_LOG to print thread_id.

Changes in v5
Rebase to latest code.

Changes in v4
None

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Changes in v3
Changed subject to be more explicit on file name inclusion.

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and BSD,

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 58 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152
+-----------------------------
>  4 files changed, 148 insertions(+), 305 deletions(-)

Review

Quoted 2 lines
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

Review

Quoted 13 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +1 -1
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o := -D_GNU_SOURCE
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) = LCORE_ID_ANY;

NAK, these are exported symbols, you can't remove them without

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from eal_thread.c

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both Linux and

BSD.

Quoted 10 lines
Quoted 10 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing up as

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static RTE_DEFINE_PER_LCORE(unsigned,

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 19 lines
Quoted 19 lines
Quoted 19 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1; lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int, _rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map have

it.

Quoted 1 line

I compared .map file between "changed code" and the original, they are

same

Quoted 4 lines

for both linux and bsd. In fact you had ACK'd v4 version of this patch series and no major changes after that. Please let me know if I missed something.

I did, and I'm retracting that, because I didn't think to check the ABI compatibility on this. But I ran it throught the ABI checking script this and
this error popped out. You should run it as well, its in the scripts directory.

I see in your first patch you removed it and re-added it in the common section.
But something about how its building is causing it to not show up as an exported
symbol, which is problematic, as other applications are going to want access to
it.

Quoted 5 lines

It also possible that the ABI checker is throwing a false positive, but either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions changes for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove unneeded include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common functions in eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Quoted 8 lines

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my case I see it even before my commit. If you are interested I can unicast you html report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will take eal.c as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In linuxapp/eal/Makefile if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new _common_ files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...

validate-abi reports problem in binary compatibility and source compatiblity

Quoted 9 lines

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long* val ) @@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same way so not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

Quoted 10 lines

It could be, yes. Though I'm more inclined to think that perhaps in the new version of the code we're not generating ithe same dwarf information out of it. In fact for some reason, I've checked both the build before and after your patch series, and the exported CFLAGS aren't getting passed to the build properly, implying that we're not building all the code in the validator with the -g flag, which the validator need to function properly. I'm looking into that
Neil

Found the problem, I was stupidly reading the report incorrectly. The problem regarding _lcore_id is a source compatibilty issue (because the symbol moved to a new location), which is irrelevant to us. Its not in any way a binary compat problem, which is what we care about. Sorry for the noise.

I do still have a few concerns about some changed calling conventions with a few other functions, which I'll look into on monday.

Regards
Neil

A message that is not in the archive (sent off-list or not yet received): 20150425130214.GA28043-0o1r3XBGOEbbgkc5XkKeNuvMHUBZFtU3YPYVAmT7z5s@public.gmane.org

author
#31 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 335 lines · Neil Horman
Quoted 11 lines · Neil Horman
Quoted 10 lines · Ravi Kerur
Quoted 8 lines · Ravi Kerur

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <[email protected]

Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi Kerur

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to print

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and

BSD,

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c Makefile changes to reflect file move and name change. Fix checkpatch warnings.

---
 lib/librte_eal/bsdapp/eal/Makefile        |   2 +-
 lib/librte_eal/bsdapp/eal/eal_thread.c    | 152

------------------------------

Quoted 1 line
 lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line
 lib/librte_eal/linuxapp/eal/eal_thread.c  | 152

+-----------------------------

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 3 lines
 4 files changed, 148 insertions(+), 305 deletions(-)
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/Makefile

lib/librte_eal/bsdapp/eal/Makefile CFLAGS_eal_common_log.o :=

Quoted 4 lines

index 2357cfa..55971b9 100644

lib/librte_eal/bsdapp/eal/Makefile +0 -0
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines

Review

Quoted 9 lines
lib/librte_eal/bsdapp/eal/Makefile +1 -1
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
 CFLAGS_eal_hpet.o += -Wno-return-type
 endif
 
(quoted diff) +0 -0

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644

lib/librte_eal/bsdapp/eal/eal_thread.c +0 -15
@@ -35,163 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
 #include "eal_private.h"
 #include "eal_thread.h"
 
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

lib/librte_eal/bsdapp/eal/eal_thread.c line 58

Quoted 1 line
lib/librte_eal/bsdapp/eal/eal_thread.c +0 -1
-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't remove them

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both Linux

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing

up as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the original,

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version of this

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me know if I

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to check the

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI checking

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in the

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in the

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not show up

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are going to

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false positive,

but

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove

unneeded

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can unicast

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will take

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

linuxapp/eal/Makefile

Quoted 17 lines
Quoted 17 lines

if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new _common_ files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 8 lines
Quoted 8 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long* val ) @@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same way

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that perhaps in the

new

Quoted 1 line

version of the code we're not generating ithe same dwarf information out

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and after

your

Quoted 2 lines

patch series, and the exported CFLAGS aren't getting passed to the build properly, implying that we're not building all the code in the validator

with

Quoted 1 line

the -g flag, which the validator need to function properly. I'm looking

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly. The problem
regarding _lcore_id is a source compatibilty issue (because the symbol moved to
a new location), which is irrelevant to us. Its not in any way a binary compat
problem, which is what we care about. Sorry for the noise.

Quoted 5 lines

I do still have a few concerns about some changed calling conventions with a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most of them can be fixed by re-arranging moved code in _common_ files and order of compilation.

Thanks,
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLDv34X6EBj7=ssn4C0PJfmG2_0d0fkPpohyyB3cAFvOPg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#33 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 337 lines · Ravi Kerur
Quoted 335 lines · Neil Horman
Quoted 11 lines · Neil Horman
Quoted 10 lines · Ravi Kerur
Quoted 8 lines · Ravi Kerur

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <[email protected]

Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi Kerur

Quoted 6 lines · wrote:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print thread_id.

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from eal_common_thread.c

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG when

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to print

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux and

BSD,

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 8 lines

Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name change.
Fix checkpatch warnings.

Signed-off-by: Ravi Kerur <[email protected]>
---
lib/librte_eal/bsdapp/eal/Makefile | 2 +-
lib/librte_eal/bsdapp/eal/eal_thread.c | 152

------------------------------

Quoted 1 line

lib/librte_eal/common/eal_common_thread.c | 147

++++++++++++++++++++++++++++-

Quoted 1 line

lib/librte_eal/linuxapp/eal/eal_thread.c | 152

+-----------------------------

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

4 files changed, 148 insertions(+), 305 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/Makefile

b/lib/librte_eal/bsdapp/eal/Makefile

Quoted 4 lines

index 2357cfa..55971b9 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 37 lines
Quoted 9 lines

# workaround for a gcc bug with noreturn attribute
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
CFLAGS_eal_hpet.o += -Wno-return-type
endif

diff --git a/lib/librte_eal/bsdapp/eal/eal_thread.c

b/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 27 lines

index 9a03437..5714b8f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_thread.c
+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c
@@ -35,163 +35,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
#include <sys/thr.h>

-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
#include "eal_private.h"
#include "eal_thread.h"

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't remove them

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both Linux

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its showing

up as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is being

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure why it

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE * app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd rte_eal_version.map

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the original,

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version of this

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me know if I

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to check the

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI checking

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in the

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in the

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not show up

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are going to

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false positive,

but

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

either
way, it needs to be looked into prior to moving forward with this.

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove

unneeded

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes for commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so shows removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can unicast

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will take

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

linuxapp/eal/Makefile

Quoted 17 lines
Quoted 17 lines

if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new _common_ files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 8 lines
Quoted 8 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long* val ) @@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same way

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that perhaps in the

new

Quoted 1 line

version of the code we're not generating ithe same dwarf information out

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and after

your

Quoted 2 lines

patch series, and the exported CFLAGS aren't getting passed to the build properly, implying that we're not building all the code in the validator

with

Quoted 1 line

the -g flag, which the validator need to function properly. I'm looking

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly. The problem
regarding _lcore_id is a source compatibilty issue (because the symbol moved to
a new location), which is irrelevant to us. Its not in any way a binary compat
problem, which is what we care about. Sorry for the noise.

Quoted 9 lines
Quoted 5 lines

I do still have a few concerns about some changed calling conventions with a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most of them can be fixed by re-arranging moved code in _common_ files and order of compilation.

If moving the order of compliation around fixes the problem, then I am reasonably convinced that it is, if not a false positive, a minor issue with the compilers dwarf information (The compiler just can't sanely change the location in which parameters are passed). If you make those changes, I'll ACK them, and look into whats going on with the calling conventions

Thanks!
Neil

Quoted 7 lines

Thanks,
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): 20150427134435.GD17179-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#35 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 390 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Sat, Apr 25, 2015 at 6:02 AM, Neil Horman <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Neil Horman
Quoted 2 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 2:24 PM, Ravi Kerur <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <

[email protected]

Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Fri, Apr 24, 2015 at 08:14:04AM -0700, Ravi Kerur

Quoted 9 lines · wrote:
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi Kerur

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print

thread_id.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from

eal_common_thread.c

Quoted 4 lines
Quoted 4 lines

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG

when

Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to print

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name

Quoted 7 lines
Quoted 7 lines

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux

and

Quoted 7 lines
Quoted 7 lines

BSD,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name

change.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Fix checkpatch warnings.

Signed-off-by: Ravi Kerur <[email protected]>
---
lib/librte_eal/bsdapp/eal/Makefile | 2

+-
> > > > >> > > > > > > >  lib/librte_eal/bsdapp/eal/eal_thread.c    | 152
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

------------------------------
lib/librte_eal/common/eal_common_thread.c | 147
++++++++++++++++++++++++++++-
lib/librte_eal/linuxapp/eal/eal_thread.c | 152
+-----------------------------
4 files changed, 148 insertions(+), 305

deletions(-)

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

diff --git a/lib/librte_eal/bsdapp/eal/Makefile
b/lib/librte_eal/bsdapp/eal/Makefile
index 2357cfa..55971b9 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

# workaround for a gcc bug with noreturn

attribute

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

#

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
CFLAGS_eal_hpet.o += -Wno-return-type
endif

diff --git

a/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines

b/lib/librte_eal/bsdapp/eal/eal_thread.c
index 9a03437..5714b8f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_thread.c
+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c
@@ -35,163 +35,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
#include <sys/thr.h>

-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
#include "eal_private.h"
#include "eal_thread.h"

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't remove

them

Quoted 10 lines
Quoted 10 lines

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both

Linux

Quoted 4 lines
Quoted 4 lines

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its

showing

Quoted 9 lines
Quoted 9 lines

up as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is

being

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure

why it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE

*

Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

Quoted 6 lines
Quoted 6 lines

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 20 lines
Quoted 20 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards

Quoted 3 lines

Neil

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd

rte_eal_version.map

Quoted 6 lines
Quoted 6 lines

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the original,

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version of

this

Quoted 2 lines
Quoted 2 lines

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me know if

I

Quoted 4 lines
Quoted 4 lines

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to check

the

Quoted 5 lines
Quoted 5 lines

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI checking

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in the

Quoted 8 lines
Quoted 8 lines

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in the

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not show

up

Quoted 8 lines
Quoted 8 lines

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are going to

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false

positive,

Quoted 3 lines
Quoted 3 lines

but

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

either
way, it needs to be looked into prior to moving forward with

this.

Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove

unneeded

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes

for

Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so

shows

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can unicast

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will

take

Quoted 8 lines
Quoted 8 lines

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

linuxapp/eal/Makefile

Quoted 2 lines
Quoted 2 lines

if I compile new files right after eal.c as shown below

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new

_common_

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long*

val )

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

@@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same

way

Quoted 6 lines
Quoted 6 lines

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that perhaps in

the

Quoted 2 lines
Quoted 2 lines

new

Quoted 1 line

version of the code we're not generating ithe same dwarf information

out

Quoted 4 lines
Quoted 4 lines

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and after

your

Quoted 1 line

patch series, and the exported CFLAGS aren't getting passed to the

build

Quoted 1 line
Quoted 1 line
Quoted 1 line

properly, implying that we're not building all the code in the

validator

Quoted 2 lines
Quoted 2 lines

with

Quoted 1 line

the -g flag, which the validator need to function properly. I'm

looking

Quoted 10 lines
Quoted 10 lines

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly. The problem
regarding _lcore_id is a source compatibilty issue (because the symbol moved to
a new location), which is irrelevant to us. Its not in any way a

binary

Quoted 4 lines
Quoted 4 lines

compat
problem, which is what we care about. Sorry for the noise.

I do still have a few concerns about some changed calling conventions

with

Quoted 5 lines
Quoted 4 lines

a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most of

them

Quoted 3 lines

can be fixed by re-arranging moved code in _common_ files and order of compilation.

Quoted 9 lines

If moving the order of compliation around fixes the problem, then I am reasonably convinced that it is, if not a false positive, a minor issue with the
compilers dwarf information (The compiler just can't sanely change the location
in which parameters are passed). If you make those changes, I'll ACK them, and
look into whats going on with the calling conventions

Issues like the one shown below are taken care by reordering the code compilation.

eal_parse_sysfs_value ( char const* filename, unsigned long* val )

Change
The parameter filename became passed on stack instead of rdi register

Effect
Violation of the calling convention. This may result in crash or incorrect behavior of applications.

Last one that is left out is in

rte_thread_set_affinity ( rte_cpuset_t* p1 )

Change
The parameter *p1* became passed in *rdi* register instead of stack.

Effect
Violation of the calling convention. This may result in crash or incorrect behavior of applications.

After checking abi-0.99.pdf (x86-64.org) looks like for "rte_thread_set_affinity" new code is doing the right thing by passing the parameter in "rdi" register since pointer is classified as "integer_class". Nothing needs to be fixed here. After you confirm that warning can be ignored I will work on sending new revision.

Thanks,
Ravi

Quoted 11 lines

Thanks!
Neil

Quoted 7 lines

Thanks,
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLAVdYMGsxTZSUxqN2coikFDRS_aCSStR0mNUAMK41eWsA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#37 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 425 lines · Ravi Kerur
Quoted 390 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Sat, Apr 25, 2015 at 6:02 AM, Neil Horman <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Neil Horman
Quoted 2 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 2:24 PM, Ravi Kerur <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <

[email protected]

Quoted 15 lines
Quoted 15 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Fri, Apr 24, 2015 at 08:14:04AM -0700, Ravi Kerur

Quoted 9 lines · wrote:
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi Kerur

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print

thread_id.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from

eal_common_thread.c

Quoted 4 lines
Quoted 4 lines

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG

when

Quoted 12 lines
Quoted 12 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to print

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file name

Quoted 7 lines
Quoted 7 lines

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between Linux

and

Quoted 7 lines
Quoted 7 lines

BSD,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on minor

differences.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name

change.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Fix checkpatch warnings.

Signed-off-by: Ravi Kerur <[email protected]>
---
lib/librte_eal/bsdapp/eal/Makefile | 2

+-
> > > > >> > > > > > > >  lib/librte_eal/bsdapp/eal/eal_thread.c    | 152
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

------------------------------
lib/librte_eal/common/eal_common_thread.c | 147
++++++++++++++++++++++++++++-
lib/librte_eal/linuxapp/eal/eal_thread.c | 152
+-----------------------------
4 files changed, 148 insertions(+), 305

deletions(-)

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

diff --git a/lib/librte_eal/bsdapp/eal/Makefile
b/lib/librte_eal/bsdapp/eal/Makefile
index 2357cfa..55971b9 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

# workaround for a gcc bug with noreturn

attribute

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

#

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o += -Wno-return-type
CFLAGS_eal_hpet.o += -Wno-return-type
endif

diff --git

a/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines

b/lib/librte_eal/bsdapp/eal/eal_thread.c
index 9a03437..5714b8f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_thread.c
+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c
@@ -35,163 +35,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
#include <sys/thr.h>

-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
#include "eal_private.h"
#include "eal_thread.h"

Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't remove

them

Quoted 10 lines
Quoted 10 lines

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to both

Linux

Quoted 4 lines
Quoted 4 lines

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line

Then perhaps you forgot to export the symbol? Its

showing

Quoted 9 lines
Quoted 9 lines

up as

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

removed

Quoted 7 lines
Quoted 5 lines

on the
ABI checker utility.

Neil

Can you please show me in the current code where it is

being

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not sure

why it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir RTE_DEFINE_PER_LCORE

*

Quoted 10 lines
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

Quoted 6 lines
Quoted 6 lines

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 20 lines
Quoted 20 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines
Quoted 7 lines

Thanks
Ravi

Regards
Neil

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Its exported in the version map file:
per_lcore__lcore_id;

Thanks Neil, I checked and both linux and bsd

rte_eal_version.map

Quoted 6 lines
Quoted 6 lines

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the original,

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version of

this

Quoted 2 lines
Quoted 2 lines

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me know if

I

Quoted 4 lines
Quoted 4 lines

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to check

the

Quoted 5 lines
Quoted 5 lines

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI checking

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in the

Quoted 8 lines
Quoted 8 lines

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in the

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not show

up

Quoted 8 lines
Quoted 8 lines

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are going to

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false

positive,

Quoted 3 lines
Quoted 3 lines

but

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

either
way, it needs to be looked into prior to moving forward with

this.

Quoted 11 lines
Quoted 11 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common functions

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net: remove

unneeded

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions changes

for

Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

eal_pci.c)

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for librte_eal.so

shows

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and in my

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can unicast

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I will

take

Quoted 8 lines
Quoted 8 lines

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

linuxapp/eal/Makefile

Quoted 2 lines
Quoted 2 lines

if I compile new files right after eal.c as shown below

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_proc_type.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_app_usage.c
...

validate-abi results matches baseline. Instead if i place new

_common_

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned long*

val )

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

@@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled same

way

Quoted 6 lines
Quoted 6 lines

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that perhaps in

the

Quoted 2 lines
Quoted 2 lines

new

Quoted 1 line

version of the code we're not generating ithe same dwarf information

out

Quoted 4 lines
Quoted 4 lines

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and after

your

Quoted 1 line

patch series, and the exported CFLAGS aren't getting passed to the

build

Quoted 1 line
Quoted 1 line
Quoted 1 line

properly, implying that we're not building all the code in the

validator

Quoted 2 lines
Quoted 2 lines

with

Quoted 1 line

the -g flag, which the validator need to function properly. I'm

looking

Quoted 10 lines
Quoted 10 lines

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly. The problem
regarding _lcore_id is a source compatibilty issue (because the symbol moved to
a new location), which is irrelevant to us. Its not in any way a

binary

Quoted 4 lines
Quoted 4 lines

compat
problem, which is what we care about. Sorry for the noise.

I do still have a few concerns about some changed calling conventions

with

Quoted 5 lines
Quoted 4 lines

a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most of

them

Quoted 3 lines

can be fixed by re-arranging moved code in _common_ files and order of compilation.

Quoted 9 lines

If moving the order of compliation around fixes the problem, then I am reasonably convinced that it is, if not a false positive, a minor issue with the
compilers dwarf information (The compiler just can't sanely change the location
in which parameters are passed). If you make those changes, I'll ACK them, and
look into whats going on with the calling conventions

Issues like the one shown below are taken care by reordering the code compilation.

eal_parse_sysfs_value ( char const* filename, unsigned long* val )

Change
The parameter filename became passed on stack instead of rdi register

Effect
Violation of the calling convention. This may result in crash or incorrect behavior of applications.

Last one that is left out is in

rte_thread_set_affinity ( rte_cpuset_t* p1 )

Change
The parameter *p1* became passed in *rdi* register instead of stack.

Effect
Violation of the calling convention. This may result in crash or incorrect behavior of applications.

Quoted 6 lines

After checking abi-0.99.pdf (x86-64.org) looks like for "rte_thread_set_affinity" new code is doing the right thing by passing the parameter in "rdi" register since pointer is classified as "integer_class". Nothing needs to be fixed here. After you confirm that warning can be ignored I will work on sending new revision.

ACK then, send the new revision, this appears to be a false positive.

Thanks for taking the time to confirm.

Best
Neil

Quoted 15 lines

Thanks,
Ravi

Quoted 11 lines

Thanks!
Neil

Quoted 7 lines

Thanks,
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): 20150428193516.GB26098-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#39 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 483 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Mon, Apr 27, 2015 at 6:44 AM, Neil Horman <[email protected]>

Quoted 23 lines · wrote:
Quoted 23 lines · Ravi Kerur
Quoted 1 line

On Sat, Apr 25, 2015 at 6:02 AM, Neil Horman <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Neil Horman
Quoted 2 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 2:24 PM, Ravi Kerur <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Fri, Apr 24, 2015 at 09:45:24AM -0700, Ravi Kerur

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 08:14:04AM -0700, Ravi Kerur

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

wrote:

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi

Kerur

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print

thread_id.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from

Quoted 8 lines
Quoted 8 lines

eal_common_thread.c

Quoted 4 lines
Quoted 4 lines

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG

when

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to

print

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file

name

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between

Linux

Quoted 5 lines
Quoted 5 lines

and

Quoted 4 lines
Quoted 4 lines

BSD,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on

minor

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

differences.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name

change.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Fix checkpatch warnings.

Signed-off-by: Ravi Kerur <[email protected]>
---
lib/librte_eal/bsdapp/eal/Makefile |

2

Quoted 2 lines
Quoted 2 lines
+-
> > > > >> > > > > > > >  lib/librte_eal/bsdapp/eal/eal_thread.c    |

152

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

------------------------------
lib/librte_eal/common/eal_common_thread.c |

147

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

++++++++++++++++++++++++++++-
lib/librte_eal/linuxapp/eal/eal_thread.c |

152

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+-----------------------------
4 files changed, 148 insertions(+), 305

deletions(-)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

diff --git

a/lib/librte_eal/bsdapp/eal/Makefile

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

b/lib/librte_eal/bsdapp/eal/Makefile
index 2357cfa..55971b9 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

# workaround for a gcc bug with noreturn

attribute

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

#

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o +=

-Wno-return-type

Quoted 33 lines
Quoted 33 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

CFLAGS_eal_hpet.o += -Wno-return-type
endif

diff --git

a/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines

b/lib/librte_eal/bsdapp/eal/eal_thread.c
index 9a03437..5714b8f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_thread.c
+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c
@@ -35,163 +35,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
#include <sys/thr.h>

-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
#include "eal_private.h"
#include "eal_thread.h"

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't

remove

Quoted 11 lines
Quoted 11 lines

them

Quoted 10 lines
Quoted 10 lines

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines
Quoted 5 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to

both

Quoted 11 lines
Quoted 11 lines

Linux

Quoted 4 lines
Quoted 4 lines

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Then perhaps you forgot to export the symbol? Its

showing

Quoted 5 lines
Quoted 5 lines

up as

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

removed

Quoted 3 lines
Quoted 3 lines

on the
ABI checker utility.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Neil

Can you please show me in the current code where it is

being

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not

sure

Quoted 6 lines
Quoted 6 lines

why it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir

RTE_DEFINE_PER_LCORE

Quoted 8 lines
Quoted 8 lines

*

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset); lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Quoted 8 lines

Thanks
Ravi

Regards
Neil

Its exported in the version map file:
per_lcore__lcore_id;

Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Thanks Neil, I checked and both linux and bsd

rte_eal_version.map

Quoted 3 lines
Quoted 3 lines

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the

original,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version

of

Quoted 3 lines
Quoted 3 lines

this

Quoted 2 lines
Quoted 2 lines

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me

know if

Quoted 5 lines
Quoted 5 lines

I

Quoted 4 lines
Quoted 4 lines

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to

check

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI

checking

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in

the

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in

the

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not

show

Quoted 4 lines
Quoted 4 lines

up

Quoted 3 lines
Quoted 3 lines

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are

going to

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false

positive,

Quoted 1 line
Quoted 1 line

but

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

either
way, it needs to be looked into prior to moving forward with

this.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common

functions

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net:

remove

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

unneeded

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions

changes

Quoted 5 lines
Quoted 5 lines

for

Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

eal_pci.c)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for

librte_eal.so

Quoted 4 lines
Quoted 4 lines

shows

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and

in my

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can

unicast

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I

will

Quoted 6 lines
Quoted 6 lines

take

Quoted 5 lines
Quoted 5 lines

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

linuxapp/eal/Makefile

Quoted 6 lines
Quoted 6 lines

if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) +=

eal_common_proc_type.c

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) +=

eal_common_app_usage.c

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

...

validate-abi results matches baseline. Instead if i place new

_common_

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned

long*

Quoted 4 lines
Quoted 4 lines

val )

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

@@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled

same

Quoted 7 lines
Quoted 7 lines

way

Quoted 6 lines
Quoted 6 lines

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that

perhaps in

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

new

Quoted 1 line

version of the code we're not generating ithe same dwarf

information

Quoted 3 lines
Quoted 3 lines

out

Quoted 2 lines
Quoted 2 lines

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and

after

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

your

Quoted 1 line

patch series, and the exported CFLAGS aren't getting passed to

the

Quoted 4 lines
Quoted 4 lines

build

Quoted 1 line
Quoted 1 line
Quoted 1 line

properly, implying that we're not building all the code in the

validator

Quoted 1 line
Quoted 1 line

with

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

the -g flag, which the validator need to function properly. I'm

looking

Quoted 6 lines
Quoted 6 lines

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly.

The

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

problem
regarding _lcore_id is a source compatibilty issue (because the

symbol

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

moved to
a new location), which is irrelevant to us. Its not in any way a

binary

Quoted 4 lines
Quoted 4 lines

compat
problem, which is what we care about. Sorry for the noise.

I do still have a few concerns about some changed calling

conventions

Quoted 6 lines
Quoted 6 lines

with

Quoted 5 lines
Quoted 4 lines

a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most

of

Quoted 2 lines
Quoted 2 lines

them

Quoted 1 line

can be fixed by re-arranging moved code in _common_ files and order

of

Quoted 15 lines
Quoted 11 lines
Quoted 2 lines

compilation.

If moving the order of compliation around fixes the problem, then I am reasonably convinced that it is, if not a false positive, a minor issue with the
compilers dwarf information (The compiler just can't sanely change the location
in which parameters are passed). If you make those changes, I'll ACK them, and
look into whats going on with the calling conventions

Issues like the one shown below are taken care by reordering the code compilation.

Quoted 7 lines

eal_parse_sysfs_value ( char const* filename, unsigned long* val )

Change
The parameter filename became passed on stack instead of rdi register

Effect
Violation of the calling convention. This may result in crash or

incorrect

Quoted 11 lines

behavior of applications.

Last one that is left out is in

rte_thread_set_affinity ( rte_cpuset_t* p1 )

Change
The parameter *p1* became passed in *rdi* register instead of stack.

Effect
Violation of the calling convention. This may result in crash or

incorrect

Quoted 4 lines

behavior of applications.

After checking abi-0.99.pdf (x86-64.org) looks like for "rte_thread_set_affinity" new code is doing the right thing by passing

the

Quoted 9 lines
Quoted 1 line

parameter in "rdi" register since pointer is classified as

"integer_class".

Quoted 3 lines

Nothing needs to be fixed here. After you confirm that warning can be ignored I will work on sending new revision.

ACK then, send the new revision, this appears to be a false positive.

Thanks for taking the time to confirm.

Thanks Neil. I have sent v8 which fixes ABI warnings. I have tested it with x86_64-native-linuxapp-gcc, x86_64-native-linuxapp-clang and x86_64-ivshmem-gcc targets. ABI results look fine to me.

I tried to run validate-abi.sh on BSD but ran into errors. If there is a way to check against BSD please let me know.

Quoted 20 lines

Best
Neil

Quoted 15 lines

Thanks,
Ravi

Quoted 11 lines

Thanks!
Neil

Quoted 7 lines

Thanks,
Ravi

Regards

Quoted 3 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLA0F9B9ZNh_tGZj1_Zk1DAGKjvB-icmDJqdWJ4Ph-buww-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#41 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 495 lines · Ravi Kerur
Quoted 483 lines · Neil Horman
Quoted 1 line · Ravi Kerur

On Mon, Apr 27, 2015 at 6:44 AM, Neil Horman <[email protected]>

Quoted 23 lines · wrote:
Quoted 23 lines · Ravi Kerur
Quoted 1 line

On Sat, Apr 25, 2015 at 6:02 AM, Neil Horman <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines · Neil Horman
Quoted 2 lines · Ravi Kerur
Quoted 1 line

On Fri, Apr 24, 2015 at 2:24 PM, Ravi Kerur <[email protected]>

Quoted 4 lines · wrote:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

On Fri, Apr 24, 2015 at 12:51 PM, Neil Horman <

[email protected]

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines · wrote:
Quoted 1 line · Ravi Kerur

On Fri, Apr 24, 2015 at 11:53 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines · wrote:
Quoted 2 lines

On Fri, Apr 24, 2015 at 09:45:24AM -0700, Ravi Kerur

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 8:22 AM, Neil Horman <

[email protected]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line · wrote:
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 08:14:04AM -0700, Ravi Kerur

Quoted 5 lines · wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

On Fri, Apr 24, 2015 at 6:51 AM, Neil Horman <

[email protected]>

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

wrote:

On Thu, Apr 23, 2015 at 02:35:31PM -0700, Ravi

Kerur

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v7
Remove _setname_ pthread calls.
Use rte_gettid() API in RTE_LOG to print

thread_id.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Changes in v6
Remove RTE_EXEC_ENV_BSDAPP from

Quoted 8 lines
Quoted 8 lines

eal_common_thread.c

Quoted 4 lines
Quoted 4 lines

file.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Add pthread_setname_np/pthread_set_name_np for

Linux/FreeBSD

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

respectively. Plan to use _getname_ in RTE_LOG

when

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

available.

Quoted 1 line
Quoted 1 line
Quoted 1 line

Use existing rte_get_systid() in RTE_LOG to

print

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

thread_id.

Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines

Changes in v5
Rebase to latest code.

Changes in v4
None

Changes in v3
Changed subject to be more explicit on file

name

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

inclusion.

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Changes in v2
None

Changes in v1
eal_thread.c has minor differences between

Linux

Quoted 5 lines
Quoted 5 lines

and

Quoted 4 lines
Quoted 4 lines

BSD,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

move

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

entire file into common directory.
Use RTE_EXEC_ENV_BSDAPP to differentiate on

minor

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

differences.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Rename eal_thread.c to eal_common_thread.c
Makefile changes to reflect file move and name

change.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

Fix checkpatch warnings.

Signed-off-by: Ravi Kerur <[email protected]>
---
lib/librte_eal/bsdapp/eal/Makefile |

2

Quoted 2 lines
Quoted 2 lines
+-
> > > > >> > > > > > > >  lib/librte_eal/bsdapp/eal/eal_thread.c    |

152

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

------------------------------
lib/librte_eal/common/eal_common_thread.c |

147

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

++++++++++++++++++++++++++++-
lib/librte_eal/linuxapp/eal/eal_thread.c |

152

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

+-----------------------------
4 files changed, 148 insertions(+), 305

deletions(-)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

diff --git

a/lib/librte_eal/bsdapp/eal/Makefile

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

b/lib/librte_eal/bsdapp/eal/Makefile
index 2357cfa..55971b9 100644
--- a/lib/librte_eal/bsdapp/eal/Makefile
+++ b/lib/librte_eal/bsdapp/eal/Makefile
@@ -87,7 +87,7 @@ CFLAGS_eal_common_log.o :=

-D_GNU_SOURCE

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

# workaround for a gcc bug with noreturn

attribute

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

#

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_eal_thread.o += -Wno-return-type
+CFLAGS_eal_common_thread.o +=

-Wno-return-type

Quoted 33 lines
Quoted 33 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

CFLAGS_eal_hpet.o += -Wno-return-type
endif

diff --git

a/lib/librte_eal/bsdapp/eal/eal_thread.c

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines

b/lib/librte_eal/bsdapp/eal/eal_thread.c
index 9a03437..5714b8f 100644
--- a/lib/librte_eal/bsdapp/eal/eal_thread.c
+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c
@@ -35,163 +35,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <unistd.h>
-#include <sched.h>
-#include <pthread_np.h>
-#include <sys/queue.h>
#include <sys/thr.h>

-#include <rte_debug.h>
-#include <rte_atomic.h>
-#include <rte_launch.h>
-#include <rte_log.h>
-#include <rte_memory.h>
-#include <rte_memzone.h>
-#include <rte_per_lcore.h>
-#include <rte_eal.h>
-#include <rte_per_lcore.h>
-#include <rte_lcore.h>
-
#include "eal_private.h"
#include "eal_thread.h"

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

-RTE_DEFINE_PER_LCORE(unsigned, _lcore_id) =

LCORE_ID_ANY;

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

NAK, these are exported symbols, you can't

remove

Quoted 11 lines
Quoted 11 lines

them

Quoted 10 lines
Quoted 10 lines

without

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

going

Quoted 5 lines

through the
deprecation process.

They are not removed/deleted, they are moved from

eal_thread.c

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to

Quoted 1 line
Quoted 1 line
Quoted 1 line

eal_common_thread.c file since it is common to

both

Quoted 11 lines
Quoted 11 lines

Linux

Quoted 4 lines
Quoted 4 lines

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

BSD.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Then perhaps you forgot to export the symbol? Its

showing

Quoted 5 lines
Quoted 5 lines

up as

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

removed

Quoted 3 lines

on the
ABI checker utility.

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Neil

Can you please show me in the current code where it is

being

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported? I

Quoted 1 line
Quoted 1 line
Quoted 1 line

have only moved definitions to _common_ files, not

sure

Quoted 6 lines
Quoted 6 lines

why it

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

should be

Quoted 1 line
Quoted 1 line
Quoted 1 line

exported now. I searched in the current code for

RTE_DEFINE_PER_LCORE

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

#home/rkerur/dpdk-tmp/dpdk# grep -ir

RTE_DEFINE_PER_LCORE

Quoted 8 lines
Quoted 8 lines

*

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

app/test/test_per_lcore.c:static

RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

test) =

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x12345678;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/linuxapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_cpuset);

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_lcore_id) = LCORE_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(unsigned,

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

_socket_id) = (unsigned)SOCKET_ID_ANY;

lib/librte_eal/bsdapp/eal/eal_thread.c:RTE_DEFINE_PER_LCORE(rte_cpuset_t,

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

_cpuset);
lib/librte_eal/common/include/rte_per_lcore.h:#define
RTE_DEFINE_PER_LCORE(type, name) \
lib/librte_eal/common/include/rte_eal.h: static
RTE_DEFINE_PER_LCORE(int, _thread_id) = -1;

lib/librte_eal/common/eal_common_errno.c:RTE_DEFINE_PER_LCORE(int,

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 13 lines

_rte_errno);
lib/librte_eal/common/eal_common_errno.c: static
RTE_DEFINE_PER_LCORE(char[RETVAL_SZ], retval);

Thanks
Ravi

Regards
Neil

Its exported in the version map file:
per_lcore__lcore_id;

Quoted 5 lines
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Thanks Neil, I checked and both linux and bsd

rte_eal_version.map

Quoted 3 lines
Quoted 3 lines

have

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

it.

Quoted 1 line

I compared .map file between "changed code" and the

original,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

they are

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

same

Quoted 1 line

for both linux and bsd. In fact you had ACK'd v4 version

of

Quoted 3 lines
Quoted 3 lines

this

Quoted 2 lines
Quoted 2 lines

patch

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

series and no major changes after that. Please let me

know if

Quoted 5 lines
Quoted 5 lines

I

Quoted 4 lines
Quoted 4 lines

missed

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

something.

I did, and I'm retracting that, because I didn't think to

check

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

ABI

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

compatibility on this. But I ran it throught the ABI

checking

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

script

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

this and
this error popped out. You should run it as well, its in

the

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

scripts

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

directory.

I see in your first patch you removed it and re-added it in

the

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

common

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

section.
But something about how its building is causing it to not

show

Quoted 4 lines
Quoted 4 lines

up

Quoted 3 lines
Quoted 3 lines

as an

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

exported
symbol, which is problematic, as other applications are

going to

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

want

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

access to
it.

It also possible that the ABI checker is throwing a false

positive,

Quoted 1 line
Quoted 1 line

but

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

either
way, it needs to be looked into prior to moving forward with

this.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines

I did following things.

Put a tag (v2.0.0-before-common-eal) before EAL common

functions

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

changes

Quoted 1 line
Quoted 1 line
Quoted 1 line

for commit (3c0c807038ad642f4be7deb9370293c39d12f029 net:

remove

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

unneeded

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

include)

Put a tag (v2.0.0-common-eal) after EAL common functions

changes

Quoted 5 lines
Quoted 5 lines

for

Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

commit (25737e5a7212630a7b5d8ca756860a062f403789 Move common

functions in

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

eal_pci.c)

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Ran validate-abi against x86_64-native-linuxapp-gcc and

v2.0.0-rc3 and v2.0.0-before-common-eal, html report for

librte_eal.so

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

shows removed symbols for "per_lcore__cpuset"

v2.0.0-rc3 and v2.0.0-common-eal, html report for

librte_eal.so

Quoted 4 lines
Quoted 4 lines

shows

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

removed symbols for "per_lcore__cpuset"

Removed symbol is different from what you have reported and

in my

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

case I

Quoted 1 line
Quoted 1 line
Quoted 1 line

see it even before my commit. If you are interested I can

unicast

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

you html

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

report file. Please let me know how to proceed.

I did some experiment and found some interesting things. I

will

Quoted 6 lines
Quoted 6 lines

take

Quoted 5 lines
Quoted 5 lines

eal.c

Quoted 4 lines
Quoted 4 lines

as an example

eal.c is split into eal_common_sysfs.c eal_common_mem_cfg.c eal_common_proc_type.c and eal_common_app_usage.c. In

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

linuxapp/eal/Makefile

Quoted 6 lines
Quoted 6 lines

if I compile new files right after eal.c as shown below

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) := eal.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_sysfs.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_mem_cfg.c SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) +=

eal_common_proc_type.c

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) +=

eal_common_app_usage.c

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

...

validate-abi results matches baseline. Instead if i place new

_common_

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

files in common area in linuxapp/eal/Makefile as shown below

# from common dir
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_memzone.c
SRCS-$(CONFIG_RTE_LIBRTE_EAL_LINUXAPP) += eal_common_log.c
...
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

validate-abi reports problem in binary compatibility and source compatiblity

eal_filesystem.h, librte_eal.so.1
[+] eal_parse_sysfs_value ( char const* filename, unsigned

long*

Quoted 4 lines
Quoted 4 lines

val )

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

@@ DPDK_2.0 (2)

I believe files in common and linuxapp directory are compiled

same

Quoted 7 lines
Quoted 7 lines

way

Quoted 6 lines
Quoted 6 lines

so

Quoted 5 lines
Quoted 4 lines

not sure why placement in makefile makes difference.

Could this be false-positive from validate-abi script??

It could be, yes. Though I'm more inclined to think that

perhaps in

Quoted 3 lines
Quoted 3 lines

the

Quoted 2 lines
Quoted 2 lines

new

Quoted 1 line

version of the code we're not generating ithe same dwarf

information

Quoted 3 lines
Quoted 3 lines

out

Quoted 2 lines
Quoted 2 lines

of it.

Quoted 1 line

In fact for some reason, I've checked both the build before and

after

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

your

Quoted 1 line

patch series, and the exported CFLAGS aren't getting passed to

the

Quoted 4 lines
Quoted 4 lines

build

Quoted 1 line
Quoted 1 line
Quoted 1 line

properly, implying that we're not building all the code in the

validator

Quoted 1 line
Quoted 1 line

with

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

the -g flag, which the validator need to function properly. I'm

looking

Quoted 6 lines
Quoted 6 lines

into

Quoted 4 lines

that
Neil

Found the problem, I was stupidly reading the report incorrectly.

The

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

problem
regarding _lcore_id is a source compatibilty issue (because the

symbol

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines
Quoted 2 lines

moved to
a new location), which is irrelevant to us. Its not in any way a

binary

Quoted 4 lines
Quoted 4 lines

compat
problem, which is what we care about. Sorry for the noise.

I do still have a few concerns about some changed calling

conventions

Quoted 6 lines
Quoted 6 lines

with

Quoted 5 lines
Quoted 4 lines

a few
other functions, which I'll look into on monday.

Please let me know your inputs on changed calling conventions. Most

of

Quoted 2 lines
Quoted 2 lines

them

Quoted 1 line

can be fixed by re-arranging moved code in _common_ files and order

of

Quoted 15 lines
Quoted 11 lines
Quoted 2 lines

compilation.

If moving the order of compliation around fixes the problem, then I am reasonably convinced that it is, if not a false positive, a minor issue with the
compilers dwarf information (The compiler just can't sanely change the location
in which parameters are passed). If you make those changes, I'll ACK them, and
look into whats going on with the calling conventions

Issues like the one shown below are taken care by reordering the code compilation.

Quoted 7 lines

eal_parse_sysfs_value ( char const* filename, unsigned long* val )

Change
The parameter filename became passed on stack instead of rdi register

Effect
Violation of the calling convention. This may result in crash or

incorrect

Quoted 11 lines

behavior of applications.

Last one that is left out is in

rte_thread_set_affinity ( rte_cpuset_t* p1 )

Change
The parameter *p1* became passed in *rdi* register instead of stack.

Effect
Violation of the calling convention. This may result in crash or

incorrect

Quoted 4 lines

behavior of applications.

After checking abi-0.99.pdf (x86-64.org) looks like for "rte_thread_set_affinity" new code is doing the right thing by passing

the

Quoted 9 lines
Quoted 1 line

parameter in "rdi" register since pointer is classified as

"integer_class".

Quoted 3 lines

Nothing needs to be fixed here. After you confirm that warning can be ignored I will work on sending new revision.

ACK then, send the new revision, this appears to be a false positive.

Thanks for taking the time to confirm.

Quoted 7 lines

Thanks Neil. I have sent v8 which fixes ABI warnings. I have tested it with x86_64-native-linuxapp-gcc, x86_64-native-linuxapp-clang and x86_64-ivshmem-gcc targets. ABI results look fine to me.

I tried to run validate-abi.sh on BSD but ran into errors. If there is a way to check against BSD please let me know.

The ABI checker should work on BSD as far as I know, since it only relies on dwarf information in the output binary. What errors are you seeing?

Neil

A message that is not in the archive (sent off-list or not yet received): 20150429100401.GA32154-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#43 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 7 lines
Quoted 3 lines

I tried to run validate-abi.sh on BSD but ran into errors. If there is a way to check against BSD please let me know.

The ABI checker should work on BSD as far as I know, since it only relies on
dwarf information in the output binary. What errors are you seeing?

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # sh ./scripts/validate-abi.sh v2.0.0-rc3 v2.0.0-abi x86_64-native-bsdapp-clang
mktemp: illegal option -- p
usage: mktemp [-d] [-q] [-t prefix] [-u] template ...

       mktemp [-d] [-q] [-u] -t prefix

Cant find abi-compliance-checker utility

abi-compliance-checker is installed as shown below.

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # pkg install devel/abi-compliance-checker
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed

Quoted 4 lines

Neil

A message that is not in the archive (sent off-list or not yet received): CAFb4SLCD4eRMOM75JxBUjkdMBagtTGbFLAHghePzjj27ypNAjA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#45 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 11 lines · Ravi Kerur
Quoted 7 lines
Quoted 3 lines

I tried to run validate-abi.sh on BSD but ran into errors. If there is a way to check against BSD please let me know.

The ABI checker should work on BSD as far as I know, since it only relies on
dwarf information in the output binary. What errors are you seeing?

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # sh ./scripts/validate-abi.sh v2.0.0-rc3 v2.0.0-abi x86_64-native-bsdapp-clang
mktemp: illegal option -- p

Ah, bsd mktemp doesn't support the -p option. I'll see if I can fix that.

Quoted 6 lines

usage: mktemp [-d] [-q] [-t prefix] [-u] template ...

       mktemp [-d] [-q] [-u] -t prefix

Cant find abi-compliance-checker utility

abi-compliance-checker is installed as shown below.

Quoted 8 lines

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # pkg install devel/abi-compliance-checker
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed

Whats the path for abi-compliance checker there? It would seem that the binary isn't in your path, as which isn't locating it.
Neil

Quoted 5 lines
Quoted 5 lines

Neil

A message that is not in the archive (sent off-list or not yet received): 20150430160038.GA5462-B26myB8xz7F8NnZeBjwnZQMhkBWG/[email protected]

author
#47 lore raw

Re: [PATCH v7 1/6] Move common functions in eal_thread.c

Quoted 11 lines · Neil Horman
Quoted 1 line · Ravi Kerur
Quoted 1 line
Quoted 1 line

I tried to run validate-abi.sh on BSD but ran into errors. If there

is a

Quoted 3 lines
Quoted 3 lines
Quoted 2 lines

way to check against BSD please let me know.

The ABI checker should work on BSD as far as I know, since it only

relies

Quoted 4 lines
Quoted 3 lines

on
dwarf information in the output binary. What errors are you seeing?

Quoted 6 lines
Quoted 2 lines

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # sh ./scripts/validate-abi.sh v2.0.0-rc3 v2.0.0-abi

x86_64-native-bsdapp-clang

Quoted 1 line

mktemp: illegal option -- p

Ah, bsd mktemp doesn't support the -p option. I'll see if I can fix that.

I think there are couple of other issues I found

freeBSD sed is different from Linux (GNU sed) and I get following errors with the script

"sed 1 command c expects \ followed by text".

I have to use gsed (GNU sed) in freeBSD to get rid of that error and similarly freeBSD uses gmake instead of make. I have made those minor changes and sending them with this email as an attachment.

Quoted 15 lines
Quoted 6 lines

usage: mktemp [-d] [-q] [-t prefix] [-u] template ...

       mktemp [-d] [-q] [-u] -t prefix

Cant find abi-compliance-checker utility

abi-compliance-checker is installed as shown below.

Quoted 8 lines

dpdk-bsd:/home/rkerur/dpdk-validate-abi-1/dpdk # pkg install devel/abi-compliance-checker
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
Checking integrity... done (0 conflicting)
The most recent version of packages are already installed

Quoted 4 lines

Whats the path for abi-compliance checker there? It would seem that the binary
isn't in your path, as which isn't locating it.

I am using regular freeBSD port install which doesn't install in any /usr/bin or /usr/local/bin. I finally decided to install both abi-dumper and abi-compliance-checker from source, compile and install it in correct directory. Above error is fixed after that, however, abi utilities use "eu-readelf" and I can't find that utility to install in freeBSD. I get following errors

ERROR: can't find "eu-readelf" command

freeBSD has only readelf. Please let me know if there is a way to get rid of this error.

Thanks,
Ravi

Quoted 6 lines
Quoted 5 lines
Quoted 5 lines

Neil