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

Message ID 20230518154902.2254743-5-rbhansali@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2,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/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Rahul Bhansali May 18, 2023, 3:49 p.m. UTC
  Add mempool cookies get mark to all frags in case of
reassembly failure.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
---
Changes in v2: No change

 drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
 1 file changed, 9 insertions(+)

--
2.25.1
  

Comments

Jerin Jacob May 22, 2023, 1:14 p.m. UTC | #1
On Thu, May 18, 2023 at 9:19 PM Rahul Bhansali <rbhansali@marvell.com> wrote:
>
> Add mempool cookies get mark to all frags in case of
> reassembly failure.
>
> Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>


Series applied to dpdk-next-net-mrvl/for-next-net. Thanks


> ---
> Changes in v2: No change
>
>  drivers/net/cnxk/cn10k_rx.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> 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;
>
> --
> 2.25.1
>
  

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;