[dpdk-dev] net/tap: remove queue specific offload support

Message ID 20180322182843.105732-1-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Ferruh Yigit March 22, 2018, 6:28 p.m. UTC
  It is not clear if tap PMD supports queue specific offloads, removing
the related code.

Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
Cc: motih@mellanox.com

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Shahaf Shuler <shahafs@mellanox.com>
---
 drivers/net/tap/rte_eth_tap.c | 101 +++---------------------------------------
 1 file changed, 6 insertions(+), 95 deletions(-)
  

Comments

Thomas Monjalon April 5, 2018, 5:49 p.m. UTC | #1
Pascal, Moti, Ophir,
please comment.

22/03/2018 19:28, Ferruh Yigit:
> It is not clear if tap PMD supports queue specific offloads, removing
> the related code.
> 
> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
> Cc: motih@mellanox.com
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit April 12, 2018, 4:23 p.m. UTC | #2
On 4/5/2018 6:49 PM, Thomas Monjalon wrote:
> Pascal, Moti, Ophir,
> please comment.

Hi Moti,

Any comment? This has been asked many times now.

> 
> 22/03/2018 19:28, Ferruh Yigit:
>> It is not clear if tap PMD supports queue specific offloads, removing
>> the related code.
>>
>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
>> Cc: motih@mellanox.com
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> 
>
  
Ferruh Yigit April 18, 2018, 8:59 a.m. UTC | #3
On 4/12/2018 5:23 PM, Ferruh Yigit wrote:
> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:
>> Pascal, Moti, Ophir,
>> please comment.
> 
> Hi Moti,
> 
> Any comment? This has been asked many times now.

Hi Moti, Ophir,

You have not responded why queue specific offload added in other thread.
And you are not responding to this patch...

Hi Pascal,

If you also have no objection, this patch is going in.

Thanks,
ferruh


> 
>>
>> 22/03/2018 19:28, Ferruh Yigit:
>>> It is not clear if tap PMD supports queue specific offloads, removing
>>> the related code.
>>>
>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
>>> Cc: motih@mellanox.com
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>
>>
>>
>
  
Ophir Munk April 18, 2018, 9:40 a.m. UTC | #4
Hi Ferruh,
Sorry for the delayed response.

I would like to verify the correctness of this patch by running several internal tests.
Is a reply by Monday OK with you?

Regards,
Ophir

> -----Original Message-----

> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> Sent: Wednesday, April 18, 2018 11:59 AM

> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon

> <pascal.mazon@6wind.com>; Mordechay Haimovsky

> <motih@mellanox.com>; Ophir Munk <ophirmu@mellanox.com>

> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> <olgas@mellanox.com>

> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> support

> 

> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:

> > On 4/5/2018 6:49 PM, Thomas Monjalon wrote:

> >> Pascal, Moti, Ophir,

> >> please comment.

> >

> > Hi Moti,

> >

> > Any comment? This has been asked many times now.

> 

> Hi Moti, Ophir,

> 

> You have not responded why queue specific offload added in other thread.

> And you are not responding to this patch...

> 

> Hi Pascal,

> 

> If you also have no objection, this patch is going in.

> 

> Thanks,

> ferruh

> 

> 

> >

> >>

> >> 22/03/2018 19:28, Ferruh Yigit:

> >>> It is not clear if tap PMD supports queue specific offloads,

> >>> removing the related code.

> >>>

> >>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")

> >>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")

> >>> Cc: motih@mellanox.com

> >>>

> >>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

> >>

> >>

> >>

> >
  
Ferruh Yigit April 18, 2018, 10:55 a.m. UTC | #5
On 4/18/2018 10:40 AM, Ophir Munk wrote:
> Hi Ferruh,
> Sorry for the delayed response.
> 
> I would like to verify the correctness of this patch by running several internal tests.
> Is a reply by Monday OK with you?

Monday can be late to include patch into rc1, any chance to do earlier?

> 
> Regards,
> Ophir
> 
>> -----Original Message-----
>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
>> Sent: Wednesday, April 18, 2018 11:59 AM
>> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon
>> <pascal.mazon@6wind.com>; Mordechay Haimovsky
>> <motih@mellanox.com>; Ophir Munk <ophirmu@mellanox.com>
>> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern
>> <olgas@mellanox.com>
>> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload
>> support
>>
>> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:
>>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:
>>>> Pascal, Moti, Ophir,
>>>> please comment.
>>>
>>> Hi Moti,
>>>
>>> Any comment? This has been asked many times now.
>>
>> Hi Moti, Ophir,
>>
>> You have not responded why queue specific offload added in other thread.
>> And you are not responding to this patch...
>>
>> Hi Pascal,
>>
>> If you also have no objection, this patch is going in.
>>
>> Thanks,
>> ferruh
>>
>>
>>>
>>>>
>>>> 22/03/2018 19:28, Ferruh Yigit:
>>>>> It is not clear if tap PMD supports queue specific offloads,
>>>>> removing the related code.
>>>>>
>>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
>>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
>>>>> Cc: motih@mellanox.com
>>>>>
>>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>
>>>>
>>>>
>>>
>
  
Ophir Munk April 22, 2018, 4:04 p.m. UTC | #6
Hi Ferruh,
I am not able to apply your patch on next-net/master branch. 
I am failing to apply it both on latest commit or just before 22-Mar-18 (commit's date).

$ git am dpdk-dev-net-tap-remove-queue-specific-offload-support.patch
Applying: net/tap: remove queue specific offload support
error: patch failed: drivers/net/tap/rte_eth_tap.c:269
error: drivers/net/tap/rte_eth_tap.c: patch does not apply
Patch failed at 0001 net/tap: remove queue specific offload support

Please advise.

Once this error is fixed I can verify your patch with high priority and send you my feedback.

Regards,
Ophir

> -----Original Message-----

> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> Sent: Wednesday, April 18, 2018 1:55 PM

> To: Ophir Munk <ophirmu@mellanox.com>; Thomas Monjalon

> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> Mordechay Haimovsky <motih@mellanox.com>

> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> <olgas@mellanox.com>

> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> support

> 

> On 4/18/2018 10:40 AM, Ophir Munk wrote:

> > Hi Ferruh,

> > Sorry for the delayed response.

> >

> > I would like to verify the correctness of this patch by running several

> internal tests.

> > Is a reply by Monday OK with you?

> 

> Monday can be late to include patch into rc1, any chance to do earlier?

> 

> >

> > Regards,

> > Ophir

> >

> >> -----Original Message-----

> >> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> >> Sent: Wednesday, April 18, 2018 11:59 AM

> >> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon

> >> <pascal.mazon@6wind.com>; Mordechay Haimovsky

> <motih@mellanox.com>;

> >> Ophir Munk <ophirmu@mellanox.com>

> >> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> >> <olgas@mellanox.com>

> >> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific

> >> offload support

> >>

> >> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:

> >>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:

> >>>> Pascal, Moti, Ophir,

> >>>> please comment.

> >>>

> >>> Hi Moti,

> >>>

> >>> Any comment? This has been asked many times now.

> >>

> >> Hi Moti, Ophir,

> >>

> >> You have not responded why queue specific offload added in other

> thread.

> >> And you are not responding to this patch...

> >>

> >> Hi Pascal,

> >>

> >> If you also have no objection, this patch is going in.

> >>

> >> Thanks,

> >> ferruh

> >>

> >>

> >>>

> >>>>

> >>>> 22/03/2018 19:28, Ferruh Yigit:

> >>>>> It is not clear if tap PMD supports queue specific offloads,

> >>>>> removing the related code.

> >>>>>

> >>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")

> >>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")

> >>>>> Cc: motih@mellanox.com

> >>>>>

> >>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

> >>>>

> >>>>

> >>>>

> >>>

> >
  
Ophir Munk April 23, 2018, 8:39 a.m. UTC | #7
Hi Ferruh,
I was able to apply your patch with Thomas help:
1. git am --reject
2. <Fix code manually using *.rej file>
3. git am --continue

Regards,
Ophir

> -----Original Message-----

> From: Ophir Munk

> Sent: Sunday, April 22, 2018 7:05 PM

> To: Ferruh Yigit <ferruh.yigit@intel.com>; Thomas Monjalon

> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> Mordechay Haimovsky <motih@mellanox.com>

> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> <olgas@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>

> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> support

> 

> Hi Ferruh,

> I am not able to apply your patch on next-net/master branch.

> I am failing to apply it both on latest commit or just before 22-Mar-18

> (commit's date).

> 

> $ git am dpdk-dev-net-tap-remove-queue-specific-offload-support.patch

> Applying: net/tap: remove queue specific offload support

> error: patch failed: drivers/net/tap/rte_eth_tap.c:269

> error: drivers/net/tap/rte_eth_tap.c: patch does not apply Patch failed at

> 0001 net/tap: remove queue specific offload support

> 

> Please advise.

> 

> Once this error is fixed I can verify your patch with high priority and send you

> my feedback.

> 

> Regards,

> Ophir

> 

> > -----Original Message-----

> > From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> > Sent: Wednesday, April 18, 2018 1:55 PM

> > To: Ophir Munk <ophirmu@mellanox.com>; Thomas Monjalon

> > <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> > Mordechay Haimovsky <motih@mellanox.com>

> > Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> > <olgas@mellanox.com>

> > Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> > support

> >

> > On 4/18/2018 10:40 AM, Ophir Munk wrote:

> > > Hi Ferruh,

> > > Sorry for the delayed response.

> > >

> > > I would like to verify the correctness of this patch by running

> > > several

> > internal tests.

> > > Is a reply by Monday OK with you?

> >

> > Monday can be late to include patch into rc1, any chance to do earlier?

> >

> > >

> > > Regards,

> > > Ophir

> > >

> > >> -----Original Message-----

> > >> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> > >> Sent: Wednesday, April 18, 2018 11:59 AM

> > >> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon

> > >> <pascal.mazon@6wind.com>; Mordechay Haimovsky

> > <motih@mellanox.com>;

> > >> Ophir Munk <ophirmu@mellanox.com>

> > >> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> > >> <olgas@mellanox.com>

> > >> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific

> > >> offload support

> > >>

> > >> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:

> > >>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:

> > >>>> Pascal, Moti, Ophir,

> > >>>> please comment.

> > >>>

> > >>> Hi Moti,

> > >>>

> > >>> Any comment? This has been asked many times now.

> > >>

> > >> Hi Moti, Ophir,

> > >>

> > >> You have not responded why queue specific offload added in other

> > thread.

> > >> And you are not responding to this patch...

> > >>

> > >> Hi Pascal,

> > >>

> > >> If you also have no objection, this patch is going in.

> > >>

> > >> Thanks,

> > >> ferruh

> > >>

> > >>

> > >>>

> > >>>>

> > >>>> 22/03/2018 19:28, Ferruh Yigit:

> > >>>>> It is not clear if tap PMD supports queue specific offloads,

> > >>>>> removing the related code.

> > >>>>>

> > >>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")

> > >>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")

> > >>>>> Cc: motih@mellanox.com

> > >>>>>

> > >>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

> > >>>>

> > >>>>

> > >>>>

> > >>>

> > >
  
Ophir Munk April 23, 2018, 9:17 a.m. UTC | #8
Hi Ferruh,
A quick feedback to your patch on top of next-net/master: the IP and TCP offloaded checksums are turned incorrect.

Detailed description
================
A traffic generator is sending to a dpdk device one TCP packet and expects to receive it back after the IP and TCP checksums have been calculated by TAP.

Testpmd parameters
=================
testpmd -c 0x0f -n 4 --vdev="net_tap0,iface=net_vsc0,remote=ens2" -w 0000:00:00.0 -- --burst=64 --mbcache=512 --portmask 0x1 -i --txd=256 --rxd=256 --rxq=1 --txq=1 --coremask 0x008  --forward-mode=csum  --eth-peer=0,00:15:5d:10:66:02

Testpmd CLI commands
===================
testpmd> port stop all
testpmd> csum set ip hw 0
testpmd> csum set tcp hw 0
testpmd> port start all
testpmd> start

On Traffic generator side
=====================
A traffic generator (scapy) is sending 1261 bytes of a TCP packet

Monitoring the traffic:

tcpdump -i <interface name> -envvv &

The tcpdump output shows the sent packet followed by the received packet. 
Please note the received packet has incorrect IP & TCP checksums (both are 0)

11:51:03.058623 00:15:5d:10:66:02 > f4:52:14:7a:59:81, ethertype IPv4 (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 1247)
    127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0xdba5 (correct), seq 0:1207, win 8192, length 1207

11:51:03.058836 f4:52:14:7a:59:81 > 00:15:5d:10:66:02, ethertype IPv4 (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 1247, bad cksum 0 (->7816)!)
    127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0x0000 (incorrect -> 0xdba5), seq 0:1207, win 8192, length 1207

Regards,
Ophir

> -----Original Message-----

> From: Ophir Munk

> Sent: Monday, April 23, 2018 11:39 AM

> To: 'Ferruh Yigit' <ferruh.yigit@intel.com>; Thomas Monjalon

> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> Mordechay Haimovsky <motih@mellanox.com>

> Cc: 'dev@dpdk.org' <dev@dpdk.org>; Shahaf Shuler

> <shahafs@mellanox.com>; Olga Shern <olgas@mellanox.com>; Raslan

> Darawsheh <rasland@mellanox.com>

> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> support

> 

> Hi Ferruh,

> I was able to apply your patch with Thomas help:

> 1. git am --reject

> 2. <Fix code manually using *.rej file>

> 3. git am --continue

> 

> Regards,

> Ophir

> 

> > -----Original Message-----

> > From: Ophir Munk

> > Sent: Sunday, April 22, 2018 7:05 PM

> > To: Ferruh Yigit <ferruh.yigit@intel.com>; Thomas Monjalon

> > <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> > Mordechay Haimovsky <motih@mellanox.com>

> > Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> > <olgas@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>

> > Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific offload

> > support

> >

> > Hi Ferruh,

> > I am not able to apply your patch on next-net/master branch.

> > I am failing to apply it both on latest commit or just before

> > 22-Mar-18 (commit's date).

> >

> > $ git am dpdk-dev-net-tap-remove-queue-specific-offload-support.patch

> > Applying: net/tap: remove queue specific offload support

> > error: patch failed: drivers/net/tap/rte_eth_tap.c:269

> > error: drivers/net/tap/rte_eth_tap.c: patch does not apply Patch

> > failed at

> > 0001 net/tap: remove queue specific offload support

> >

> > Please advise.

> >

> > Once this error is fixed I can verify your patch with high priority

> > and send you my feedback.

> >

> > Regards,

> > Ophir

> >

> > > -----Original Message-----

> > > From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> > > Sent: Wednesday, April 18, 2018 1:55 PM

> > > To: Ophir Munk <ophirmu@mellanox.com>; Thomas Monjalon

> > > <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;

> > > Mordechay Haimovsky <motih@mellanox.com>

> > > Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern

> > > <olgas@mellanox.com>

> > > Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific

> > > offload support

> > >

> > > On 4/18/2018 10:40 AM, Ophir Munk wrote:

> > > > Hi Ferruh,

> > > > Sorry for the delayed response.

> > > >

> > > > I would like to verify the correctness of this patch by running

> > > > several

> > > internal tests.

> > > > Is a reply by Monday OK with you?

> > >

> > > Monday can be late to include patch into rc1, any chance to do earlier?

> > >

> > > >

> > > > Regards,

> > > > Ophir

> > > >

> > > >> -----Original Message-----

> > > >> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]

> > > >> Sent: Wednesday, April 18, 2018 11:59 AM

> > > >> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon

> > > >> <pascal.mazon@6wind.com>; Mordechay Haimovsky

> > > <motih@mellanox.com>;

> > > >> Ophir Munk <ophirmu@mellanox.com>

> > > >> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga

> > > >> Shern <olgas@mellanox.com>

> > > >> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific

> > > >> offload support

> > > >>

> > > >> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:

> > > >>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:

> > > >>>> Pascal, Moti, Ophir,

> > > >>>> please comment.

> > > >>>

> > > >>> Hi Moti,

> > > >>>

> > > >>> Any comment? This has been asked many times now.

> > > >>

> > > >> Hi Moti, Ophir,

> > > >>

> > > >> You have not responded why queue specific offload added in other

> > > thread.

> > > >> And you are not responding to this patch...

> > > >>

> > > >> Hi Pascal,

> > > >>

> > > >> If you also have no objection, this patch is going in.

> > > >>

> > > >> Thanks,

> > > >> ferruh

> > > >>

> > > >>

> > > >>>

> > > >>>>

> > > >>>> 22/03/2018 19:28, Ferruh Yigit:

> > > >>>>> It is not clear if tap PMD supports queue specific offloads,

> > > >>>>> removing the related code.

> > > >>>>>

> > > >>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")

> > > >>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")

> > > >>>>> Cc: motih@mellanox.com

> > > >>>>>

> > > >>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

> > > >>>>

> > > >>>>

> > > >>>>

> > > >>>

> > > >
  
Ferruh Yigit April 23, 2018, 10:13 a.m. UTC | #9
On 4/23/2018 10:17 AM, Ophir Munk wrote:
> Hi Ferruh,
> A quick feedback to your patch on top of next-net/master: the IP and TCP offloaded checksums are turned incorrect.

Hi Ophir,

Thanks for testing.
This patch removes queue specific offloads for tap but nothing touched on port
offloads, and in below test you are already using single queue.

This may mean something is wrong in tap for port offloading configuration.

Tap does csum calculation in Tx path [1], which does not even checks the
offloading flags, but mbuf->ol_flags. Any chance that mbuf->ol_flags is not set
correct? Can you able to make exact same setup work without this patch?


[1]
    if (txq->csum &&
        ((mbuf->ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4) ||
         (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM ||
         (mbuf->ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM))) {
            /* Support only packets with all data in the same seg */
            if (mbuf->nb_segs > 1)
                    break;
            /* To change checksums, work on a copy of data. */
            rte_memcpy(m_copy, rte_pktmbuf_mtod(mbuf, void *),
                       rte_pktmbuf_data_len(mbuf));
            tap_tx_offload(m_copy, mbuf->ol_flags,
                           mbuf->l2_len, mbuf->l3_len);
            iovecs[1].iov_base = m_copy;
    }


> 
> Detailed description
> ================
> A traffic generator is sending to a dpdk device one TCP packet and expects to receive it back after the IP and TCP checksums have been calculated by TAP.
> 
> Testpmd parameters
> =================
> testpmd -c 0x0f -n 4 --vdev="net_tap0,iface=net_vsc0,remote=ens2" -w 0000:00:00.0 -- --burst=64 --mbcache=512 --portmask 0x1 -i --txd=256 --rxd=256 --rxq=1 --txq=1 --coremask 0x008  --forward-mode=csum  --eth-peer=0,00:15:5d:10:66:02
> 
> Testpmd CLI commands
> ===================
> testpmd> port stop all
> testpmd> csum set ip hw 0
> testpmd> csum set tcp hw 0
> testpmd> port start all
> testpmd> start
> 
> On Traffic generator side
> =====================
> A traffic generator (scapy) is sending 1261 bytes of a TCP packet
> 
> Monitoring the traffic:
> 
> tcpdump -i <interface name> -envvv &
> 
> The tcpdump output shows the sent packet followed by the received packet. 
> Please note the received packet has incorrect IP & TCP checksums (both are 0)
> 
> 11:51:03.058623 00:15:5d:10:66:02 > f4:52:14:7a:59:81, ethertype IPv4 (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 1247)
>     127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0xdba5 (correct), seq 0:1207, win 8192, length 1207
> 
> 11:51:03.058836 f4:52:14:7a:59:81 > 00:15:5d:10:66:02, ethertype IPv4 (0x0800), length 1261: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto TCP (6), length 1247, bad cksum 0 (->7816)!)
>     127.0.0.1.1 > 127.0.0.1.1: Flags [S], cksum 0x0000 (incorrect -> 0xdba5), seq 0:1207, win 8192, length 1207
> 
> Regards,
> Ophir
> 
>> -----Original Message-----
>> From: Ophir Munk
>> Sent: Monday, April 23, 2018 11:39 AM
>> To: 'Ferruh Yigit' <ferruh.yigit@intel.com>; Thomas Monjalon
>> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;
>> Mordechay Haimovsky <motih@mellanox.com>
>> Cc: 'dev@dpdk.org' <dev@dpdk.org>; Shahaf Shuler
>> <shahafs@mellanox.com>; Olga Shern <olgas@mellanox.com>; Raslan
>> Darawsheh <rasland@mellanox.com>
>> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific offload
>> support
>>
>> Hi Ferruh,
>> I was able to apply your patch with Thomas help:
>> 1. git am --reject
>> 2. <Fix code manually using *.rej file>
>> 3. git am --continue
>>
>> Regards,
>> Ophir
>>
>>> -----Original Message-----
>>> From: Ophir Munk
>>> Sent: Sunday, April 22, 2018 7:05 PM
>>> To: Ferruh Yigit <ferruh.yigit@intel.com>; Thomas Monjalon
>>> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;
>>> Mordechay Haimovsky <motih@mellanox.com>
>>> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern
>>> <olgas@mellanox.com>; Raslan Darawsheh <rasland@mellanox.com>
>>> Subject: RE: [dpdk-dev] [PATCH] net/tap: remove queue specific offload
>>> support
>>>
>>> Hi Ferruh,
>>> I am not able to apply your patch on next-net/master branch.
>>> I am failing to apply it both on latest commit or just before
>>> 22-Mar-18 (commit's date).
>>>
>>> $ git am dpdk-dev-net-tap-remove-queue-specific-offload-support.patch
>>> Applying: net/tap: remove queue specific offload support
>>> error: patch failed: drivers/net/tap/rte_eth_tap.c:269
>>> error: drivers/net/tap/rte_eth_tap.c: patch does not apply Patch
>>> failed at
>>> 0001 net/tap: remove queue specific offload support
>>>
>>> Please advise.
>>>
>>> Once this error is fixed I can verify your patch with high priority
>>> and send you my feedback.
>>>
>>> Regards,
>>> Ophir
>>>
>>>> -----Original Message-----
>>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
>>>> Sent: Wednesday, April 18, 2018 1:55 PM
>>>> To: Ophir Munk <ophirmu@mellanox.com>; Thomas Monjalon
>>>> <thomas@monjalon.net>; Pascal Mazon <pascal.mazon@6wind.com>;
>>>> Mordechay Haimovsky <motih@mellanox.com>
>>>> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga Shern
>>>> <olgas@mellanox.com>
>>>> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific
>>>> offload support
>>>>
>>>> On 4/18/2018 10:40 AM, Ophir Munk wrote:
>>>>> Hi Ferruh,
>>>>> Sorry for the delayed response.
>>>>>
>>>>> I would like to verify the correctness of this patch by running
>>>>> several
>>>> internal tests.
>>>>> Is a reply by Monday OK with you?
>>>>
>>>> Monday can be late to include patch into rc1, any chance to do earlier?
>>>>
>>>>>
>>>>> Regards,
>>>>> Ophir
>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Ferruh Yigit [mailto:ferruh.yigit@intel.com]
>>>>>> Sent: Wednesday, April 18, 2018 11:59 AM
>>>>>> To: Thomas Monjalon <thomas@monjalon.net>; Pascal Mazon
>>>>>> <pascal.mazon@6wind.com>; Mordechay Haimovsky
>>>> <motih@mellanox.com>;
>>>>>> Ophir Munk <ophirmu@mellanox.com>
>>>>>> Cc: dev@dpdk.org; Shahaf Shuler <shahafs@mellanox.com>; Olga
>>>>>> Shern <olgas@mellanox.com>
>>>>>> Subject: Re: [dpdk-dev] [PATCH] net/tap: remove queue specific
>>>>>> offload support
>>>>>>
>>>>>> On 4/12/2018 5:23 PM, Ferruh Yigit wrote:
>>>>>>> On 4/5/2018 6:49 PM, Thomas Monjalon wrote:
>>>>>>>> Pascal, Moti, Ophir,
>>>>>>>> please comment.
>>>>>>>
>>>>>>> Hi Moti,
>>>>>>>
>>>>>>> Any comment? This has been asked many times now.
>>>>>>
>>>>>> Hi Moti, Ophir,
>>>>>>
>>>>>> You have not responded why queue specific offload added in other
>>>> thread.
>>>>>> And you are not responding to this patch...
>>>>>>
>>>>>> Hi Pascal,
>>>>>>
>>>>>> If you also have no objection, this patch is going in.
>>>>>>
>>>>>> Thanks,
>>>>>> ferruh
>>>>>>
>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> 22/03/2018 19:28, Ferruh Yigit:
>>>>>>>>> It is not clear if tap PMD supports queue specific offloads,
>>>>>>>>> removing the related code.
>>>>>>>>>
>>>>>>>>> Fixes: 95ae196ae10b ("net/tap: use new Rx offloads API")
>>>>>>>>> Fixes: 818fe14a9891 ("net/tap: use new Tx offloads API")
>>>>>>>>> Cc: motih@mellanox.com
>>>>>>>>>
>>>>>>>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>
>
  

Patch

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index c9b86a8f0..67ed9d466 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -269,33 +269,6 @@  tap_rx_offload_get_port_capa(void)
 	       DEV_RX_OFFLOAD_CRC_STRIP;
 }
 
-static uint64_t
-tap_rx_offload_get_queue_capa(void)
-{
-	return DEV_RX_OFFLOAD_SCATTER |
-	       DEV_RX_OFFLOAD_IPV4_CKSUM |
-	       DEV_RX_OFFLOAD_UDP_CKSUM |
-	       DEV_RX_OFFLOAD_TCP_CKSUM |
-	       DEV_RX_OFFLOAD_CRC_STRIP;
-}
-
-static bool
-tap_rxq_are_offloads_valid(struct rte_eth_dev *dev, uint64_t offloads)
-{
-	uint64_t port_offloads = dev->data->dev_conf.rxmode.offloads;
-	uint64_t queue_supp_offloads = tap_rx_offload_get_queue_capa();
-	uint64_t port_supp_offloads = tap_rx_offload_get_port_capa();
-
-	if ((offloads & (queue_supp_offloads | port_supp_offloads)) !=
-	    offloads)
-		return false;
-	if ((offloads & port_offloads) ^ offloads)
-		return false;
-	if ((offloads & port_supp_offloads) ^ offloads)
-		return false;
-	return true;
-}
-
 /* Callback to handle the rx burst of packets to the correct interface and
  * file descriptor(s) in a multi-queue setup.
  */
@@ -404,31 +377,6 @@  tap_tx_offload_get_port_capa(void)
 	       DEV_TX_OFFLOAD_TCP_CKSUM;
 }
 
-static uint64_t
-tap_tx_offload_get_queue_capa(void)
-{
-	return DEV_TX_OFFLOAD_MULTI_SEGS |
-	       DEV_TX_OFFLOAD_IPV4_CKSUM |
-	       DEV_TX_OFFLOAD_UDP_CKSUM |
-	       DEV_TX_OFFLOAD_TCP_CKSUM;
-}
-
-static bool
-tap_txq_are_offloads_valid(struct rte_eth_dev *dev, uint64_t offloads)
-{
-	uint64_t port_offloads = dev->data->dev_conf.txmode.offloads;
-	uint64_t queue_supp_offloads = tap_tx_offload_get_queue_capa();
-	uint64_t port_supp_offloads = tap_tx_offload_get_port_capa();
-
-	if ((offloads & (queue_supp_offloads | port_supp_offloads)) !=
-	    offloads)
-		return false;
-	/* Verify we have no conflict with port offloads */
-	if ((port_offloads ^ offloads) & port_supp_offloads)
-		return false;
-	return true;
-}
-
 static void
 tap_tx_offload(char *packet, uint64_t ol_flags, unsigned int l2_len,
 	       unsigned int l3_len)
@@ -742,12 +690,10 @@  tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
 	dev_info->min_rx_bufsize = 0;
 	dev_info->pci_dev = NULL;
 	dev_info->speed_capa = tap_dev_speed_capa();
-	dev_info->rx_queue_offload_capa = tap_rx_offload_get_queue_capa();
-	dev_info->rx_offload_capa = tap_rx_offload_get_port_capa() |
-				    dev_info->rx_queue_offload_capa;
-	dev_info->tx_queue_offload_capa = tap_tx_offload_get_queue_capa();
-	dev_info->tx_offload_capa = tap_tx_offload_get_port_capa() |
-				    dev_info->tx_queue_offload_capa;
+	dev_info->rx_offload_capa = tap_rx_offload_get_port_capa();
+	dev_info->tx_offload_capa = tap_tx_offload_get_port_capa();
+	dev_info->rx_queue_offload_capa = 0;
+	dev_info->tx_queue_offload_capa = 0;
 }
 
 static int
@@ -1063,19 +1009,6 @@  tap_rx_queue_setup(struct rte_eth_dev *dev,
 		return -1;
 	}
 
-	/* Verify application offloads are valid for our port and queue. */
-	if (!tap_rxq_are_offloads_valid(dev, rx_conf->offloads)) {
-		rte_errno = ENOTSUP;
-		RTE_LOG(ERR, PMD,
-			"%p: Rx queue offloads 0x%" PRIx64
-			" don't match port offloads 0x%" PRIx64
-			" or supported offloads 0x%" PRIx64 "\n",
-			(void *)dev, rx_conf->offloads,
-			dev->data->dev_conf.rxmode.offloads,
-			(tap_rx_offload_get_port_capa() |
-			 tap_rx_offload_get_queue_capa()));
-		return -rte_errno;
-	}
 	rxq->mp = mp;
 	rxq->trigger_seen = 1; /* force initial burst */
 	rxq->in_port = dev->data->port_id;
@@ -1134,7 +1067,7 @@  tap_tx_queue_setup(struct rte_eth_dev *dev,
 		   uint16_t tx_queue_id,
 		   uint16_t nb_tx_desc __rte_unused,
 		   unsigned int socket_id __rte_unused,
-		   const struct rte_eth_txconf *tx_conf)
+		   const struct rte_eth_txconf *tx_conf __rte_unused)
 {
 	struct pmd_internals *internals = dev->data->dev_private;
 	struct tx_queue *txq;
@@ -1144,29 +1077,7 @@  tap_tx_queue_setup(struct rte_eth_dev *dev,
 		return -1;
 	dev->data->tx_queues[tx_queue_id] = &internals->txq[tx_queue_id];
 	txq = dev->data->tx_queues[tx_queue_id];
-	/*
-	 * Don't verify port offloads for application which
-	 * use the old API.
-	 */
-	if (tx_conf != NULL &&
-	    !!(tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE)) {
-		if (tap_txq_are_offloads_valid(dev, tx_conf->offloads)) {
-			txq->csum = !!(tx_conf->offloads &
-					(DEV_TX_OFFLOAD_IPV4_CKSUM |
-					 DEV_TX_OFFLOAD_UDP_CKSUM |
-					 DEV_TX_OFFLOAD_TCP_CKSUM));
-		} else {
-			rte_errno = ENOTSUP;
-			RTE_LOG(ERR, PMD,
-				"%p: Tx queue offloads 0x%" PRIx64
-				" don't match port offloads 0x%" PRIx64
-				" or supported offloads 0x%" PRIx64,
-				(void *)dev, tx_conf->offloads,
-				dev->data->dev_conf.txmode.offloads,
-				tap_tx_offload_get_port_capa());
-			return -rte_errno;
-		}
-	}
+
 	ret = tap_setup_queue(dev, internals, tx_queue_id, 0);
 	if (ret == -1)
 		return -1;