From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 521332E83 for ; Fri, 10 Feb 2017 12:21:19 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Feb 2017 03:21:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,141,1484035200"; d="scan'208";a="1105611189" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 10 Feb 2017 03:21:18 -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, 10 Feb 2017 03:21:18 -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, 10 Feb 2017 03:21:17 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.177]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Fri, 10 Feb 2017 19:21:16 +0800 From: "Yang, Qiming" To: "Yigit, Ferruh" , "dev@dpdk.org" CC: "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix vlan insert code redundance Thread-Index: AQHSgz3E68LiCT6C00OG7cyKacUmgqFhg2GAgACU+pA= Date: Fri, 10 Feb 2017 11:21:14 +0000 Message-ID: References: <1486689994-37746-1-git-send-email-qiming.yang@intel.com> <0425f979-8198-4cc8-f70b-f1c9a037fd7f@intel.com> In-Reply-To: <0425f979-8198-4cc8-f70b-f1c9a037fd7f@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2Y2OGYyY2QtOTBkNi00MGFjLWFkZTMtNjNmMDU5MGIwZDlmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlJsSjQwRUJOTk03S3htSkNSWFFtcUY2V2Q5RklhRzBwVHpCMFZUZ2JlUkE9In0= x-ctpclassification: CTP_IC 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] net/i40e: fix vlan insert code redundance X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2017 11:21:19 -0000 > -----Original Message----- > From: Yigit, Ferruh > Sent: Friday, February 10, 2017 6:25 PM > To: Yang, Qiming ; dev@dpdk.org > Cc: Wu, Jingjing > Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix vlan insert code redundance >=20 > On 2/10/2017 1:26 AM, Qiming Yang wrote: > > This patch removed useless tx_flags in vlan insertion. >=20 > Overall this looks good, I wonder what was the initial intention of this = code, > understanding it helps to figure out if there is a hidden defect.=20 Thank you for your remind. I'll investigate it. >=20 > This code not fixes a defect, but improves the code, is there any > performance gain with this? I'll do more test and give you a feedback.=20 > If not, I am for deferring this to next release. >=20 > > > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > > > > Signed-off-by: Qiming Yang > > --- > > drivers/net/i40e/i40e_rxtx.c | 8 +------- > > drivers/net/i40e/i40e_rxtx.h | 2 -- > > 2 files changed, 1 insertion(+), 9 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c > > b/drivers/net/i40e/i40e_rxtx.c index 608685f..b91cd70 100644 > > --- a/drivers/net/i40e/i40e_rxtx.c > > +++ b/drivers/net/i40e/i40e_rxtx.c > > @@ -1026,7 +1026,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, uint16_t nb_pkts) > > uint16_t nb_tx; > > uint32_t td_cmd; > > uint32_t td_offset; > > - uint32_t tx_flags; > > uint32_t td_tag; > > uint64_t ol_flags; > > uint16_t nb_used; > > @@ -1050,7 +1049,6 @@ i40e_xmit_pkts(void *tx_queue, struct rte_mbuf > **tx_pkts, uint16_t nb_pkts) > > td_cmd =3D 0; > > td_tag =3D 0; > > td_offset =3D 0; > > - tx_flags =3D 0; > > > > tx_pkt =3D *tx_pkts++; > > RTE_MBUF_PREFETCH_TO_FREE(txe->mbuf); > > @@ -1097,12 +1095,8 @@ i40e_xmit_pkts(void *tx_queue, struct > rte_mbuf > > **tx_pkts, uint16_t nb_pkts) > > > > /* Descriptor based VLAN insertion */ > > if (ol_flags & (PKT_TX_VLAN_PKT | PKT_TX_QINQ_PKT)) { > > - tx_flags |=3D tx_pkt->vlan_tci << > > - I40E_TX_FLAG_L2TAG1_SHIFT; > > - tx_flags |=3D I40E_TX_FLAG_INSERT_VLAN; >=20 > The I40E_TX_FLAG_INSERT_VLAN flag also seems used only here, and can be > removed. >=20 > Also I40E_TX_FLAG_CSUM and I40E_TX_FLAG_TSYN seems not used at all, > understanding why they are introduced at first place can be useful. >=20 > > td_cmd |=3D I40E_TX_DESC_CMD_IL2TAG1; > > - td_tag =3D (tx_flags & I40E_TX_FLAG_L2TAG1_MASK) >> > > - > I40E_TX_FLAG_L2TAG1_SHIFT; > > + td_tag =3D tx_pkt->vlan_tci; > > } > > > > /* Always enable CRC offload insertion */ diff --git > > a/drivers/net/i40e/i40e_rxtx.h b/drivers/net/i40e/i40e_rxtx.h index > > 9df8a56..3d4abdc 100644 > > --- a/drivers/net/i40e/i40e_rxtx.h > > +++ b/drivers/net/i40e/i40e_rxtx.h > > @@ -38,8 +38,6 @@ > > * 32 bits tx flags, high 16 bits for L2TAG1 (VLAN), > > * low 16 bits for others. > > */ > > -#define I40E_TX_FLAG_L2TAG1_SHIFT 16 > > -#define I40E_TX_FLAG_L2TAG1_MASK 0xffff0000 > > #define I40E_TX_FLAG_CSUM ((uint32_t)(1 << 0)) > > #define I40E_TX_FLAG_INSERT_VLAN ((uint32_t)(1 << 1)) > > #define I40E_TX_FLAG_TSYN ((uint32_t)(1 << 2)) > >