From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 5C639961F for ; Tue, 21 Jun 2016 07:28:16 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 20 Jun 2016 22:28:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,501,1459839600"; d="scan'208";a="1006406293" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 20 Jun 2016 22:28:16 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 20 Jun 2016 22:28:15 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 20 Jun 2016 22:28:14 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.181]) with mapi id 14.03.0248.002; Tue, 21 Jun 2016 13:28:13 +0800 From: "Peng, Yuan" To: "Tao, Zhe" , "dev@dpdk.org" CC: "Tao, Zhe" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH v3] i40e: fix olflags for vector Rx Thread-Index: AQHRxf0ZUKhkC0WNfkKGVT2LYskt95/zbjIw Date: Tue, 21 Jun 2016 05:28:12 +0000 Message-ID: <67D543A150B29E4CAAE53918F64EDAEAAABDD5@shsmsx102.ccr.corp.intel.com> References: <1465787275-13776-1-git-send-email-zhe.tao@intel.com> <1465881856-8248-1-git-send-email-zhe.tao@intel.com> In-Reply-To: <1465881856-8248-1-git-send-email-zhe.tao@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTNmZGY0NDUtYzc1OC00MDMzLTk2MzAtYTEwMzUyOTBlNzE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlV0N1VCelJjU053Z3NvNmZTd2Vya29hOTg5emRndWNYN281M1ZLZnBueW89In0= 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 v3] i40e: fix olflags for vector Rx 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: Tue, 21 Jun 2016 05:28:16 -0000 Tested-by: Peng Yuan - Test Commit: 04920e693a053a923f94c271ee68881756649cec - OS/Kernel: Fedora 23/4.2.3 - GCC: gcc version 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC) - CPU: Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz - Total 1 cases, 1 passed, 0 failed. Case1: read RSS HASH and RSS queue in the received packet. Passed. DUT: ./tools/dpdk_nic_bind.py --bind=3Digb_uio 0000:82:00.0 0000:82:00.1 ./x86_6= 4-native-linuxapp-gcc/app/testpmd -c fffff -n 4 -- -i --coremask=3D0xffffe= --portmask=3D0x3 --rxq=3D16 --txq=3D16 --txqflags=3D0 testpmd> set verbose 8 testpmd> set fwd rxonly testpmd> port stop all testpmd> set_hash_global_config 0 toeplitz ipv4-udp enable port start=20 testpmd> all port config all rss udp start tester: scapy >>> sendp([Ether(dst=3D"00:00:00:00:01:00",=20 >>> src=3Dget_if_hwaddr("enp132s0f1"))/IP(src=3D"192.168.0.1",=20 >>> dst=3D"192.168.0.2")/UDP(sport=3D1024,dport=3D1024)], iface=3D"enp132s0= f1") If test in commit 04920e693a053a923f94c271ee68881756649cec (without the pat= ch) DUT receive the packet: testpmd> port 0/queue 1: received 1 packets src=3D00:00:00:00:01:01 - dst=3D00:00:00:00:01:00 - type=3D0x0800 - lengt= h=3D60 - nb_segs=3D1 - FDIR matched hash=3D0xc3f2 ID=3D0x5263 Unknown packe= t type - Receive queue=3D0x1 PKT_RX_FDIR You can't find the RSS HASH and RSS queue If test with [PATCH v3] i40e: fix olflags for vector Rx DUT receive the pac= ket: testpmd> port 0/queue 1: received 1 packets src=3D00:00:00:00:01:01 - dst=3D00:00:00:00:01:00 - type=3D0x0800 - lengt= h=3D60 - nb_segs=3D1 - RSS hash=3D0x5263c3f2 - RSS queue=3D0x1 - (outer) L2= type: ETHER - (outer) L3 type: IPV4_EXT_UNKNOWN - (outer) L4 type: UDP - T= unnel type: Unknown - Inner L2 type: Unknown - Inner L3 type: Unknown - Inn= er L4 type: Unknown - Receive queue=3D0x1 PKT_RX_RSS_HASH You can check that RSS hash=3D0x5263c3f2 - RSS queue=3D0x1 The case was run in the default settings: CONFIG_RTE_LIBRTE_I40E_INC_VECTOR= =3Dy so the issue has been fixed. Thank you. Yuan. -----Original Message----- From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhe Tao Sent: Tuesday, June 14, 2016 1:24 PM To: dev@dpdk.org Cc: Tao, Zhe ; Wu, Jingjing Subject: [dpdk-dev] [PATCH v3] i40e: fix olflags for vector Rx Problem: The flag for RSS and flow director is not set correctly in the vector Rx fu= nction, so the upper layer APP which base on the related flags will not wor= k correctly. Fix this problem by change the shuffle table. the original shuffle table is= not correct. Fixes: 9ed94e5bb04e ("i40e: add vector Rx") Signed-off-by: Zhe Tao --- v2: Changed the comments according to the code change. v3: Fixed the issues reported by check-git-log.sh. drivers/net/i40e/i40e_rxtx_vec.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_= vec.c index eef80d9..704924f 100644 --- a/drivers/net/i40e/i40e_rxtx_vec.c +++ b/drivers/net/i40e/i40e_rxtx_vec.c @@ -144,12 +144,13 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf *= *rx_pkts) uint64_t dword; } vol; =20 - /* mask everything except rss and vlan flags - *bit2 is for vlan tag, bits 13:12 for rss - */ + /* mask everything except RSS, flow director and VLAN flags + * bit2 is for VLAN tag, bit11 for flow director indication + * bit13:12 for RSS indication. + */ const __m128i rss_vlan_msk =3D _mm_set_epi16( 0x0000, 0x0000, 0x0000, 0x0000, - 0x3004, 0x3004, 0x3004, 0x3004); + 0x3804, 0x3804, 0x3804, 0x3804); =20 /* map rss and vlan type to rss hash and vlan flag */ const __m128i vlan_flags =3D _mm_set_epi8(0, 0, 0, 0, @@ -159,8 +160,8 @@= desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts) =20 const __m128i rss_flags =3D _mm_set_epi8(0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, - PKT_RX_FDIR, 0, PKT_RX_RSS_HASH, 0); + PKT_RX_RSS_HASH | PKT_RX_FDIR, PKT_RX_RSS_HASH, 0, 0, + 0, 0, PKT_RX_FDIR, 0); =20 vlan0 =3D _mm_unpackhi_epi16(descs[0], descs[1]); vlan1 =3D _mm_unpackhi_epi16(descs[2], descs[3]); @@ -169,7 +170,7 @@ des= c_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts) vlan1 =3D _mm_and_si128(vlan0, rss_vlan_msk); vlan0 =3D _mm_shuffle_epi8(vlan_flags, vlan1); =20 - rss =3D _mm_srli_epi16(vlan1, 12); + rss =3D _mm_srli_epi16(vlan1, 11); rss =3D _mm_shuffle_epi8(rss_flags, rss); =20 vlan0 =3D _mm_or_si128(vlan0, rss); -- 2.1.4