From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4B9281BBBB; Fri, 27 Oct 2017 04:23:35 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 26 Oct 2017 19:23:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,303,1505804400"; d="scan'208";a="165567667" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga005.jf.intel.com with ESMTP; 26 Oct 2017 19:23:34 -0700 Received: from fmsmsx126.amr.corp.intel.com (10.18.125.43) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 26 Oct 2017 19:23:33 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX126.amr.corp.intel.com (10.18.125.43) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 26 Oct 2017 19:23:33 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by shsmsx102.ccr.corp.intel.com ([169.254.2.175]) with mapi id 14.03.0319.002; Fri, 27 Oct 2017 10:23:31 +0800 From: "Xing, Beilei" To: Iain Barker , "users@dpdk.org" CC: "dev@dpdk.org" Thread-Topic: [dpdk-users] VLAN tags always stripped on i40evf [VMware SR-IOV] Thread-Index: AQHTQc6I2eXMmhqNAUG0LYDnqRr+eaLeHXeAgBjwcHA= Date: Fri, 27 Oct 2017 02:23:30 +0000 Message-ID: <94479800C636CB44BD422CB454846E013205FCB4@SHSMSX101.ccr.corp.intel.com> References: <6a275bea-214e-489b-ba42-df70328b3854@default> <93359c04-0da3-4f3c-ba56-799817775781@default> In-Reply-To: <93359c04-0da3-4f3c-ba56-799817775781@default> 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-users] VLAN tags always stripped on i40evf [VMware SR-IOV] X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Oct 2017 02:23:37 -0000 > -----Original Message----- > From: users [mailto:users-bounces@dpdk.org] On Behalf Of Iain Barker > Sent: Wednesday, October 11, 2017 9:20 PM > To: users@dpdk.org > Cc: dev@dpdk.org > Subject: Re: [dpdk-users] VLAN tags always stripped on i40evf [VMware SR- > IOV] >=20 > On Tuesday, October 10, 2017 9:49 AM (EST), Iain Barker wrote: > > I have a problem trying to get VLAN tagged frames to be received at the > i40evf PMD. >=20 > With more debugging enabled, I can see that this seems to be a compatibil= ity > problem between DPDK and i40evf related to VLAN hardware stripping. >=20 > Specifically, when DPDK requests VLAN stripping to be disabled by VF, but > the PF policy doesn't allow it to be disabled (as is the case for VMware = SR- > IOV), an error is returned from the API. >=20 > testpmd> vlan set strip off 0 > i40evf_execute_vf_cmd(): No response for 28 > i40evf_disable_vlan_strip(): Failed to execute command of > VIRTCHNL_OP_DISABLE_VLAN_STRIPPING >=20 > In that case, received frames with VLAN headers will still be stripped at= the > PF, and the TCI will record the missing VLAN details when handed up to th= e > DPDK driver. >=20 > With i40e debug enabled, it's clear to see the difference being reported = in > i40e_rxd_to_vlan_tci: >=20 > Example using VLAN on i40e PCI (vlan works): > PMD: i40e_rxd_to_vlan_tci(): Mbuf vlan_tci: 0, vlan_tci_outer: 0 > Port 0 pkt-len=3D102 nb-segs=3D1 > ETH: src=3D00:10:E0:8D:A7:52 dst=3D00:10:E0:8A:86:8A [vlan id=3D8] t= ype=3D0x0800 > IPV4: src=3D8.8.8.102 dst=3D8.8.8.3 proto=3D1 (ICMP) > ICMP: echo request seq id=3D1 >=20 > Example using VLAN on i40evf SR-IOV (vlan fails): > PMD: i40e_rxd_to_vlan_tci(): Mbuf vlan_tci: 8, vlan_tci_outer: 0 > Port 0 pkt-len=3D60 nb-segs=3D1 > ETH: src=3D00:10:E0:8D:A7:52 dst=3DFF:FF:FF:FF:FF:FF type=3D0x0806 > ARP: hrd=3D1 proto=3D0x0800 hln=3D6 pln=3D4 op=3D1 (ARP Request) > sha=3D00:10:E0:8D:A7:52 sip=3D8.8.8.102 > tha=3D00:00:00:00:00:00 tip=3D8.8.8.3 >=20 > As the application requested tagging not be stripped, and the hardware > driver was not able to disable strip, in my opinion DPDK should emulate t= he > requested behavior by re-add the missing VLAN header in the RX thread, > before it passes the mbuf to the application. I'm guessing that the nati= ve > Linux driver is smart enough to do something like this automatically in > software, but DPDK does not... >=20 > Adding a call to rte_vlan_insert() to reinstate the VLAN header using the= data > from TCI is sufficient to avoid the problem in a quick test. >=20 > --- drivers/net/i40e/i40e_rxtx.c.orig 2016-11-30 04:28:48.000000000 = -0500 > +++ drivers/net/i40e/i40e_rxtx.c 2017-10-10 15:07:10.851398087 -0400 > @@ -93,6 +93,8 @@ > rte_le_to_cpu_16(rxdp->wb.qword0.lo_dword.l2tag1)= ; > PMD_RX_LOG(DEBUG, "Descriptor l2tag1: %u", > rte_le_to_cpu_16(rxdp->wb.qword0.lo_dword.l2ta= g1)); > + // vlan got stripped. Re-inject vlan from tci > + rte_vlan_insert(&mb); > } else { > mb->vlan_tci =3D 0; > } >=20 NACK this patch as it will impact performance. VLAN strip is supported by latest i40e kernel driver, it works well in kern= el PF + DPDK VF mode with i40e kernel driver 2.1.26 and DPDK 17.08. Please refer to Latest kernel driver. Beilei > For a proper solution, this would need to be made selective based on > whether the port config originally asked for VLANs to be stripped or not.= But > I'm not sure that rte_vlan_insert() has enough context to be able to acce= ss > that data, as it's stored in the driver/hw struct not the rx buffer. >=20 > Obviously the same would be required in the vector rxtx and similar data > paths for other drivers, if affected by the same shortcoming. I don't ha= ve > other combinations available that I could test with, and I guess VMware > i40evf SR-IOV VLAN isn't part of the DPDK release test suite either. >=20 > cc: dev@dpdk.org for comment as this is getting beyond my level of > knowledge as a DPDK user >=20 > thanks, > Iain