From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 2A9118DA6 for ; Fri, 20 Nov 2015 03:33:14 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 19 Nov 2015 18:33:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,320,1444719600"; d="scan'208";a="690069221" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 19 Nov 2015 18:33:13 -0800 Received: from fmsmsx122.amr.corp.intel.com (10.18.125.37) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 Nov 2015 18:33:12 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx122.amr.corp.intel.com (10.18.125.37) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 19 Nov 2015 18:33:12 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.42]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.138]) with mapi id 14.03.0248.002; Fri, 20 Nov 2015 10:33:10 +0800 From: "He, Shaopeng" To: "Chen, Jing D" , "dev@dpdk.org" Thread-Topic: [PATCH] fm10k: fix wrong VLAN value in RX mbuf Thread-Index: AQHRId4x8PqGeCNCJE604iYU60znK56iZ2yAgAGyjFA= Date: Fri, 20 Nov 2015 02:33:09 +0000 Message-ID: References: <1447836609-23944-1-git-send-email-shaopeng.he@intel.com> <4341B239C0EFF9468EE453F9E9F4604D02B0AAD2@shsmsx102.ccr.corp.intel.com> In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D02B0AAD2@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, 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] fm10k: fix wrong VLAN value in RX mbuf 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, 20 Nov 2015 02:33:14 -0000 Hi, Mark > -----Original Message----- > From: Chen, Jing D > Sent: Thursday, November 19, 2015 3:05 PM > To: He, Shaopeng; dev@dpdk.org > Cc: Qiu, Michael > Subject: RE: [PATCH] fm10k: fix wrong VLAN value in RX mbuf >=20 > Hi, >=20 > Worth to adding comments that vlan_tci is only valid in case > RTE_LIBRTE_FM10K_RX_OLFLAGS_ENABLE is turned on and Flag > PKT_RX_VLAN_PKT is set. Good suggestion. But, actually, we have a little different case in fm10k: fm10k has a switch core inside, which associates a VLAN ID for each packet. For those packets coming in without a VLAN, the port default VLAN ID will be used. So for fm10k, vlan_tci is always valid.=20 For Flag PKT_RX_VLAN_PKT, currently it will be set when there is inner VLAN in the packet. This is not correct, I will fix it by setting PKT_RX_VLAN_PK= T always on in next version. To verify this, different situations have been tested on current implementation: 1. Ixia sent VLAN 51 packet, DPDK received: vlan_tci=3D51, PKT_RX_VLAN_PKT= =3D0 2. sent non-VLAN packet, ether port's default VLAN ID is 1 received: vlan_tci=3D1, PKT_RX_VLAN_PKT=3D0 3. sent double-VLAN packet (outer 51, inner 17), received: vlan_tci=3D51, PKT_RX_VLAN_PKT=3D1 Thanks, --Shaopeng >=20 > Best Regards, > Mark >=20 >=20 > > -----Original Message----- > > From: He, Shaopeng > > Sent: Wednesday, November 18, 2015 4:50 PM > > To: dev@dpdk.org > > Cc: Chen, Jing D; Qiu, Michael; He, Shaopeng > > Subject: [PATCH] fm10k: fix wrong VLAN value in RX mbuf > > > > VLAN value should be copied from RX descriptor to mbuf, this patch > > fixes this issue. > > > > Signed-off-by: Shaopeng He > > --- > > drivers/net/fm10k/fm10k_rxtx.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/net/fm10k/fm10k_rxtx.c > > b/drivers/net/fm10k/fm10k_rxtx.c index 1bac28d..eeb635e 100644 > > --- a/drivers/net/fm10k/fm10k_rxtx.c > > +++ b/drivers/net/fm10k/fm10k_rxtx.c > > @@ -146,6 +146,7 @@ fm10k_recv_pkts(void *rx_queue, struct rte_mbuf > > **rx_pkts, #endif > > > > mbuf->hash.rss =3D desc.d.rss; > > + mbuf->vlan_tci =3D desc.w.vlan & > > FM10K_RXD_VLAN_ID_MASK; > > > > rx_pkts[count] =3D mbuf; > > if (++next_dd =3D=3D q->nb_desc) { > > @@ -292,6 +293,7 @@ fm10k_recv_scattered_pkts(void *rx_queue, struct > > rte_mbuf **rx_pkts, > > rx_desc_to_ol_flags(first_seg, &desc); #endif > > first_seg->hash.rss =3D desc.d.rss; > > + first_seg->vlan_tci =3D desc.w.vlan & > > FM10K_RXD_VLAN_ID_MASK; > > > > /* Prefetch data of first segment, if configured to do so. */ > > rte_packet_prefetch((char *)first_seg->buf_addr + > > -- > > 1.9.3