From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 3B405C5E4 for ; Tue, 28 Jul 2015 13:39:59 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 28 Jul 2015 04:39:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,562,1432623600"; d="scan'208";a="771352815" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga002.fm.intel.com with ESMTP; 28 Jul 2015 04:39:35 -0700 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t6SBdZFV016949; Tue, 28 Jul 2015 12:39:35 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t6SBdYb6006075; Tue, 28 Jul 2015 12:39:34 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t6SBdY6s006071; Tue, 28 Jul 2015 12:39:34 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Tue, 28 Jul 2015 12:39:22 +0100 Message-Id: <1438083563-5668-2-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438083563-5668-1-git-send-email-konstantin.ananyev@intel.com> References: <1438076509-11650-2-git-send-email-konstantin.ananyev@intel.com> <1438083563-5668-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCHv2 1/2] ixgbe: fix scalar scatter RX doesn't take into account CRC length 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, 28 Jul 2015 11:39:59 -0000 For 2.1 release, in attempt to minimize number of RX routines to support, ixgbe scatter and ixgbe LRO RX routines were merged into one that can handle both cases. Though I completely missed the fact, that while LRO could only be used when HW CRC strip is enabled, scatter RX should work for both cases (HW CRC strip on/off). That patch restores missed functionality. Fixes: 9d8a92628f21 ("ixgbe: remove simple scalar scattered Rx method") v2 changes: - updated commit message with 'Fixes'. Signed-off-by: Konstantin Ananyev --- drivers/net/ixgbe/ixgbe_rxtx.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index a0c8847..a1b25aa 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -1817,6 +1817,25 @@ next_desc: ixgbe_fill_cluster_head_buf(first_seg, &rxd, rxq->port_id, staterr); + /* + * Deal with the case, when HW CRC srip is disabled. + * That can't happen when LRO is enabled, but still could + * happen for scattered RX mode. + */ + first_seg->pkt_len -= rxq->crc_len; + if (unlikely(rxm->data_len <= rxq->crc_len)) { + struct rte_mbuf *lp; + + for (lp = first_seg; lp->next != rxm; lp = lp->next) + ; + + first_seg->nb_segs--; + lp->data_len -= rxq->crc_len - rxm->data_len; + lp->next = NULL; + rte_pktmbuf_free_seg(rxm); + } else + rxm->data_len -= rxq->crc_len; + /* Prefetch data of first segment, if configured to do so. */ rte_packet_prefetch((char *)first_seg->buf_addr + first_seg->data_off); -- 1.8.3.1