dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH] ixgbe: fix vector PMD chained mbuf receive
Date: Fri,  6 Feb 2015 13:41:08 +0000	[thread overview]
Message-ID: <1423230068-10841-1-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <54C261EC.8000104-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>

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 <praupadhyaya-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reported-by: Martin Weiser <martin.weiser-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
Signed-off-by: Bruce Richardson <bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Tested-by: Martin Weiser <martin.weiser-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
---
 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 */
-- 
2.1.0

  parent reply	other threads:[~2015-02-06 13:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19 10:26 Segmentation fault in ixgbe_rxtx_vec.c:444 with 1.8.0 Martin Weiser
     [not found] ` <54BCDBF1.8020909-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
2015-01-20 10:39   ` Martin Weiser
     [not found]     ` <54BE3047.9060909-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
2015-01-21 13:49       ` Bruce Richardson
2015-01-22 14:05         ` Prashant Upadhyaya
     [not found]           ` <CAPBAu3U6D6UMrgSbzeVwXTXSMDS+K6JNpQqJF6qRAFPU-5MiSw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-01-22 15:19             ` Bruce Richardson
2015-01-23 11:37         ` Martin Weiser
     [not found]           ` <54C23265.8090403-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
2015-01-23 11:52             ` Bruce Richardson
2015-01-23 14:59               ` Martin Weiser
     [not found]                 ` <54C261EC.8000104-CF7bWO6jhOGIrnxuYX0bhEEOCMrvLtNR@public.gmane.org>
2015-02-06 13:41                   ` Bruce Richardson [this message]
     [not found]                     ` <1423230068-10841-1-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-20 11:00                       ` [PATCH] ixgbe: fix vector PMD chained mbuf receive Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1423230068-10841-1-git-send-email-bruce.richardson@intel.com \
    --to=bruce.richardson-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).