From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 8CF395682 for ; Fri, 7 Aug 2015 23:16:44 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 07 Aug 2015 14:16:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,631,1432623600"; d="scan'208";a="621409846" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by orsmga003.jf.intel.com with ESMTP; 07 Aug 2015 14:16:20 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sat, 8 Aug 2015 05:16:19 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.18]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.38]) with mapi id 14.03.0224.002; Sat, 8 Aug 2015 05:16:12 +0800 From: "Qiu, Michael" To: "Zhang, Helin" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding Thread-Index: AQHQ0MFHSfXj+Pb4lkOSv1X8Ti16cA== Date: Fri, 7 Aug 2015 21:16:11 +0000 Message-ID: <533710CFB86FA344BFBF2D6802E6028604703973@SHSMSX101.ccr.corp.intel.com> References: <1438918156-1259-1-git-send-email-michael.qiu@intel.com> <533710CFB86FA344BFBF2D6802E6028604703736@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwarding X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2015 21:16:45 -0000 On 2015/8/7 13:37, Zhang, Helin wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: Qiu, Michael=0A= >> Sent: Friday, August 7, 2015 11:53 AM=0A= >> To: Zhang, Helin; dev@dpdk.org=0A= >> Subject: Re: [dpdk-dev] [PATCH] testpmd: modify the mac of csum forwardi= ng=0A= >>=0A= >> On 2015/8/7 9:06, Zhang, Helin wrote:=0A= >>>> -----Original Message-----=0A= >>>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu=0A= >>>> Sent: Thursday, August 6, 2015 8:29 PM=0A= >>>> To: dev@dpdk.org=0A= >>>> Subject: [dpdk-dev] [PATCH] testpmd: modify the mac of csum=0A= >>>> forwarding=0A= >>>>=0A= >>>> For some ethnet-switch like intel RRC, all the packet forwarded out=0A= >>>> by DPDK will be dropped in switch side, so the packet generator will n= ever=0A= >> receive the packet.=0A= >>> Is it because of anti-sproof? E.g. When the hardware found that the=0A= >>> dest mac is the port itself, then it will be dropped during TX.=0A= >>> You need to tell the root cause, and why we need to modify like this.= =0A= >> Actually, it is not the hardware from PEP(PCI End Point) side, but the s= witch side.=0A= >>=0A= >> The TX is OK for DPDK and NIC, but in switch, it receives the packet and= try to=0A= >> forward it, but the dest mac is the same as the NIC which transmit this = packet.=0A= >> So switch will drop it as "Loopback Suppression Drop" in RRC. This shoul= d only=0A= >> happen when switch forwarding packets using dest mac.=0A= >>=0A= >>=0A= >>>> Signed-off-by: Michael Qiu =0A= >>>> ---=0A= >>>> app/test-pmd/csumonly.c | 4 ++++=0A= >>>> 1 file changed, 4 insertions(+)=0A= >>>>=0A= >>>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index= =0A= >>>> 1bf3485..bf8af1d 100644=0A= >>>> --- a/app/test-pmd/csumonly.c=0A= >>>> +++ b/app/test-pmd/csumonly.c=0A= >>>> @@ -550,6 +550,10 @@ pkt_burst_checksum_forward(struct fwd_stream=0A= >> *fs)=0A= >>>> * and inner headers */=0A= >>>>=0A= >>>> eth_hdr =3D rte_pktmbuf_mtod(m, struct ether_hdr *);=0A= >>>> + ether_addr_copy(&peer_eth_addrs[fs->peer_addr],=0A= >>>> + ð_hdr->d_addr);=0A= >>>> + ether_addr_copy(&ports[fs->tx_port].eth_addr,=0A= >>>> + ð_hdr->s_addr);=0A= >>> Is it really necessary? Why other NICs do not need this?=0A= >> Because other NICs is connect directly to packet generator...., if we us= ing switch=0A= >> to connect the generator and the NICs, I think it will need this.=0A= > There are 'iofwd' and 'mac' mode in testpmd, and mac forware will modify = the dest=0A= > mac before transmitting the packet. They are for different cases.=0A= > Why not use mac forwarding mode for your testing, and just keep it as is?= =0A= =0A= Yes, I don't touch iofwd, I just modify the csum, when we test checksum=0A= offload, especially for checksum insert in TX side.=0A= =0A= Thanks,=0A= Michael=0A= =0A= > Regards,=0A= > Helin=0A= >=0A= >> Thanks,=0A= >> Michael=0A= >>>> parse_ethernet(eth_hdr, &info);=0A= >>>> l3_hdr =3D (char *)eth_hdr + info.l2_len;=0A= >>>>=0A= >>>> --=0A= >>>> 1.9.3=0A= >=0A= =0A=