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 3C2435932 for ; Wed, 20 Aug 2014 09:43:46 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 20 Aug 2014 00:47:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,900,1400050800"; d="scan'208";a="587327822" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 20 Aug 2014 00:46:40 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id s7K7kWgW030079; Wed, 20 Aug 2014 08:46:32 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id s7K7kWfl022046; Wed, 20 Aug 2014 08:46:32 +0100 Received: (from pwodkowx@localhost) by sivswdev01.ir.intel.com with id s7K7kWlN022042; Wed, 20 Aug 2014 08:46:32 +0100 From: Pawel Wodkowski To: dev@dpdk.org Date: Wed, 20 Aug 2014 08:46:28 +0100 Message-Id: <1408520788-20380-1-git-send-email-pawelx.wodkowski@intel.com> X-Mailer: git-send-email 1.7.0.7 Subject: [dpdk-dev] [PATCH] ixgbe_rx_scan_hw_ring: Fix initializing id and hash fields in flow director mode. 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, 20 Aug 2014 07:43:47 -0000 When Flow Director was used together with bulk alloc, id and hash was swapped when packet matches flow director filter due to improper fdir field initialization. Signed-off-by: Pawel Wodkowski --- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index aaf46d4..796e5a4 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -902,6 +902,7 @@ ixgbe_rx_scan_hw_ring(struct igb_rx_queue *rxq) struct igb_rx_entry *rxep; struct rte_mbuf *mb; uint16_t pkt_len; + uint16_t pkt_flags; int s[LOOK_AHEAD], nb_dd; int i, j, nb_rx = 0; @@ -935,21 +936,30 @@ ixgbe_rx_scan_hw_ring(struct igb_rx_queue *rxq) /* Translate descriptor info to mbuf format */ for (j = 0; j < nb_dd; ++j) { mb = rxep[j].mbuf; - pkt_len = (uint16_t)(rxdp[j].wb.upper.length - - rxq->crc_len); + pkt_len = (uint16_t)(rxdp[j].wb.upper.length - rxq->crc_len); mb->pkt.data_len = pkt_len; mb->pkt.pkt_len = pkt_len; - mb->pkt.vlan_macip.f.vlan_tci = rxdp[j].wb.upper.vlan; - mb->pkt.hash.rss = rxdp[j].wb.lower.hi_dword.rss; + mb->pkt.vlan_macip.f.vlan_tci = + rte_le_to_cpu_16(rxdp[j].wb.upper.vlan); /* convert descriptor fields to rte mbuf flags */ - mb->ol_flags = rx_desc_hlen_type_rss_to_pkt_flags( + pkt_flags = rx_desc_hlen_type_rss_to_pkt_flags( rxdp[j].wb.lower.lo_dword.data); /* reuse status field from scan list */ - mb->ol_flags = (uint16_t)(mb->ol_flags | + pkt_flags = (uint16_t)(pkt_flags | rx_desc_status_to_pkt_flags(s[j])); - mb->ol_flags = (uint16_t)(mb->ol_flags | + pkt_flags = (uint16_t)(pkt_flags | rx_desc_error_to_pkt_flags(s[j])); + mb->ol_flags = pkt_flags; + + if (likely(pkt_flags & PKT_RX_RSS_HASH)) + mb->pkt.hash.rss = rxdp[j].wb.lower.hi_dword.rss; + else if (pkt_flags & PKT_RX_FDIR) { + mb->pkt.hash.fdir.hash = + (uint16_t)((rxdp[j].wb.lower.hi_dword.csum_ip.csum) + & IXGBE_ATR_HASH_MASK); + mb->pkt.hash.fdir.id = rxdp[j].wb.lower.hi_dword.csum_ip.ip_id; + } } /* Move mbuf pointers from the S/W ring to the stage */ -- 1.7.9.5