From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 293099A for ; Fri, 17 Jan 2014 15:32:02 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 17 Jan 2014 06:33:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,670,1384329600"; d="scan'208";a="466694016" Received: from fmsmsx105.amr.corp.intel.com ([10.19.9.36]) by fmsmga002.fm.intel.com with ESMTP; 17 Jan 2014 06:28:16 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.19.9.36) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 17 Jan 2014 06:28:16 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.123.3; Fri, 17 Jan 2014 06:28:16 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.195]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.185]) with mapi id 14.03.0123.003; Fri, 17 Jan 2014 22:28:14 +0800 From: "Zhang, Helin" To: Thomas Monjalon , Daniel Kaminsky Thread-Topic: [dpdk-dev] Loop back mode of the KNI Thread-Index: AQHPE3YPn+DB6TGKDEiM9axQ4DdZ+ZqI+TKw Date: Fri, 17 Jan 2014 14:28:14 +0000 Message-ID: References: <201401171219.41797.thomas.monjalon@6wind.com> In-Reply-To: <201401171219.41797.thomas.monjalon@6wind.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 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Loop back mode of the KNI 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, 17 Jan 2014 14:32:03 -0000 Hi Thomas The final fix for that could be like below. diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxap= p/kni/kni_net.c index 9a49111..12dbcc0 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -311,7 +311,6 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni) skb_reserve(skb, 2); memcpy(skb_put(skb, len), data_kva, len); skb->dev =3D dev; - skb->protocol =3D eth_type_trans(skb, dev); skb->ip_summed =3D CHECKSUM_UNNECESSARY; dev_kfree_skb(skb); } @@ -327,7 +326,6 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni) skb_reserve(skb, 2); memcpy(skb_put(skb, len), data_kva, len); skb->dev =3D dev; - skb->protocol =3D eth_type_trans(skb, dev); skb->ip_summed =3D CHECKSUM_UNNECESSARY; kni->stats.rx_bytes +=3D len; Regards, Helin -----Original Message----- From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]=20 Sent: Friday, January 17, 2014 7:20 PM To: Daniel Kaminsky; Zhang, Helin Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Loop back mode of the KNI > > From: Daniel Kaminsky [...] > > > But when running with *lo_mode=3Dlo_mode_fifo_skb *the packets on=20 > > > the egress doesn't include the first 14 bytes (the ethernet=20 > > > header) although the packets size doesn't change. > On Wed, Dec 25, 2013 at 2:50 AM, Zhang, Helin wro= te: [...] > > Yes. That's a bug, and it will be fixed in later DPDK releases. 25/12/2013 07:57, Daniel Kaminsky: [...] > The "fix" below works for me but I don't think it's complete and=20 > correct for all kernels. >=20 > --- src/kernel/fast_kni/kni_net.c > +++ src/kernel/fast_kni/kni_net.c > @@ -353,6 +353,12 @@ > kni->stats.rx_bytes +=3D len; > kni->stats.rx_packets++; >=20 > + /* adjust the skb */ > + if (likely(skb_mac_header_was_set(skb))) { > + skb->len +=3D ETH_HLEN; > + skb->data -=3D ETH_HLEN; > + } > + > /* call tx interface */ > kni_net_tx(skb, dev); > } Thanks Daniel. Please Helin, could you share the complete patch in case Daniel's one is no= t sufficient ? -- Thomas