From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EBE6CC5C2 for ; Tue, 23 Jun 2015 13:28:32 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 23 Jun 2015 04:28:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,665,1427785200"; d="scan'208";a="732913030" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by fmsmga001.fm.intel.com with ESMTP; 23 Jun 2015 04:28:31 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.117]) by irsmsx110.ger.corp.intel.com ([163.33.3.25]) with mapi id 14.03.0224.002; Tue, 23 Jun 2015 12:28:29 +0100 From: "Gajdzica, MaciejX T" To: "Gajdzica, MaciejX T" , Neil Horman Thread-Topic: [dpdk-dev] Issue with rte_compat versioning macros Thread-Index: AdCqnQQggYoEH26OSROSj81vK5Rplf//8xYA///qxzCAACGLAP/7QYZAgAmLroD//vbscP/9stsQ Date: Tue, 23 Jun 2015 11:28:29 +0000 Message-ID: <9CC680510C0AC140A846FED2EF7F962813846C6E@IRSMSX102.ger.corp.intel.com> References: <9CC680510C0AC140A846FED2EF7F96281383E81B@IRSMSX102.ger.corp.intel.com> <2048288.aStCxb75UN@xps13> <9CC680510C0AC140A846FED2EF7F96281383E8B5@IRSMSX102.ger.corp.intel.com> <20150619153208.GC4619@hmsreliant.think-freely.org> <9CC680510C0AC140A846FED2EF7F96281384660E@IRSMSX102.ger.corp.intel.com> <20150622165137.GB15581@hmsreliant.think-freely.org> <9CC680510C0AC140A846FED2EF7F9628138469E3@IRSMSX102.ger.corp.intel.com> In-Reply-To: <9CC680510C0AC140A846FED2EF7F9628138469E3@IRSMSX102.ger.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Issue with rte_compat versioning macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2015 11:28:33 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gajdzica, MaciejX T > Sent: Tuesday, June 23, 2015 9:46 AM > To: Neil Horman > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] Issue with rte_compat versioning macros >=20 >=20 >=20 > > -----Original Message----- > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > Sent: Monday, June 22, 2015 6:52 PM > > To: Gajdzica, MaciejX T > > Cc: Thomas Monjalon; dev@dpdk.org > > Subject: Re: [dpdk-dev] Issue with rte_compat versioning macros > > > > On Mon, Jun 22, 2015 at 03:32:01PM +0000, Gajdzica, MaciejX T wrote: > > > Hi Neil > > > > > > > -----Original Message----- > > > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > > > Sent: Friday, June 19, 2015 5:32 PM > > > > To: Gajdzica, MaciejX T > > > > Cc: Thomas Monjalon; dev@dpdk.org > > > > Subject: Re: [dpdk-dev] Issue with rte_compat versioning macros > > > > > > > > On Fri, Jun 19, 2015 at 03:04:17PM +0000, Gajdzica, MaciejX T wrote= : > > > > > > -----Original Message----- > > > > > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > > > > > Sent: Friday, June 19, 2015 4:48 PM > > > > > > To: Gajdzica, MaciejX T > > > > > > Cc: dev@dpdk.org; nhorman@tuxdriver.com > > > > > > Subject: Re: [dpdk-dev] Issue with rte_compat versioning > > > > > > macros > > > > > > > > > > > > 2015-06-19 14:38, Gajdzica, MaciejX T: > > > > > > > There is an issue with macros in rte_compat.h. For shared > > > > > > > library case, macro BIND_DEFAULT_SYMBOL takes three > > > > > > > arguments and for other case it takes only two arguments. > > > > > > > Also letters for macro variable names are > > > > > > not consistent in these two cases. > > > > > > > > > > > > Yes, and your patch fix it: > > > > > > http://dpdk.org/dev/patchwork/patch/5475/ > > > > > > But it is part of a series which is not accepted yet. > > > > > > > > > > > > It would be faster merged if you send it as a standalone patch. > > > > > > Thanks > > > > > > > > > > But simple solution with adding third argument to static library > > > > > case doesn't > > > > work. Comment in rte_compat.h file describes steps needed to add > > > > new version of the function and it says: > > > > > > > > > > * 2) rename the existing function int foo(char *string) to > > > > > * int __vsym foo_v20(char *string) > > > > > * > > > > > * 3) Add this macro immediately below the function > > > > > * VERSION_SYMBOL(foo, _v20, 2.0); > > > > > * > > > > > * 4) Implement a new version of foo. > > > > > * char foo(int value, int otherval) { ...} > > > > > * > > > > > * 5) Mark the newest version as the default version > > > > > * BIND_DEFAULT_SYMBOL(foo, 2.1); > > > > > > > > > > So probably BIND_DEFAULT_SYMBOL macro for shared library case > > > > > needs to > > > > be modified to have two arguments. > > > > > I'm not familiar with that symver syntax so I need some help. It > > > > > would be > > > > better when original author say how it should look like. > > > > > > > > > > Best Regards > > > > > Maciek > > > > > > > > > > > > > > > > > > No adding the third parameter will work just fine. The > > > > documentation needs to be updated as well to reflect the 3rd argume= nt: > > > > * 5) Mark the newest version as the default version > > > > * BIND_DEFAULT_SYMBOL(foo, foo, 2.1); > > > > > > > > > > > > Neil > > > > > > > > > > For me versioning still don't work, even though I try to do it as > > > you say. I had > > function: > > > > > > int > > > rte_cfgfile_section_entries(struct rte_cfgfile *cfg, > > > const char *sectionname, > > > struct rte_cfgfile_entry *entries, > > > int max_entries) > > > { > > > [...] > > > } > > > > > > And I wanted to add new version of it. So I marked it as _v20, added > > > version macro, added new implementation and default symbol macro: > > > > > > int __vsym > > > rte_cfgfile_section_entries_v20(struct rte_cfgfile *cfg, > > > const char *sectionname, > > > struct rte_cfgfile_entry *entries, > > > int max_entries) > > > { > > > [...] > > > } > > > VERSION_SYMBOL(rte_cfgfile_section_entries, _v20, 2.0); > > > > > > int __vsym > > > rte_cfgfile_section_entries(struct rte_cfgfile *cfg, > > > const char *sectionname, struct rte_cfgfile_entry2 **entries, > > > int max_entries) > > > { > > > [...] > > > } > > > BIND_DEFAULT_SYMBOL(rte_cfgfile_section_entries, > > > rte_cfgfile_section_entries, 2.1); > > > > > > I edited map file so it looks like this: > > > > > > DPDK_2.0 { > > > global: > > > > > > [...] > > > rte_cfgfile_section_entries; > > > [...] > > > > > > local: *; > > > }; > > > > > > DPDK_2.1 { > > > global: > > > > > > rte_cfgfile_section_entries; > > > > > > local: *; > > > }; > > > > > > Then I try to build dpdk and qos_sched example which uses this > > > function. When I build dpdk as static library, everything works fine. > > > When I build dpdk as shared library, compilation of example returns > > > error, that > > it doesn't see rte_cfgfile_section_entries function. > > > > > Soooooo.....What are your errors? Complaining that it doesn't work > > doesn't help anyone if you don't tell us whats wrong. > > > > > > > Maybe I do something wrong, but it's obvious that better > > > documentation is needed. In current dpdk master code, versioning is > > > not used. There are only > > 2 patchsets that tries to use it. This one and: > > > http://dpdk.org/ml/archives/dev/2015-May/018169.html > > > That second one probably uses it wrong, because second argument of > > BIND_DEFAULT_SYMBOL is _v21. > > > And you said, it should be the same as function name. I don't need > > > versioning for now as we decided That rte_cfgfile modifications > > > should be done in next release. But knowing that versioning macros > > > are well > > documented and work properly could encourage more people to use it. > > > > > Clearly you did something wrong, because its not building. I agree > > that more documentation is needed, but unless you tell me whats > > broken, enhancing the documentation isn't going to be much more than a > > rock fetch problem Neil >=20 > Here is my qos_sched example build log: >=20 > gcc -m64 -pthread -march=3Dnative -DRTE_MACHINE_CPUFLAG_SSE - > DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSE3 - > DRTE_MACHINE_CPUFLAG_SSSE3 -DRTE_MACHINE_CPUFLAG_SSE4_1 - > DRTE_MACHINE_CPUFLAG_SSE4_2 -DRTE_MACHINE_CPUFLAG_AES - > DRTE_MACHINE_CPUFLAG_PCLMULQDQ -DRTE_MACHINE_CPUFLAG_AVX - > DRTE_MACHINE_CPUFLAG_RDRAND -DRTE_MACHINE_CPUFLAG_FSGSBASE - > DRTE_MACHINE_CPUFLAG_F16C - > DRTE_COMPILE_TIME_CPUFLAGS=3DRTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE > _CPUFLAG_SSE3,RTE_CPUFLAG_SSSE3,RTE_CPUFLAG_SSE4_1,RTE_CPUFLAG_SS > E4_2,RTE_CPUFLAG_AES,RTE_CPUFLAG_PCLMULQDQ,RTE_CPUFLAG_AVX,RTE_ > CPUFLAG_RDRAND,RTE_CPUFLAG_FSGSBASE,RTE_CPUFLAG_F16C - > I/mnt/shared/mtgajdzx/workspace/cmd_patch/examples/qos_sched/build/inclu > de -I/mnt/shared/mtgajdzx/workspace/cmd_patch/x86_64-native-linuxapp- > gcc/include -include /mnt/shared/mtgajdzx/workspace/cmd_patch/x86_64- > native-linuxapp-gcc/include/rte_config.h -O3 -W -Wall -Werror -Wstrict- > prototypes -Wmissing-prototypes -Wmissing-declarations -Wold-style-defini= tion > -Wpointer-arith -Wcast-align -Wnested-externs -Wcast-qual -Wformat- > nonliteral -Wformat-security -Wundef -Wwrite-strings -Wno-missing-field- > initializers -Wno-uninitialized -Wl,-Map=3Dqos_sched.map,--cref -o qos_s= ched > main.o args.o init.o app_thread.o cfg_file.o cmdline.o stats.o -Wl,--no-a= s- > needed -Wl,-export-dynamic - > L/mnt/shared/mtgajdzx/workspace/cmd_patch/examples/qos_sched/build/lib - > L/mnt/shared/mtgajdzx/workspace/cmd_patch/x86_64-native-linuxapp-gcc/lib > -L/mnt/shared/mtgajdzx/workspace/cmd_patch/x86_64-native-linuxapp-gcc/lib > -Wl,--whole-archive -Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_kni= -Wl,- > lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_timer -Wl,-lrte_ha= sh -Wl,- > lrte_jobstats -Wl,-lrte_lpm -Wl,-lrte_power -Wl,-lrte_acl -Wl,-lrte_meter= -Wl,- > lrte_sched -Wl,-lm -Wl,-lrt -Wl,--start-group -Wl,-lrte_kvargs -Wl,-lrte_= mbuf - > Wl,-lrte_ip_frag -Wl,-lethdev -Wl,-lrte_malloc -Wl,-lrte_mempool -Wl,-lrt= e_ring > -Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond -Wl,= -lrt - > Wl,-lm -Wl,-ldl -Wl,--end-group -Wl,--no-whole-archive > cfg_file.o: In function `cfg_load_subport': > /mnt/shared/mtgajdzx/workspace/cmd_patch/examples/qos_sched/cfg_file.c:4 > 85: undefined reference to `rte_cfgfile_section_entries' > collect2: ld returned 1 exit status > make[1]: *** [qos_sched] Error 1 > make: *** [all] Error 2 >=20 > Linker couldn't find versioned function when dpdk is build as shared lib. After further investigation I came up with solution working for both shared= and dynamic library cases. Old function should have added suffix _v20. New function should have suffix= _v21 and bind default macro: BIND_DEFAULT_SYMBOL(rte_cfgfile_section_entries, _v21, 2.1); In rte_compat.h versioning macros should have the same form for both shared= and static libraries. I removed empty macros for static case and ifdef. I will send my changes as a patch. Best Regards Maciek