From patchwork Fri Feb 6 13:41:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 3011 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id EA870B55; Fri, 6 Feb 2015 14:41:14 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 0B74F255 for ; Fri, 6 Feb 2015 14:41:12 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 06 Feb 2015 05:41:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,529,1418112000"; d="scan'208";a="662566947" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 06 Feb 2015 05:41:10 -0800 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 t16Df9Zx007194; Fri, 6 Feb 2015 13:41:09 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id t16Df9tg010876; Fri, 6 Feb 2015 13:41:09 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id t16Df9dX010872; Fri, 6 Feb 2015 13:41:09 GMT From: Bruce Richardson To: dev@dpdk.org Date: Fri, 6 Feb 2015 13:41:08 +0000 Message-Id: <1423230068-10841-1-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <54C261EC.8000104@allegro-packets.com> References: <54C261EC.8000104@allegro-packets.com> Subject: [dpdk-dev] [PATCH] ixgbe: fix vector PMD chained mbuf receive 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When the vector pmd was receiving a mix of packets of various sizes, some of which were split across multiple mbufs, there was an issue with reassembly of the jumbo frames. This was due to a skipped increment when using "continue" in a while loop. Changing the loop to a "for" loop fixes this problem, by ensuring the increment is always performed. Reported-by: Prashant Upadhyaya Reported-by: Martin Weiser Signed-off-by: Bruce Richardson Tested-by: Martin Weiser --- lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c index b54cb19..dfaccee 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -402,10 +402,10 @@ reassemble_packets(struct igb_rx_queue *rxq, struct rte_mbuf **rx_bufs, struct rte_mbuf *pkts[RTE_IXGBE_VPMD_RX_BURST]; /*finished pkts*/ struct rte_mbuf *start = rxq->pkt_first_seg; struct rte_mbuf *end = rxq->pkt_last_seg; - unsigned pkt_idx = 0, buf_idx = 0; + unsigned pkt_idx, buf_idx; - while (buf_idx < nb_bufs) { + for (buf_idx = 0, pkt_idx = 0; buf_idx < nb_bufs; buf_idx++) { if (end != NULL) { /* processing a split packet */ end->next = rx_bufs[buf_idx]; @@ -448,7 +448,6 @@ reassemble_packets(struct igb_rx_queue *rxq, struct rte_mbuf **rx_bufs, rx_bufs[buf_idx]->data_len += rxq->crc_len; rx_bufs[buf_idx]->pkt_len += rxq->crc_len; } - buf_idx++; } /* save the partial packet for next time */