From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] ixgbe: fix scalar scatter RX doesn't take into account CRC length
Date: Tue, 28 Jul 2015 10:41:48 +0100 [thread overview]
Message-ID: <1438076509-11650-2-git-send-email-konstantin.ananyev@intel.com> (raw)
In-Reply-To: <1438076509-11650-1-git-send-email-konstantin.ananyev@intel.com>
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 <konstantin.ananyev@intel.com>
---
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
next prev parent reply other threads:[~2015-07-28 9:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 9:41 [dpdk-dev] [PATCH 0/2] ixgbe: Two fixes for RX scatter functions Konstantin Ananyev
2015-07-28 9:41 ` Konstantin Ananyev [this message]
2015-07-28 11:39 ` [dpdk-dev] [PATCHv2 " Konstantin Ananyev
2015-07-28 11:39 ` [dpdk-dev] [PATCHv2 1/2] ixgbe: fix scalar scatter RX doesn't take into account CRC length Konstantin Ananyev
2015-07-28 11:39 ` [dpdk-dev] [PATCHv2 2/2] ixgbe: fix vector scatter RX could produce wrong nb_segs value Konstantin Ananyev
2015-07-29 1:51 ` [dpdk-dev] [PATCHv2 0/2] ixgbe: Two fixes for RX scatter functions Lu, Wenzhuo
2015-07-29 22:59 ` Thomas Monjalon
2015-07-28 9:41 ` [dpdk-dev] [PATCH 2/2] ixgbe: fix vector scatter RX could produce wrong nb_segs value Konstantin Ananyev
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=1438076509-11650-2-git-send-email-konstantin.ananyev@intel.com \
--to=konstantin.ananyev@intel.com \
--cc=dev@dpdk.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).