DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ip_frag: recalculate data length of fragment
@ 2020-11-18 13:29 Yicai Lu
  2020-11-22 11:22 ` Thomas Monjalon
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Yicai Lu @ 2020-11-18 13:29 UTC (permalink / raw)
  To: dev
  Cc: konstantin.ananyev, zhoujingbin, chenchanghu, jerry.lilijun,
	haifeng.lin, guohongzhi1, wangyunjian, Yicai Lu

In some situations, we would get several ip fragments, which total
data length is less than minimum frame(64) and padding with zeros.
Examples: Second Fragment is "a0a1 a2a3 a4a5 a6a7 0000 0000 ..."
and Third Fragment is "a8a9 aaab acad aeaf b0b1 b2b3 ...".
And then, we would reassemble Second and Third Fragment like this
"a0a1 a2a3 a4a5 a6a7 0000 0000 ... a8a9 aaab acad aeaf b0b1 ...",
which is not correct! So, we need recalculate the data length 
of fragment to remove invalid padings(zero)!

Signed-off-by: Yicai Lu <luyicai@huawei.com>
---
 lib/librte_ip_frag/ip_frag_internal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_ip_frag/ip_frag_internal.c b/lib/librte_ip_frag/ip_frag_internal.c
index b436a4c93..7bdd98090 100644
--- a/lib/librte_ip_frag/ip_frag_internal.c
+++ b/lib/librte_ip_frag/ip_frag_internal.c
@@ -155,6 +155,7 @@ ip_frag_process(struct ip_frag_pkt *fp, struct rte_ip_frag_death_row *dr,
 
 	fp->frags[idx].ofs = ofs;
 	fp->frags[idx].len = len;
+	mb->data_len = mb->l2_len + mb->l3_len + len;
 	fp->frags[idx].mb = mb;
 
 	mb = NULL;
-- 
2.28.0.windows.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-01-15 10:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 13:29 [dpdk-dev] [PATCH] ip_frag: recalculate data length of fragment Yicai Lu
2020-11-22 11:22 ` Thomas Monjalon
2020-11-23  2:27 ` [dpdk-dev] [PATCH v2] " Yicai Lu
2020-12-12 11:05 ` [dpdk-dev] [PATCH v5] ip_frag: remove padding " Yicai Lu
2020-12-14 14:44   ` Ananyev, Konstantin
2020-12-15  3:18     ` luyicai
2020-12-16 10:44       ` Ananyev, Konstantin
2020-12-16 10:54         ` luyicai
2020-12-16 13:36 ` [dpdk-dev] [PATCH v6] " Yicai Lu
2020-12-18 11:41   ` Ananyev, Konstantin
2021-01-15 10:29     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

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).