[dpdk-dev] testpmd: modify the mac of csum forwarding

Message ID 1438918156-1259-1-git-send-email-michael.qiu@intel.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Michael Qiu Aug. 7, 2015, 3:29 a.m. UTC
  For some ethnet-switch like intel RRC, all the packet forwarded
out by DPDK will be dropped in switch side, so the packet
generator will never receive the packet.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 app/test-pmd/csumonly.c | 4 ++++
 1 file changed, 4 insertions(+)
  

Comments

De Lara Guarch, Pablo Aug. 7, 2015, 4:05 p.m. UTC | #1
Hi Michael,

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> Sent: Friday, August 07, 2015 4:29 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
> 
> For some ethnet-switch like intel RRC, all the packet forwarded
> out by DPDK will be dropped in switch side, so the packet
> generator will never receive the packet.
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> ---
>  app/test-pmd/csumonly.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
> index 1bf3485..bf8af1d 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
> *fs)
>  		 * and inner headers */
> 
>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
> +				&eth_hdr->d_addr);
> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
> +				&eth_hdr->s_addr);
>  		parse_ethernet(eth_hdr, &info);
>  		l3_hdr = (char *)eth_hdr + info.l2_len;
> 
> --
> 1.9.3

Why do you make this change only in this mode? If NICs like RRC has this issue,
I assume it would happen in other modes.

Thanks,
Pablo
  
Zhang, Helin Aug. 7, 2015, 4:06 p.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> Sent: Thursday, August 6, 2015 8:29 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
> 
> For some ethnet-switch like intel RRC, all the packet forwarded out by DPDK will
> be dropped in switch side, so the packet generator will never receive the packet.
Is it because of anti-sproof? E.g. When the hardware found that the dest mac is the
port itself, then it will be dropped during TX.
You need to tell the root cause, and why we need to modify like this.

> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> ---
>  app/test-pmd/csumonly.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> 1bf3485..bf8af1d 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>  		 * and inner headers */
> 
>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
> +				&eth_hdr->d_addr);
> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
> +				&eth_hdr->s_addr);
Is it really necessary? Why other NICs do not need this?

>  		parse_ethernet(eth_hdr, &info);
>  		l3_hdr = (char *)eth_hdr + info.l2_len;
> 
> --
> 1.9.3
  
Michael Qiu Aug. 7, 2015, 6:42 p.m. UTC | #3
On 2015/8/7 9:05, De Lara Guarch, Pablo wrote:
> Hi Michael,
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
>> Sent: Friday, August 07, 2015 4:29 AM
>> To: dev@dpdk.org
>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
>>
>> For some ethnet-switch like intel RRC, all the packet forwarded
>> out by DPDK will be dropped in switch side, so the packet
>> generator will never receive the packet.
>>
>> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>> ---
>>  app/test-pmd/csumonly.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
>> index 1bf3485..bf8af1d 100644
>> --- a/app/test-pmd/csumonly.c
>> +++ b/app/test-pmd/csumonly.c
>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
>> *fs)
>>  		 * and inner headers */
>>
>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>> +				&eth_hdr->d_addr);
>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>> +				&eth_hdr->s_addr);
>>  		parse_ethernet(eth_hdr, &info);
>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>
>> --
>> 1.9.3
> Why do you make this change only in this mode? If NICs like RRC has this issue,
> I assume it would happen in other modes.

Yes, exactly, but for iofwd if we change the mac, so the mode is changed
.... am I right?

Thanks,
Michael

> Thanks,
> Pablo
>
  
Michael Qiu Aug. 7, 2015, 6:52 p.m. UTC | #4
On 2015/8/7 9:06, Zhang, Helin wrote:
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
>> Sent: Thursday, August 6, 2015 8:29 PM
>> To: dev@dpdk.org
>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
>>
>> For some ethnet-switch like intel RRC, all the packet forwarded out by DPDK will
>> be dropped in switch side, so the packet generator will never receive the packet.
> Is it because of anti-sproof? E.g. When the hardware found that the dest mac is the
> port itself, then it will be dropped during TX.
> You need to tell the root cause, and why we need to modify like this.

Actually, it is not the hardware from PEP(PCI End Point) side, but the
switch side.

The TX is OK for DPDK and NIC, but in switch, it receives the packet and
try to forward it, but the dest mac is the same as the NIC which
transmit this packet.
So switch will drop it as "Loopback Suppression Drop" in RRC. This
should only happen when switch forwarding packets using dest mac.

 
>
>> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>> ---
>>  app/test-pmd/csumonly.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
>> 1bf3485..bf8af1d 100644
>> --- a/app/test-pmd/csumonly.c
>> +++ b/app/test-pmd/csumonly.c
>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
>>  		 * and inner headers */
>>
>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>> +				&eth_hdr->d_addr);
>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>> +				&eth_hdr->s_addr);
> Is it really necessary? Why other NICs do not need this?

Because other NICs is connect directly to packet generator...., if we
using switch to connect the generator and the NICs, I think it will need
this.

Thanks,
Michael
>
>>  		parse_ethernet(eth_hdr, &info);
>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>
>> --
>> 1.9.3
>
  
Zhang, Helin Aug. 7, 2015, 8:37 p.m. UTC | #5
> -----Original Message-----
> From: Qiu, Michael
> Sent: Friday, August 7, 2015 11:53 AM
> To: Zhang, Helin; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
> 
> On 2015/8/7 9:06, Zhang, Helin wrote:
> >
> >> -----Original Message-----
> >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> >> Sent: Thursday, August 6, 2015 8:29 PM
> >> To: dev@dpdk.org
> >> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum
> >> forwarding
> >>
> >> For some ethnet-switch like intel RRC, all the packet forwarded out
> >> by DPDK will be dropped in switch side, so the packet generator will never
> receive the packet.
> > Is it because of anti-sproof? E.g. When the hardware found that the
> > dest mac is the port itself, then it will be dropped during TX.
> > You need to tell the root cause, and why we need to modify like this.
> 
> Actually, it is not the hardware from PEP(PCI End Point) side, but the switch side.
> 
> The TX is OK for DPDK and NIC, but in switch, it receives the packet and try to
> forward it, but the dest mac is the same as the NIC which transmit this packet.
> So switch will drop it as "Loopback Suppression Drop" in RRC. This should only
> happen when switch forwarding packets using dest mac.
> 
> 
> >
> >> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> >> ---
> >>  app/test-pmd/csumonly.c | 4 ++++
> >>  1 file changed, 4 insertions(+)
> >>
> >> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> >> 1bf3485..bf8af1d 100644
> >> --- a/app/test-pmd/csumonly.c
> >> +++ b/app/test-pmd/csumonly.c
> >> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
> *fs)
> >>  		 * and inner headers */
> >>
> >>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> >> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
> >> +				&eth_hdr->d_addr);
> >> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
> >> +				&eth_hdr->s_addr);
> > Is it really necessary? Why other NICs do not need this?
> 
> Because other NICs is connect directly to packet generator...., if we using switch
> to connect the generator and the NICs, I think it will need this.
There are 'iofwd' and 'mac' mode in testpmd, and mac forware will modify the dest
mac before transmitting the packet. They are for different cases.
Why not use mac forwarding mode for your testing, and just keep it as is?

Regards,
Helin

> 
> Thanks,
> Michael
> >
> >>  		parse_ethernet(eth_hdr, &info);
> >>  		l3_hdr = (char *)eth_hdr + info.l2_len;
> >>
> >> --
> >> 1.9.3
> >
  
Michael Qiu Aug. 7, 2015, 9:16 p.m. UTC | #6
On 2015/8/7 13:37, Zhang, Helin wrote:
>
>> -----Original Message-----
>> From: Qiu, Michael
>> Sent: Friday, August 7, 2015 11:53 AM
>> To: Zhang, Helin; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
>>
>> On 2015/8/7 9:06, Zhang, Helin wrote:
>>>> -----Original Message-----
>>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
>>>> Sent: Thursday, August 6, 2015 8:29 PM
>>>> To: dev@dpdk.org
>>>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum
>>>> forwarding
>>>>
>>>> For some ethnet-switch like intel RRC, all the packet forwarded out
>>>> by DPDK will be dropped in switch side, so the packet generator will never
>> receive the packet.
>>> Is it because of anti-sproof? E.g. When the hardware found that the
>>> dest mac is the port itself, then it will be dropped during TX.
>>> You need to tell the root cause, and why we need to modify like this.
>> Actually, it is not the hardware from PEP(PCI End Point) side, but the switch side.
>>
>> The TX is OK for DPDK and NIC, but in switch, it receives the packet and try to
>> forward it, but the dest mac is the same as the NIC which transmit this packet.
>> So switch will drop it as "Loopback Suppression Drop" in RRC. This should only
>> happen when switch forwarding packets using dest mac.
>>
>>
>>>> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>>>> ---
>>>>  app/test-pmd/csumonly.c | 4 ++++
>>>>  1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
>>>> 1bf3485..bf8af1d 100644
>>>> --- a/app/test-pmd/csumonly.c
>>>> +++ b/app/test-pmd/csumonly.c
>>>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
>> *fs)
>>>>  		 * and inner headers */
>>>>
>>>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>>>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>>>> +				&eth_hdr->d_addr);
>>>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>>>> +				&eth_hdr->s_addr);
>>> Is it really necessary? Why other NICs do not need this?
>> Because other NICs is connect directly to packet generator...., if we using switch
>> to connect the generator and the NICs, I think it will need this.
> There are 'iofwd' and 'mac' mode in testpmd, and mac forware will modify the dest
> mac before transmitting the packet. They are for different cases.
> Why not use mac forwarding mode for your testing, and just keep it as is?

Yes, I don't touch iofwd, I just modify the csum, when we test checksum
offload, especially for checksum insert in TX side.

Thanks,
Michael

> Regards,
> Helin
>
>> Thanks,
>> Michael
>>>>  		parse_ethernet(eth_hdr, &info);
>>>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>>>
>>>> --
>>>> 1.9.3
>
  
Ouyang Changchun Aug. 8, 2015, 12:13 a.m. UTC | #7
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Helin
> Sent: Saturday, August 8, 2015 12:07 AM
> To: Qiu, Michael; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum
> forwarding
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> > Sent: Thursday, August 6, 2015 8:29 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
> >
> > For some ethnet-switch like intel RRC, all the packet forwarded out by
> > DPDK will be dropped in switch side, so the packet generator will never
> receive the packet.
> Is it because of anti-sproof? E.g. When the hardware found that the dest mac
> is the port itself, then it will be dropped during TX.
> You need to tell the root cause, and why we need to modify like this.
> 
> >
> > Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> > ---
> >  app/test-pmd/csumonly.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> > 1bf3485..bf8af1d 100644
> > --- a/app/test-pmd/csumonly.c
> > +++ b/app/test-pmd/csumonly.c
> > @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
> *fs)
> >  		 * and inner headers */
> >
> >  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> > +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
> > +				&eth_hdr->d_addr);
> > +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
> > +				&eth_hdr->s_addr);
> Is it really necessary? Why other NICs do not need this?
> 

Seems the behavior changes from io fwd into mac fwd?

> >  		parse_ethernet(eth_hdr, &info);
> >  		l3_hdr = (char *)eth_hdr + info.l2_len;
> >
> > --
> > 1.9.3
  
Michael Qiu Aug. 10, 2015, 4:45 a.m. UTC | #8
On 2015/8/7 17:13, Ouyang, Changchun wrote:
>
>>

[.../...]

>>
>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>> +				&eth_hdr->d_addr);
>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>> +				&eth_hdr->s_addr);
>> Is it really necessary? Why other NICs do not need this?
>>
> Seems the behavior changes from io fwd into mac fwd?

Yes, but I think it is no influence for checksum offload.

Thanks,
Michael
>>>  		parse_ethernet(eth_hdr, &info);
>>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>>
>>> --
>>> 1.9.3
>
  
Jijiang Liu Aug. 26, 2015, 6:12 a.m. UTC | #9
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> Sent: Friday, August 07, 2015 11:29 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
> 
> For some ethnet-switch like intel RRC, all the packet forwarded out by DPDK
> will be dropped in switch side, so the packet generator will never receive the
> packet.
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> ---
>  app/test-pmd/csumonly.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> 1bf3485..bf8af1d 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
> *fs)
>  		 * and inner headers */
> 
>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
> +				&eth_hdr->d_addr);
> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
> +				&eth_hdr->s_addr);
>  		parse_ethernet(eth_hdr, &info);
>  		l3_hdr = (char *)eth_hdr + info.l2_len;
> 
> --
> 1.9.3
The change will affect on the csum fwd performance.
But I also think the change is necessary, or we cannot use csumonly fwd mode in guest。

Acked-by: Jijiang Liu <Jijiang.liu@intel.com>
  
Michael Qiu Sept. 14, 2015, 3:37 a.m. UTC | #10
Hi, all

any other comments about this patch?

Thanks,
Michael

On 8/26/2015 2:12 PM, Liu, Jijiang wrote:
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
>> Sent: Friday, August 07, 2015 11:29 AM
>> To: dev@dpdk.org
>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
>>
>> For some ethnet-switch like intel RRC, all the packet forwarded out by DPDK
>> will be dropped in switch side, so the packet generator will never receive the
>> packet.
>>
>> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>> ---
>>  app/test-pmd/csumonly.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
>> 1bf3485..bf8af1d 100644
>> --- a/app/test-pmd/csumonly.c
>> +++ b/app/test-pmd/csumonly.c
>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
>> *fs)
>>  		 * and inner headers */
>>
>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>> +				&eth_hdr->d_addr);
>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>> +				&eth_hdr->s_addr);
>>  		parse_ethernet(eth_hdr, &info);
>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>
>> --
>> 1.9.3
> The change will affect on the csum fwd performance.
> But I also think the change is necessary, or we cannot use csumonly fwd mode in guest。
>
> Acked-by: Jijiang Liu <Jijiang.liu@intel.com>
>
>
  
Michael Qiu Oct. 13, 2015, 6:29 a.m. UTC | #11
Hi, Thomas

Any comments on this patch? Is it suitable for DPDK?

Thanks,
Michael
On 2015/8/26 14:12, Liu, Jijiang wrote:
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
>> Sent: Friday, August 07, 2015 11:29 AM
>> To: dev@dpdk.org
>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding
>>
>> For some ethnet-switch like intel RRC, all the packet forwarded out by DPDK
>> will be dropped in switch side, so the packet generator will never receive the
>> packet.
>>
>> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>> ---
>>  app/test-pmd/csumonly.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
>> 1bf3485..bf8af1d 100644
>> --- a/app/test-pmd/csumonly.c
>> +++ b/app/test-pmd/csumonly.c
>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream
>> *fs)
>>  		 * and inner headers */
>>
>>  		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
>> +		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
>> +				&eth_hdr->d_addr);
>> +		ether_addr_copy(&ports[fs->tx_port].eth_addr,
>> +				&eth_hdr->s_addr);
>>  		parse_ethernet(eth_hdr, &info);
>>  		l3_hdr = (char *)eth_hdr + info.l2_len;
>>
>> --
>> 1.9.3
> The change will affect on the csum fwd performance.
> But I also think the change is necessary, or we cannot use csumonly fwd mode in guest。
>
> Acked-by: Jijiang Liu <Jijiang.liu@intel.com>
>
>
  
Thomas Monjalon Oct. 24, 2015, 4:52 p.m. UTC | #12
2015-10-13 06:29, Qiu, Michael:
> Hi, Thomas
> 
> Any comments on this patch? Is it suitable for DPDK?

Please check with the testpmd maintainer.
Pablo?
  
De Lara Guarch, Pablo Oct. 26, 2015, 7:47 p.m. UTC | #13
HI,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Saturday, October 24, 2015 5:52 PM
> To: Qiu, Michael
> Cc: dev@dpdk.org; Liu, Jijiang; De Lara Guarch, Pablo
> Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum
> forwarding
> 
> 2015-10-13 06:29, Qiu, Michael:
> > Hi, Thomas
> >
> > Any comments on this patch? Is it suitable for DPDK?
> 
> Please check with the testpmd maintainer.
> Pablo?

The patch looks harmless for other NICs, and it does similar stuff as other forwarding modes,
so I think it is safe to integrate.

Thanks,
Pablo
  
Thomas Monjalon Oct. 29, 2015, 10:55 p.m. UTC | #14
2015-10-26 19:47, De Lara Guarch, Pablo:
> > 2015-10-13 06:29, Qiu, Michael:
> > > Hi, Thomas
> > >
> > > Any comments on this patch? Is it suitable for DPDK?
> > 
> > Please check with the testpmd maintainer.
> > Pablo?
> 
> The patch looks harmless for other NICs, and it does similar stuff as other forwarding modes,
> so I think it is safe to integrate.

Applied, thanks
  

Patch

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 1bf3485..bf8af1d 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -550,6 +550,10 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 		 * and inner headers */
 
 		eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+		ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
+				&eth_hdr->d_addr);
+		ether_addr_copy(&ports[fs->tx_port].eth_addr,
+				&eth_hdr->s_addr);
 		parse_ethernet(eth_hdr, &info);
 		l3_hdr = (char *)eth_hdr + info.l2_len;