[dpdk-dev,v1] i40e: fix olflags for vector RX

Message ID 1464094543-32623-1-git-send-email-zhe.tao@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Zhe Tao May 24, 2016, 12:55 p.m. UTC
  Problem:
The flag for RSS and flow director is not set correctly in the
vector RX function, so the upper layer APP which base on the related
flags will not work correctly.

Fix this problem by change the shuffle table. the original shuffle
table is not correct.

Fixes: 9ed94 (i40e: add vector Rx)

Signed-off-by: Zhe Tao <zhe.tao@intel.com>
---
 drivers/net/i40e/i40e_rxtx_vec.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Piotr Azarewicz June 3, 2016, 7:19 a.m. UTC | #1
Hi,

> --- a/drivers/net/i40e/i40e_rxtx_vec.c
> +++ b/drivers/net/i40e/i40e_rxtx_vec.c
> @@ -149,7 +149,7 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf
> **rx_pkts)
>
>	/* mask everything except rss and vlan flags
>	*bit2 is for vlan tag, bits 13:12 for rss
>  	*/

Please, update or remove the comment above.
Thanks, Piotr

>  	const __m128i rss_vlan_msk = _mm_set_epi16(
>  			0x0000, 0x0000, 0x0000, 0x0000,
> -			0x3004, 0x3004, 0x3004, 0x3004);
> +			0x3804, 0x3804, 0x3804, 0x3804);
>
  
Bruce Richardson June 9, 2016, 3:41 p.m. UTC | #2
On Fri, Jun 03, 2016 at 07:19:09AM +0000, Azarewicz, PiotrX T wrote:
> Hi,
> 
> > --- a/drivers/net/i40e/i40e_rxtx_vec.c
> > +++ b/drivers/net/i40e/i40e_rxtx_vec.c
> > @@ -149,7 +149,7 @@ desc_to_olflags_v(__m128i descs[4], struct rte_mbuf
> > **rx_pkts)
> >
> >	/* mask everything except rss and vlan flags
> >	*bit2 is for vlan tag, bits 13:12 for rss
> >  	*/
> 
> Please, update or remove the comment above.
> Thanks, Piotr
> 
ping.
is a v2 of this patch being produced?

/Bruce
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx_vec.c b/drivers/net/i40e/i40e_rxtx_vec.c
index eef80d9..9f674bf 100644
--- a/drivers/net/i40e/i40e_rxtx_vec.c
+++ b/drivers/net/i40e/i40e_rxtx_vec.c
@@ -149,7 +149,7 @@  desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 	*/
 	const __m128i rss_vlan_msk = _mm_set_epi16(
 			0x0000, 0x0000, 0x0000, 0x0000,
-			0x3004, 0x3004, 0x3004, 0x3004);
+			0x3804, 0x3804, 0x3804, 0x3804);
 
 	/* map rss and vlan type to rss hash and vlan flag */
 	const __m128i vlan_flags = _mm_set_epi8(0, 0, 0, 0,
@@ -159,8 +159,8 @@  desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 
 	const __m128i rss_flags = _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);
 
 	vlan0 = _mm_unpackhi_epi16(descs[0], descs[1]);
 	vlan1 = _mm_unpackhi_epi16(descs[2], descs[3]);
@@ -169,7 +169,7 @@  desc_to_olflags_v(__m128i descs[4], struct rte_mbuf **rx_pkts)
 	vlan1 = _mm_and_si128(vlan0, rss_vlan_msk);
 	vlan0 = _mm_shuffle_epi8(vlan_flags, vlan1);
 
-	rss = _mm_srli_epi16(vlan1, 12);
+	rss = _mm_srli_epi16(vlan1, 11);
 	rss = _mm_shuffle_epi8(rss_flags, rss);
 
 	vlan0 = _mm_or_si128(vlan0, rss);