DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
@ 2016-04-25  9:05 Tetsuya Mukawa
  2016-04-25  9:28 ` Panu Matilainen
  2016-04-26  5:39 ` [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
  0 siblings, 2 replies; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-25  9:05 UTC (permalink / raw)
  To: dev, Yuanhan Liu; +Cc: Xie, Huawei

Hi Yuanhan,

I want to apply a patch to vhost PMD.
Before submitting, could you please let me know your guess about the patch?

Here is my problem.
I am using below shared library configuration to build my application.
CONFIG_RTE_BUILD_SHARED_LIB=y
Normally, My application doesn't need vhost facilities, so librte_vhost
isn't linked while compiling.

Sometimes, I need to use vhost PMD, so I just want to add '-d
librte_pmd_vhost.so' to DPDK command line to load vhost PMD library.
But my application doesn't have librte_vhost, then I've got an error
about it.
Even if specify like "-d librte_vhost -d librte_pmd_vhost", I still have
an error.
Probably this is because above libraries will be dlopen(ed) with
RTLD_LOCAL option.

Here, I have 2 choices.
One is linking librte_vhost to my application while compiling, even if I
don't need it normally.
This is the way all DPDK examples did. But I am wondering if I should
follow this.

Another way is applying a below patch.
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a

 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lrte_vhost

 EXPORT_MAP := rte_pmd_vhost_version.map

This is same way to link libpcap to librte_pmd_pcap.
What do you think about adding it to vhost PMD?

Thanks,
Tetsuya

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-25  9:05 [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost Tetsuya Mukawa
@ 2016-04-25  9:28 ` Panu Matilainen
  2016-04-25  9:44   ` Tetsuya Mukawa
  2016-04-26  3:47   ` Yuanhan Liu
  2016-04-26  5:39 ` [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
  1 sibling, 2 replies; 11+ messages in thread
From: Panu Matilainen @ 2016-04-25  9:28 UTC (permalink / raw)
  To: Tetsuya Mukawa, dev, Yuanhan Liu; +Cc: Xie, Huawei

On 04/25/2016 12:05 PM, Tetsuya Mukawa wrote:
> Hi Yuanhan,
>
> I want to apply a patch to vhost PMD.
> Before submitting, could you please let me know your guess about the patch?
>
> Here is my problem.
> I am using below shared library configuration to build my application.
> CONFIG_RTE_BUILD_SHARED_LIB=y
> Normally, My application doesn't need vhost facilities, so librte_vhost
> isn't linked while compiling.
>
> Sometimes, I need to use vhost PMD, so I just want to add '-d
> librte_pmd_vhost.so' to DPDK command line to load vhost PMD library.
> But my application doesn't have librte_vhost, then I've got an error
> about it.
> Even if specify like "-d librte_vhost -d librte_pmd_vhost", I still have
> an error.
> Probably this is because above libraries will be dlopen(ed) with
> RTLD_LOCAL option.
>
> Here, I have 2 choices.
> One is linking librte_vhost to my application while compiling, even if I
> don't need it normally.
> This is the way all DPDK examples did. But I am wondering if I should
> follow this.
>
> Another way is applying a below patch.
> --- a/drivers/net/vhost/Makefile
> +++ b/drivers/net/vhost/Makefile
> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>
>   CFLAGS += -O3
>   CFLAGS += $(WERROR_FLAGS)
> +LDLIBS += -lrte_vhost
>
>   EXPORT_MAP := rte_pmd_vhost_version.map
>
> This is same way to link libpcap to librte_pmd_pcap.
> What do you think about adding it to vhost PMD?

Yes, this is absolutely the right thing to do.

Ultimately this should be done for all dependencies in all libraries, 
but missing dependencies are even more pronounced in plugins so the 
sooner this goes in, the better.

Acked-by: Panu Matilainen <pmatilai@redhat.com>

	- Panu -


>
> Thanks,
> Tetsuya
>

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-25  9:28 ` Panu Matilainen
@ 2016-04-25  9:44   ` Tetsuya Mukawa
  2016-04-26  3:47   ` Yuanhan Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-25  9:44 UTC (permalink / raw)
  To: Panu Matilainen, dev; +Cc: Yuanhan Liu, Xie, Huawei

On 2016/04/25 18:28, Panu Matilainen wrote:
> On 04/25/2016 12:05 PM, Tetsuya Mukawa wrote:
>> Hi Yuanhan,
>>
>> I want to apply a patch to vhost PMD.
>> Before submitting, could you please let me know your guess about the
>> patch?
>>
>> Here is my problem.
>> I am using below shared library configuration to build my application.
>> CONFIG_RTE_BUILD_SHARED_LIB=y
>> Normally, My application doesn't need vhost facilities, so librte_vhost
>> isn't linked while compiling.
>>
>> Sometimes, I need to use vhost PMD, so I just want to add '-d
>> librte_pmd_vhost.so' to DPDK command line to load vhost PMD library.
>> But my application doesn't have librte_vhost, then I've got an error
>> about it.
>> Even if specify like "-d librte_vhost -d librte_pmd_vhost", I still have
>> an error.
>> Probably this is because above libraries will be dlopen(ed) with
>> RTLD_LOCAL option.
>>
>> Here, I have 2 choices.
>> One is linking librte_vhost to my application while compiling, even if I
>> don't need it normally.
>> This is the way all DPDK examples did. But I am wondering if I should
>> follow this.
>>
>> Another way is applying a below patch.
>> --- a/drivers/net/vhost/Makefile
>> +++ b/drivers/net/vhost/Makefile
>> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>>
>>   CFLAGS += -O3
>>   CFLAGS += $(WERROR_FLAGS)
>> +LDLIBS += -lrte_vhost
>>
>>   EXPORT_MAP := rte_pmd_vhost_version.map
>>
>> This is same way to link libpcap to librte_pmd_pcap.
>> What do you think about adding it to vhost PMD?
>
> Yes, this is absolutely the right thing to do.
>
> Ultimately this should be done for all dependencies in all libraries,
> but missing dependencies are even more pronounced in plugins so the
> sooner this goes in, the better.
>
> Acked-by: Panu Matilainen <pmatilai@redhat.com>
>
>     - Panu -

Hi Panu,

I appreciate your comment.
I will send it as a patch tomorrow.
It seems I cannot connect to DPDK git repository so far. So I cannot
test it with latest code.

Thanks,
Tetsuya

>
>
>>
>> Thanks,
>> Tetsuya
>>
>

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-25  9:28 ` Panu Matilainen
  2016-04-25  9:44   ` Tetsuya Mukawa
@ 2016-04-26  3:47   ` Yuanhan Liu
  2016-04-26  5:37     ` Tetsuya Mukawa
  1 sibling, 1 reply; 11+ messages in thread
From: Yuanhan Liu @ 2016-04-26  3:47 UTC (permalink / raw)
  To: Panu Matilainen; +Cc: Tetsuya Mukawa, dev, Xie, Huawei, Thomas Monjalon

On Mon, Apr 25, 2016 at 12:28:37PM +0300, Panu Matilainen wrote:
 >
> >Another way is applying a below patch.
> >--- a/drivers/net/vhost/Makefile
> >+++ b/drivers/net/vhost/Makefile
> >@@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
> >
> >  CFLAGS += -O3
> >  CFLAGS += $(WERROR_FLAGS)
> >+LDLIBS += -lrte_vhost
> >
> >  EXPORT_MAP := rte_pmd_vhost_version.map
> >
> >This is same way to link libpcap to librte_pmd_pcap.
> >What do you think about adding it to vhost PMD?
> 
> Yes, this is absolutely the right thing to do.
> 
> Ultimately this should be done for all dependencies in all libraries, but
> missing dependencies are even more pronounced in plugins so the sooner this
> goes in, the better.
> 
> Acked-by: Panu Matilainen <pmatilai@redhat.com>

Panu, thanks for the input.

Tetsuya, please submit a formal patch so that I can merge.

	--yliu

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-26  3:47   ` Yuanhan Liu
@ 2016-04-26  5:37     ` Tetsuya Mukawa
  2016-04-26  5:48       ` Yuanhan Liu
  0 siblings, 1 reply; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-26  5:37 UTC (permalink / raw)
  To: Yuanhan Liu, Panu Matilainen; +Cc: dev, Xie, Huawei, Thomas Monjalon

On 2016/04/26 12:47, Yuanhan Liu wrote:
> On Mon, Apr 25, 2016 at 12:28:37PM +0300, Panu Matilainen wrote:
>  >
>>> Another way is applying a below patch.
>>> --- a/drivers/net/vhost/Makefile
>>> +++ b/drivers/net/vhost/Makefile
>>> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>>>
>>>  CFLAGS += -O3
>>>  CFLAGS += $(WERROR_FLAGS)
>>> +LDLIBS += -lrte_vhost
>>>
>>>  EXPORT_MAP := rte_pmd_vhost_version.map
>>>
>>> This is same way to link libpcap to librte_pmd_pcap.
>>> What do you think about adding it to vhost PMD?
>> Yes, this is absolutely the right thing to do.
>>
>> Ultimately this should be done for all dependencies in all libraries, but
>> missing dependencies are even more pronounced in plugins so the sooner this
>> goes in, the better.
>>
>> Acked-by: Panu Matilainen <pmatilai@redhat.com>
> Panu, thanks for the input.
>
> Tetsuya, please submit a formal patch so that I can merge.
>
> 	--yliu

Hi Yuanhan,

Oh sorry, I forgot to add "--in-reply-to" while sending the patch, so
you may miss it.
Also the order of Acked-by and Signed-off-by was wrong in above patch.
So I will send v2 soon.

Thanks,
Tetsuya

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

* [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD
  2016-04-25  9:05 [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost Tetsuya Mukawa
  2016-04-25  9:28 ` Panu Matilainen
@ 2016-04-26  5:39 ` Tetsuya Mukawa
  2016-04-26  9:35   ` Panu Matilainen
  2016-04-27 22:21   ` Yuanhan Liu
  1 sibling, 2 replies; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-26  5:39 UTC (permalink / raw)
  To: dev; +Cc: pmatilai, yuanhan.liu, huawei.xie, Tetsuya Mukawa

Currently, vhost PMD doesn't have linkage for librte_vhost, even though
it depends on librte_vhost APIs. This causes a linkage error if below
conditions are fulfilled.

 - DPDK libraries are compiled as shared libraries.
 - DPDK application doesn't link librte_vhost.
 - Above application tries to link vhost PMD using '-d' DPDK option.

The patch adds linkage for librte_vhost to vhost PMD not to cause an
above error.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Panu Matilainen <pmatilai@redhat.com>
---
 drivers/net/vhost/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
index f49a69b..30b91a0 100644
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
 
 CFLAGS += -O3
 CFLAGS += $(WERROR_FLAGS)
+LDLIBS += -lrte_vhost
 
 EXPORT_MAP := rte_pmd_vhost_version.map
 
-- 
2.5.0

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-26  5:37     ` Tetsuya Mukawa
@ 2016-04-26  5:48       ` Yuanhan Liu
  2016-04-26  6:00         ` Tetsuya Mukawa
  0 siblings, 1 reply; 11+ messages in thread
From: Yuanhan Liu @ 2016-04-26  5:48 UTC (permalink / raw)
  To: Tetsuya Mukawa; +Cc: Panu Matilainen, dev, Xie, Huawei, Thomas Monjalon

On Tue, Apr 26, 2016 at 02:37:37PM +0900, Tetsuya Mukawa wrote:
> On 2016/04/26 12:47, Yuanhan Liu wrote:
> > On Mon, Apr 25, 2016 at 12:28:37PM +0300, Panu Matilainen wrote:
> >  >
> >>> Another way is applying a below patch.
> >>> --- a/drivers/net/vhost/Makefile
> >>> +++ b/drivers/net/vhost/Makefile
> >>> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
> >>>
> >>>  CFLAGS += -O3
> >>>  CFLAGS += $(WERROR_FLAGS)
> >>> +LDLIBS += -lrte_vhost
> >>>
> >>>  EXPORT_MAP := rte_pmd_vhost_version.map
> >>>
> >>> This is same way to link libpcap to librte_pmd_pcap.
> >>> What do you think about adding it to vhost PMD?
> >> Yes, this is absolutely the right thing to do.
> >>
> >> Ultimately this should be done for all dependencies in all libraries, but
> >> missing dependencies are even more pronounced in plugins so the sooner this
> >> goes in, the better.
> >>
> >> Acked-by: Panu Matilainen <pmatilai@redhat.com>
> > Panu, thanks for the input.
> >
> > Tetsuya, please submit a formal patch so that I can merge.
> >
> > 	--yliu
> 
> Hi Yuanhan,
> 
> Oh sorry, I forgot to add "--in-reply-to" while sending the patch, so
> you may miss it.
> Also the order of Acked-by and Signed-off-by was wrong in above patch.
> So I will send v2 soon.

No worry. I could fix them, and I don't think there is a very strict
rule for both of them :) BTW, FYI, I just found my linux.intel.com
seems to be broken (no idea why), thus I made late response.

(well, I found you just send a v2; I will apply that tomorrow).

	--yliu

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

* Re: [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost
  2016-04-26  5:48       ` Yuanhan Liu
@ 2016-04-26  6:00         ` Tetsuya Mukawa
  0 siblings, 0 replies; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-26  6:00 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: Panu Matilainen, dev, Xie, Huawei, Thomas Monjalon

On 2016/04/26 14:48, Yuanhan Liu wrote:
> On Tue, Apr 26, 2016 at 02:37:37PM +0900, Tetsuya Mukawa wrote:
>> On 2016/04/26 12:47, Yuanhan Liu wrote:
>>> On Mon, Apr 25, 2016 at 12:28:37PM +0300, Panu Matilainen wrote:
>>>  >
>>>>> Another way is applying a below patch.
>>>>> --- a/drivers/net/vhost/Makefile
>>>>> +++ b/drivers/net/vhost/Makefile
>>>>> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>>>>>
>>>>>  CFLAGS += -O3
>>>>>  CFLAGS += $(WERROR_FLAGS)
>>>>> +LDLIBS += -lrte_vhost
>>>>>
>>>>>  EXPORT_MAP := rte_pmd_vhost_version.map
>>>>>
>>>>> This is same way to link libpcap to librte_pmd_pcap.
>>>>> What do you think about adding it to vhost PMD?
>>>> Yes, this is absolutely the right thing to do.
>>>>
>>>> Ultimately this should be done for all dependencies in all libraries, but
>>>> missing dependencies are even more pronounced in plugins so the sooner this
>>>> goes in, the better.
>>>>
>>>> Acked-by: Panu Matilainen <pmatilai@redhat.com>
>>> Panu, thanks for the input.
>>>
>>> Tetsuya, please submit a formal patch so that I can merge.
>>>
>>> 	--yliu
>> Hi Yuanhan,
>>
>> Oh sorry, I forgot to add "--in-reply-to" while sending the patch, so
>> you may miss it.
>> Also the order of Acked-by and Signed-off-by was wrong in above patch.
>> So I will send v2 soon.
> No worry. I could fix them, and I don't think there is a very strict
> rule for both of them :) BTW, FYI, I just found my linux.intel.com
> seems to be broken (no idea why), thus I made late response.
>
> (well, I found you just send a v2; I will apply that tomorrow).
>
> 	--yliu

Thank you so much!

Tetsuya

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

* Re: [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD
  2016-04-26  5:39 ` [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
@ 2016-04-26  9:35   ` Panu Matilainen
  2016-04-27  1:38     ` Tetsuya Mukawa
  2016-04-27 22:21   ` Yuanhan Liu
  1 sibling, 1 reply; 11+ messages in thread
From: Panu Matilainen @ 2016-04-26  9:35 UTC (permalink / raw)
  To: Tetsuya Mukawa, dev; +Cc: yuanhan.liu, huawei.xie, Thomas Monjalon

On 04/26/2016 08:39 AM, Tetsuya Mukawa wrote:
> Currently, vhost PMD doesn't have linkage for librte_vhost, even though
> it depends on librte_vhost APIs. This causes a linkage error if below
> conditions are fulfilled.
>
>  - DPDK libraries are compiled as shared libraries.
>  - DPDK application doesn't link librte_vhost.
>  - Above application tries to link vhost PMD using '-d' DPDK option.
>
> The patch adds linkage for librte_vhost to vhost PMD not to cause an
> above error.
>
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> Acked-by: Panu Matilainen <pmatilai@redhat.com>
> ---
>  drivers/net/vhost/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
> index f49a69b..30b91a0 100644
> --- a/drivers/net/vhost/Makefile
> +++ b/drivers/net/vhost/Makefile
> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>
>  CFLAGS += -O3
>  CFLAGS += $(WERROR_FLAGS)
> +LDLIBS += -lrte_vhost
>
>  EXPORT_MAP := rte_pmd_vhost_version.map
>
>

Hmm, turns out this isn't quite enough, simply because its the first of 
its kind (first internal dependency between libraries), at least I'm 
getting:

== Build drivers/net/vhost
gcc -m64 
-Wl,--version-script=/srv/work/dist/dpdk/dpdk-16.04/drivers/net/vhost/rte_pmd_vhost_version.map 
  -shared rte_eth_vhost.o -lrte_vhost -Wl,-soname,librte_pmd_vhost.so.1 
-o librte_pmd_vhost.so.1
/usr/bin/ld: cannot find -lrte_vhost
collect2: error: ld returned 1 exit status
/srv/work/dist/dpdk/dpdk-16.04/mk/rte.lib.mk:127: recipe for target 
'librte_pmd_vhost.so.1' failed

So it'll need something like this as a pre-requisite to add the internal 
libraries to the linker path:

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 8f7e021..f5d7b04 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -86,7 +86,7 @@ O_TO_A_DO = @set -e; \
         $(O_TO_A) && \
         echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))

-O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y) 
$(LDLIBS) \
+O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) 
-shared $(OBJS-y) $(LDLIBS) \
          -Wl,-soname,$(LIB) -o $(LIB)
  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")


I can submit an official patch for this later but I'm not exactly 
feeling like the sharpest knife in the drawer today so if somebody beats 
me to it, feel free.

	- Panu -

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

* Re: [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD
  2016-04-26  9:35   ` Panu Matilainen
@ 2016-04-27  1:38     ` Tetsuya Mukawa
  0 siblings, 0 replies; 11+ messages in thread
From: Tetsuya Mukawa @ 2016-04-27  1:38 UTC (permalink / raw)
  To: Panu Matilainen, dev; +Cc: yuanhan.liu, huawei.xie, Thomas Monjalon

On 2016/04/26 18:35, Panu Matilainen wrote:
> On 04/26/2016 08:39 AM, Tetsuya Mukawa wrote:
>> Currently, vhost PMD doesn't have linkage for librte_vhost, even though
>> it depends on librte_vhost APIs. This causes a linkage error if below
>> conditions are fulfilled.
>>
>>  - DPDK libraries are compiled as shared libraries.
>>  - DPDK application doesn't link librte_vhost.
>>  - Above application tries to link vhost PMD using '-d' DPDK option.
>>
>> The patch adds linkage for librte_vhost to vhost PMD not to cause an
>> above error.
>>
>> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
>> Acked-by: Panu Matilainen <pmatilai@redhat.com>
>> ---
>>  drivers/net/vhost/Makefile | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
>> index f49a69b..30b91a0 100644
>> --- a/drivers/net/vhost/Makefile
>> +++ b/drivers/net/vhost/Makefile
>> @@ -38,6 +38,7 @@ LIB = librte_pmd_vhost.a
>>
>>  CFLAGS += -O3
>>  CFLAGS += $(WERROR_FLAGS)
>> +LDLIBS += -lrte_vhost
>>
>>  EXPORT_MAP := rte_pmd_vhost_version.map
>>
>>
>
> Hmm, turns out this isn't quite enough, simply because its the first
> of its kind (first internal dependency between libraries), at least
> I'm getting:
>
> == Build drivers/net/vhost
> gcc -m64
> -Wl,--version-script=/srv/work/dist/dpdk/dpdk-16.04/drivers/net/vhost/rte_pmd_vhost_version.map
>  -shared rte_eth_vhost.o -lrte_vhost -Wl,-soname,librte_pmd_vhost.so.1
> -o librte_pmd_vhost.so.1
> /usr/bin/ld: cannot find -lrte_vhost
> collect2: error: ld returned 1 exit status
> /srv/work/dist/dpdk/dpdk-16.04/mk/rte.lib.mk:127: recipe for target
> 'librte_pmd_vhost.so.1' failed
>
> So it'll need something like this as a pre-requisite to add the
> internal libraries to the linker path:
>
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index 8f7e021..f5d7b04 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -86,7 +86,7 @@ O_TO_A_DO = @set -e; \
>         $(O_TO_A) && \
>         echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
>
> -O_TO_S = $(LD) $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) -shared $(OBJS-y)
> $(LDLIBS) \
> +O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS)
> -shared $(OBJS-y) $(LDLIBS) \
>          -Wl,-soname,$(LIB) -o $(LIB)
>  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
>  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
>
>
> I can submit an official patch for this later but I'm not exactly
> feeling like the sharpest knife in the drawer today so if somebody
> beats me to it, feel free.
>
>     - Panu -

Thanks for catching it.
It seems I've already installed DPDK libraries in /usr/local/lib/. Then
, I could not catch this error.
I've confirmed your solution works fine.

Thanks,
Tetsuya

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

* Re: [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD
  2016-04-26  5:39 ` [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
  2016-04-26  9:35   ` Panu Matilainen
@ 2016-04-27 22:21   ` Yuanhan Liu
  1 sibling, 0 replies; 11+ messages in thread
From: Yuanhan Liu @ 2016-04-27 22:21 UTC (permalink / raw)
  To: Tetsuya Mukawa; +Cc: dev, pmatilai, huawei.xie

On Tue, Apr 26, 2016 at 02:39:29PM +0900, Tetsuya Mukawa wrote:
> Currently, vhost PMD doesn't have linkage for librte_vhost, even though
> it depends on librte_vhost APIs. This causes a linkage error if below
> conditions are fulfilled.
> 
>  - DPDK libraries are compiled as shared libraries.
>  - DPDK application doesn't link librte_vhost.
>  - Above application tries to link vhost PMD using '-d' DPDK option.
> 
> The patch adds linkage for librte_vhost to vhost PMD not to cause an
> above error.
> 
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
> Acked-by: Panu Matilainen <pmatilai@redhat.com>

Applied to dpdk-next-virtio.

Thanks.

	--yliu

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

end of thread, other threads:[~2016-04-27 22:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-25  9:05 [dpdk-dev] [RFC] Link ibrte_vhost to librte_pmd_vhost Tetsuya Mukawa
2016-04-25  9:28 ` Panu Matilainen
2016-04-25  9:44   ` Tetsuya Mukawa
2016-04-26  3:47   ` Yuanhan Liu
2016-04-26  5:37     ` Tetsuya Mukawa
2016-04-26  5:48       ` Yuanhan Liu
2016-04-26  6:00         ` Tetsuya Mukawa
2016-04-26  5:39 ` [dpdk-dev] [PATCH v2] vhost: Fix linkage of vhost PMD Tetsuya Mukawa
2016-04-26  9:35   ` Panu Matilainen
2016-04-27  1:38     ` Tetsuya Mukawa
2016-04-27 22:21   ` Yuanhan Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).