[5/5] net/cnxk: add mempool check for frag attach

Message ID 20230425104010.339177-5-rbhansali@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: Jerin Jacob
Headers
Series [1/5] common/cnxk: fix IPsec IPv6 tunnel address byte swap |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Rahul Bhansali April 25, 2023, 10:40 a.m. UTC
  Add mempool cookies get mark to all frags in case of
reassembly failure.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
 drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Patch

diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h
index 9fdb5565e9..cbaf994aa2 100644
--- a/drivers/net/cnxk/cn10k_rx.h
+++ b/drivers/net/cnxk/cn10k_rx.h
@@ -211,6 +211,9 @@  nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
 		/* Update dynamic field with userdata */
 		*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
 
+		/* Mark frag as get */
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
 		cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
 			hdr->w0.num_frags - 2;
 		cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -239,6 +242,9 @@  nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
 		/* Update dynamic field with userdata */
 		*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;
 
+		/* Mark frag as get */
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
 		cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags =
 			hdr->w0.num_frags - 3;
 		cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL;
@@ -263,6 +269,9 @@  nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr,
 		mbuf->ol_flags = ol_flags;
 		mbuf->next = NULL;
 
+		/* Mark frag as get */
+		RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1);
+
 		/* Update dynamic field with userdata */
 		*rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata;