diff mbox

[dpdk-dev,v4,7/8] net/tap: add packet type management

Message ID 725e6ac6-acc5-7adc-02a7-f1a6bf79f7bd@intel.com (mailing list archive)
State Not Applicable, archived
Headers show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch warning coding style issues

Commit Message

Ferruh Yigit March 15, 2017, 1:35 p.m. UTC
On 3/14/2017 8:22 AM, Pascal Mazon wrote:
> Advertize packet types supported by the librte_net.
> 
> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>

<...>

>  
>  #include <sys/types.h>
>  #include <sys/stat.h>
> @@ -228,6 +229,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
>  		mbuf->data_len = len;
>  		mbuf->pkt_len = len;
>  		mbuf->port = rxq->in_port;
> +		mbuf->packet_type = rte_net_get_ptype(mbuf, NULL,
> +						      RTE_PTYPE_ALL_MASK);

This breaks shared library build [1], now librte_net also needs to be
linked against PMD, this can be done easily by adding library as
dependency [2] to PMD.


[1]
rte_eth_tap.o: In function `pmd_rx_burst':
.../drivers/net/tap/rte_eth_tap.c:(.text+0x863): undefined reference to
`rte_net_get_ptype'


[2]

Comments

Pascal Mazon March 15, 2017, 1:44 p.m. UTC | #1
On Wed, 15 Mar 2017 13:35:44 +0000
Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 3/14/2017 8:22 AM, Pascal Mazon wrote:
> > Advertize packet types supported by the librte_net.
> > 
> > Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
> 
> <...>
> 
> >  
> >  #include <sys/types.h>
> >  #include <sys/stat.h>
> > @@ -228,6 +229,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf
> > **bufs, uint16_t nb_pkts) mbuf->data_len = len;
> >  		mbuf->pkt_len = len;
> >  		mbuf->port = rxq->in_port;
> > +		mbuf->packet_type = rte_net_get_ptype(mbuf, NULL,
> > +
> > RTE_PTYPE_ALL_MASK);
> 
> This breaks shared library build [1], now librte_net also needs to be
> linked against PMD, this can be done easily by adding library as
> dependency [2] to PMD.
> 
> 
> [1]
> rte_eth_tap.o: In function `pmd_rx_burst':
> .../drivers/net/tap/rte_eth_tap.c:(.text+0x863): undefined reference
> to `rte_net_get_ptype'
> 
> 
> [2]
> --- a/drivers/net/tap/Makefile
> +++ b/drivers/net/tap/Makefile
> @@ -53,5 +53,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
> lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
> lib/librte_mempool DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
> lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
> lib/librte_kvargs +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
> lib/librte_net
> 
>  include $(RTE_SDK)/mk/rte.lib.mk

Indeed!

I'll fix that and send a new version (rebased on the latest
next-net, following adrien's changes to tap PMD).

Regards,
Pascal
Ferruh Yigit March 15, 2017, 2:31 p.m. UTC | #2
On 3/15/2017 1:44 PM, Pascal Mazon wrote:
> On Wed, 15 Mar 2017 13:35:44 +0000
> Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
>> On 3/14/2017 8:22 AM, Pascal Mazon wrote:
>>> Advertize packet types supported by the librte_net.
>>>
>>> Signed-off-by: Pascal Mazon <pascal.mazon@6wind.com>
>>
>> <...>
>>
>>>  
>>>  #include <sys/types.h>
>>>  #include <sys/stat.h>
>>> @@ -228,6 +229,8 @@ pmd_rx_burst(void *queue, struct rte_mbuf
>>> **bufs, uint16_t nb_pkts) mbuf->data_len = len;
>>>  		mbuf->pkt_len = len;
>>>  		mbuf->port = rxq->in_port;
>>> +		mbuf->packet_type = rte_net_get_ptype(mbuf, NULL,
>>> +
>>> RTE_PTYPE_ALL_MASK);
>>
>> This breaks shared library build [1], now librte_net also needs to be
>> linked against PMD, this can be done easily by adding library as
>> dependency [2] to PMD.
>>
>>
>> [1]
>> rte_eth_tap.o: In function `pmd_rx_burst':
>> .../drivers/net/tap/rte_eth_tap.c:(.text+0x863): undefined reference
>> to `rte_net_get_ptype'
>>
>>
>> [2]
>> --- a/drivers/net/tap/Makefile
>> +++ b/drivers/net/tap/Makefile
>> @@ -53,5 +53,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
>> lib/librte_mbuf DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
>> lib/librte_mempool DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
>> lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
>> lib/librte_kvargs +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) +=
>> lib/librte_net
>>
>>  include $(RTE_SDK)/mk/rte.lib.mk
> 
> Indeed!
> 
> I'll fix that and send a new version (rebased on the latest
> next-net, following adrien's changes to tap PMD).

Can you also rebase tap rte_flow one [1], after this one please?
Because that set effected from both this one and Adrien's changes.

[1]
http://dpdk.org/dev/patchwork/patch/21757/ [4 patches]

Thanks,
ferruh

> 
> Regards,
> Pascal
>
diff mbox

Patch

--- a/drivers/net/tap/Makefile
+++ b/drivers/net/tap/Makefile
@@ -53,5 +53,6 @@  DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) += lib/librte_mbuf
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) += lib/librte_mempool
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) += lib/librte_ether
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) += lib/librte_kvargs
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_TAP) += lib/librte_net

 include $(RTE_SDK)/mk/rte.lib.mk