DPDK patches and discussions
 help / color / mirror / Atom feed
From: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v1 2/3] port: fix ras ring ports
Date: Tue, 15 Sep 2015 15:06:34 +0200	[thread overview]
Message-ID: <1442322395-23365-3-git-send-email-piotrx.t.azarewicz@intel.com> (raw)
In-Reply-To: <1442322395-23365-1-git-send-email-piotrx.t.azarewicz@intel.com>

Bug fixes for ring ports with IPv4/IPv6 reassembly support.
Previous implementation can't work properly due to incorrect choosing
process function.
Also, assuming that, when processing ip packet, ip header is know we can
set l3_len parameter here.

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---
 lib/librte_port/rte_port_ras.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/librte_port/rte_port_ras.c b/lib/librte_port/rte_port_ras.c
index 6bd0f8c..e45d450 100644
--- a/lib/librte_port/rte_port_ras.c
+++ b/lib/librte_port/rte_port_ras.c
@@ -144,7 +144,7 @@ rte_port_ring_writer_ras_create(void *params, int socket_id, int is_ipv4)
 	port->tx_burst_sz = conf->tx_burst_sz;
 	port->tx_buf_count = 0;
 
-	port->f_ras = (is_ipv4 == 0) ? process_ipv4 : process_ipv6;
+	port->f_ras = (is_ipv4 == 1) ? process_ipv4 : process_ipv6;
 
 	return port;
 }
@@ -182,7 +182,7 @@ process_ipv4(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
 	/* Assume there is no ethernet header */
 	struct ipv4_hdr *pkt_hdr = rte_pktmbuf_mtod(pkt, struct ipv4_hdr *);
 
-	/* Get "Do not fragment" flag and fragment offset */
+	/* Get "More fragments" flag and fragment offset */
 	uint16_t frag_field = rte_be_to_cpu_16(pkt_hdr->fragment_offset);
 	uint16_t frag_offset = (uint16_t)(frag_field & IPV4_HDR_OFFSET_MASK);
 	uint16_t frag_flag = (uint16_t)(frag_field & IPV4_HDR_MF_FLAG);
@@ -195,6 +195,8 @@ process_ipv4(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
 		struct rte_ip_frag_tbl *tbl = p->frag_tbl;
 		struct rte_ip_frag_death_row *dr = &p->death_row;
 
+		pkt->l3_len = sizeof(*pkt_hdr);
+
 		/* Process this fragment */
 		mo = rte_ipv4_frag_reassemble_packet(tbl, dr, pkt, rte_rdtsc(),
 				pkt_hdr);
@@ -224,6 +226,8 @@ process_ipv6(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
 		struct rte_ip_frag_tbl *tbl = p->frag_tbl;
 		struct rte_ip_frag_death_row *dr = &p->death_row;
 
+		pkt->l3_len = sizeof(*pkt_hdr) + sizeof(*frag_hdr);
+
 		/* Process this fragment */
 		mo = rte_ipv6_frag_reassemble_packet(tbl, dr, pkt, rte_rdtsc(), pkt_hdr,
 				frag_hdr);
-- 
1.7.9.5

  parent reply	other threads:[~2015-09-15 13:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-15 13:06 [dpdk-dev] [PATCH v1 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Piotr Azarewicz
2015-09-15 13:06 ` [dpdk-dev] [PATCH v1 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-09-21 22:34   ` Stephen Hemminger
2015-09-22 11:35     ` Dumitrescu, Cristian
2015-09-21 22:35   ` Stephen Hemminger
2015-09-22 11:34     ` Dumitrescu, Cristian
2015-09-22 14:23       ` Thomas Monjalon
2015-09-22 16:34         ` Stephen Hemminger
2015-09-23 13:07         ` Dumitrescu, Cristian
2015-09-21 22:37   ` Stephen Hemminger
2015-09-22 11:34     ` Dumitrescu, Cristian
2015-09-15 13:06 ` Piotr Azarewicz [this message]
2015-09-15 13:06 ` [dpdk-dev] [PATCH v1 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-09-15 13:49 ` [dpdk-dev] [PATCH v1 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Dumitrescu, Cristian
2015-09-24  9:55 ` [dpdk-dev] [PATCH v2 " Piotr Azarewicz
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-19 15:18     ` Thomas Monjalon
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 2/3] port: fix ras " Piotr Azarewicz
2015-10-19 15:15     ` Thomas Monjalon
2015-09-24  9:55   ` [dpdk-dev] [PATCH v2 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-09-24 10:28   ` [dpdk-dev] [PATCH v2 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Dumitrescu, Cristian
2015-10-20 14:36   ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 2/3] port: fix ras " Piotr Azarewicz
2015-10-20 14:36     ` [dpdk-dev] [PATCH v3 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-10-28 13:30     ` [dpdk-dev] [PATCH v4 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 1/3] port: add mp/mc ring ports Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 2/3] port: fix ras/frag " Piotr Azarewicz
2015-10-28 13:30       ` [dpdk-dev] [PATCH v4 3/3] examples/ip_pipeline: add mp/mc and frag/ras swq Piotr Azarewicz
2015-11-25 22:08       ` [dpdk-dev] [PATCH v4 0/3] ip_pipeline: add MP/MC and frag/ras support to SWQs 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=1442322395-23365-3-git-send-email-piotrx.t.azarewicz@intel.com \
    --to=piotrx.t.azarewicz@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).