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 862325A68 for ; Fri, 20 Nov 2015 15:23:45 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2015 06:23:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,323,1444719600"; d="scan'208";a="604118450" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by FMSMGA003.fm.intel.com with ESMTP; 20 Nov 2015 06:23:44 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 20 Nov 2015 06:23:44 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 20 Nov 2015 06:23:43 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.42]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.193]) with mapi id 14.03.0248.002; Fri, 20 Nov 2015 22:23:42 +0800 From: "He, Shaopeng" To: "Chen, Jing D" , "dev@dpdk.org" Thread-Topic: [PATCH v2] fm10k: fix wrong VLAN value in RX mbuf Thread-Index: AQHRI1zIxWwDN0yLEUCFqsa/eBEzhZ6kMWKAgADFsOA= Date: Fri, 20 Nov 2015 14:23:41 +0000 Message-ID: References: <1447836609-23944-1-git-send-email-shaopeng.he@intel.com> <1448000935-29391-1-git-send-email-shaopeng.he@intel.com> <4341B239C0EFF9468EE453F9E9F4604D02B0B44D@shsmsx102.ccr.corp.intel.com> In-Reply-To: <4341B239C0EFF9468EE453F9E9F4604D02B0B44D@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 v2] 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 14:23:46 -0000 Hi, Mark > -----Original Message----- > From: Chen, Jing D > Sent: Friday, November 20, 2015 6:35 PM > To: He, Shaopeng; dev@dpdk.org > Cc: Qiu, Michael > Subject: RE: [PATCH v2] fm10k: fix wrong VLAN value in RX mbuf >=20 > > Signed-off-by: Shaopeng He > > --- > > ChangeLog: > > > > v2: > > * change flag PKT_RX_VLAN_PKT to always set > > * preserve the priority bits in vlan_tci > > > > drivers/net/fm10k/fm10k_rxtx.c | 14 ++++++++++++-- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/net/fm10k/fm10k_rxtx.c > > b/drivers/net/fm10k/fm10k_rxtx.c index 1bac28d..764f4f4 100644 > > --- a/drivers/net/fm10k/fm10k_rxtx.c > > +++ b/drivers/net/fm10k/fm10k_rxtx.c > > @@ -104,8 +104,14 @@ rx_desc_to_ol_flags(struct rte_mbuf *m, const > > union fm10k_rx_desc *d) > > (FM10K_RXD_STATUS_L4CS | FM10K_RXD_STATUS_L4E))) > > m->ol_flags |=3D PKT_RX_L4_CKSUM_BAD; > > > > - if (d->d.staterr & FM10K_RXD_STATUS_VEXT) > > - m->ol_flags |=3D PKT_RX_VLAN_PKT; > > + /** > > + * fm10k's Ethernet switch core associates a VLAN ID and VLAN PRI >=20 > Change to Packets in fm10k device always carries a vlan tag? >=20 > > + * for each packet. For those packets coming in without a VLAN, > > + * the port default VLAN ID will be used. > > + * So in fm10k, always PKT_RX_VLAN_PKT flag is set and vlan_tci > > + * is valid for each RX packet's mbuf. > > + */ > > + m->ol_flags |=3D PKT_RX_VLAN_PKT; >=20 > Since vlan_tci is always valid, is it better to move above line to below = added > lines? Sure, I will send V3 Thanks, --Shaopeng >=20 > > > > if (unlikely(d->d.staterr & FM10K_RXD_STATUS_HBO)) > > m->ol_flags |=3D PKT_RX_HBUF_OVERFLOW; @@ -146,6 > +152,8 @@ > > fm10k_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, #endif > > > > mbuf->hash.rss =3D desc.d.rss; > > + /* in fm10k, vlan_tci is always valid for RX packet */ > > + mbuf->vlan_tci =3D desc.w.vlan; > > > > rx_pkts[count] =3D mbuf; > > if (++next_dd =3D=3D q->nb_desc) { > > @@ -292,6 +300,8 @@ 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; > > + /* in fm10k, vlan_tci is always valid for RX packet */ > > + first_seg->vlan_tci =3D desc.w.vlan; > > > > /* Prefetch data of first segment, if configured to do so. */ > > rte_packet_prefetch((char *)first_seg->buf_addr + > > -- > > 1.9.3 >=20