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 4EC72C5D0 for ; Tue, 28 Jul 2015 11:42:09 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 28 Jul 2015 02:42:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,562,1432623600"; d="scan'208";a="772666179" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 28 Jul 2015 02:42:05 -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 t6S9g4i0005365; Tue, 28 Jul 2015 10:42:04 +0100 Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t6S9g46l011707; Tue, 28 Jul 2015 10:42:04 +0100 Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t6S9g4cf011703; Tue, 28 Jul 2015 10:42:04 +0100 From: Konstantin Ananyev To: dev@dpdk.org Date: Tue, 28 Jul 2015 10:41:48 +0100 Message-Id: <1438076509-11650-2-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1438076509-11650-1-git-send-email-konstantin.ananyev@intel.com> References: <1438076509-11650-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH 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 09:42:10 -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. 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