[dpdk-dev,RFC] Link ibrte_vhost to librte_pmd_vhost

Message ID 571DDDD8.6000000@igel.co.jp (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Commit Message

Tetsuya Mukawa April 25, 2016, 9:05 a.m. UTC
  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.
This is same way to link libpcap to librte_pmd_pcap.
What do you think about adding it to vhost PMD?

Thanks,
Tetsuya
  

Comments

Panu Matilainen April 25, 2016, 9:28 a.m. UTC | #1
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
>
  
Tetsuya Mukawa April 25, 2016, 9:44 a.m. UTC | #2
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
>>
>
  
Yuanhan Liu April 26, 2016, 3:47 a.m. UTC | #3
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
  
Tetsuya Mukawa April 26, 2016, 5:37 a.m. UTC | #4
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
  
Yuanhan Liu April 26, 2016, 5:48 a.m. UTC | #5
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
  
Tetsuya Mukawa April 26, 2016, 6 a.m. UTC | #6
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
  

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