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 B26D0AE05 for ; Wed, 4 Feb 2015 11:54:35 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 04 Feb 2015 02:54:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,518,1418112000"; d="scan'208";a="680691572" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga002.jf.intel.com with ESMTP; 04 Feb 2015 02:54:27 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 4 Feb 2015 18:54:24 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.253]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.91]) with mapi id 14.03.0195.001; Wed, 4 Feb 2015 18:54:24 +0800 From: "Xie, Huawei" To: "Ouyang, Changchun" , "dev@dpdk.org" Thread-Topic: [PATCH v3 19/25] ether: Fix vlan strip/insert issue Thread-Index: AdBAaO8/H+6fqpB8TESISLXAIplHcg== Date: Wed, 4 Feb 2015 10:54:23 +0000 Message-ID: References: <1422326164-13697-1-git-send-email-changchun.ouyang@intel.com> <1422516249-14596-1-git-send-email-changchun.ouyang@intel.com> <1422516249-14596-20-git-send-email-changchun.ouyang@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 v3 19/25] ether: Fix vlan strip/insert issue 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: Wed, 04 Feb 2015 10:54:36 -0000 On 1/29/2015 3:24 PM, Ouyang Changchun wrote:=0A= > Need swap the data from cpu to BE(big endian) for vlan-type.=0A= >=0A= > Signed-off-by: Changchun Ouyang =0A= > ---=0A= > lib/librte_ether/rte_ether.h | 4 ++--=0A= > 1 file changed, 2 insertions(+), 2 deletions(-)=0A= >=0A= > diff --git a/lib/librte_ether/rte_ether.h b/lib/librte_ether/rte_ether.h= =0A= > index 74f71c2..0797908 100644=0A= > --- a/lib/librte_ether/rte_ether.h=0A= > +++ b/lib/librte_ether/rte_ether.h=0A= > @@ -351,7 +351,7 @@ static inline int rte_vlan_strip(struct rte_mbuf *m)= =0A= > struct ether_hdr *eh=0A= > =3D rte_pktmbuf_mtod(m, struct ether_hdr *);=0A= >=0A= > - if (eh->ether_type !=3D ETHER_TYPE_VLAN)=0A= > + if (eh->ether_type !=3D rte_cpu_to_be_16(ETHER_TYPE_VLAN))=0A= rte_be_to_cpu_16?=0A= > return -1;=0A= >=0A= > struct vlan_hdr *vh =3D (struct vlan_hdr *)(eh + 1);=0A= > @@ -401,7 +401,7 @@ static inline int rte_vlan_insert(struct rte_mbuf=0A= > **m)=0A= > return -ENOSPC;=0A= >=0A= > memmove(nh, oh, 2 * ETHER_ADDR_LEN);=0A= > - nh->ether_type =3D ETHER_TYPE_VLAN;=0A= > + nh->ether_type =3D rte_cpu_to_be_16(ETHER_TYPE_VLAN);=0A= rte_be_to_cpu_16?=0A= >=0A= > vh =3D (struct vlan_hdr *) (nh + 1);=0A= > vh->vlan_tci =3D rte_cpu_to_be_16((*m)->vlan_tci);=0A= =0A=