From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id AAEA68DB4 for ; Fri, 20 Nov 2015 11:35:07 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 20 Nov 2015 02:35:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,321,1444719600"; d="scan'208";a="843248979" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2015 02:35:04 -0800 Received: from fmsmsx120.amr.corp.intel.com (10.18.124.208) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 20 Nov 2015 02:35:04 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx120.amr.corp.intel.com (10.18.124.208) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 20 Nov 2015 02:35:04 -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 18:35:02 +0800 From: "Chen, Jing D" To: "He, Shaopeng" , "dev@dpdk.org" Thread-Topic: [PATCH v2] fm10k: fix wrong VLAN value in RX mbuf Thread-Index: AQHRI1zI4gaZAhoZX02lDePbp8gWB56kszJA Date: Fri, 20 Nov 2015 10:35:01 +0000 Message-ID: <4341B239C0EFF9468EE453F9E9F4604D02B0B44D@shsmsx102.ccr.corp.intel.com> References: <1447836609-23944-1-git-send-email-shaopeng.he@intel.com> <1448000935-29391-1-git-send-email-shaopeng.he@intel.com> In-Reply-To: <1448000935-29391-1-git-send-email-shaopeng.he@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 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 10:35:08 -0000 > Signed-off-by: Shaopeng He > --- > ChangeLog: >=20 > v2: > * change flag PKT_RX_VLAN_PKT to always set > * preserve the priority bits in vlan_tci >=20 > drivers/net/fm10k/fm10k_rxtx.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) >=20 > 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; >=20 > - 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 Change to Packets in fm10k device always carries a vlan tag? > + * 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; Since vlan_tci is always valid, is it better to move above line to below ad= ded lines? >=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 >=20 > mbuf->hash.rss =3D desc.d.rss; > + /* in fm10k, vlan_tci is always valid for RX packet */ > + mbuf->vlan_tci =3D desc.w.vlan; >=20 > 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; >=20 > /* Prefetch data of first segment, if configured to do so. */ > rte_packet_prefetch((char *)first_seg->buf_addr + > -- > 1.9.3