[2/2] examples/ipsec-secgw: update stats when freeing packets
Checks
Commit Message
Instead of freeing directly, use commonly used function which also
updates stats.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
examples/ipsec-secgw/ipsec_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, 19 Dec 2023 10:59:23 +0530
Anoob Joseph <anoobj@marvell.com> wrote:
> Instead of freeing directly, use commonly used function which also
> updates stats.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
> examples/ipsec-secgw/ipsec_process.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/examples/ipsec-secgw/ipsec_process.c b/examples/ipsec-secgw/ipsec_process.c
> index b0cece3ad1..ddbe30745b 100644
> --- a/examples/ipsec-secgw/ipsec_process.c
> +++ b/examples/ipsec-secgw/ipsec_process.c
> @@ -22,7 +22,7 @@ free_cops(struct rte_crypto_op *cop[], uint32_t n)
> uint32_t i;
>
> for (i = 0; i != n; i++)
> - rte_pktmbuf_free(cop[i]->sym->m_src);
> + free_pkts(&cop[i]->sym->m_src, 1);
Also, free_pkts is using a loop and should be using rte_pktmbuf_free_bulk() instead.
Hi Stephen,
Please see inline.
Thanks,
Anoob
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Tuesday, December 19, 2023 10:49 PM
> To: Anoob Joseph <anoobj@marvell.com>
> Cc: Radu Nicolau <radu.nicolau@intel.com>; Akhil Goyal
> <gakhil@marvell.com>; Konstantin Ananyev
> <konstantin.v.ananyev@yandex.ru>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; dev@dpdk.org
> Subject: [EXT] Re: [PATCH 2/2] examples/ipsec-secgw: update stats when
> freeing packets
>
> External Email
>
> ----------------------------------------------------------------------
> On Tue, 19 Dec 2023 10:59:23 +0530
> Anoob Joseph <anoobj@marvell.com> wrote:
>
> > Instead of freeing directly, use commonly used function which also
> > updates stats.
> >
> > Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> > ---
> > examples/ipsec-secgw/ipsec_process.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/examples/ipsec-secgw/ipsec_process.c
> > b/examples/ipsec-secgw/ipsec_process.c
> > index b0cece3ad1..ddbe30745b 100644
> > --- a/examples/ipsec-secgw/ipsec_process.c
> > +++ b/examples/ipsec-secgw/ipsec_process.c
> > @@ -22,7 +22,7 @@ free_cops(struct rte_crypto_op *cop[], uint32_t n)
> > uint32_t i;
> >
> > for (i = 0; i != n; i++)
> > - rte_pktmbuf_free(cop[i]->sym->m_src);
> > + free_pkts(&cop[i]->sym->m_src, 1);
>
> Also, free_pkts is using a loop and should be using rte_pktmbuf_free_bulk()
> instead.
[Anoob] Indeed. Will push a separate patch for addressing the same. Thanks for pointing out.
@@ -22,7 +22,7 @@ free_cops(struct rte_crypto_op *cop[], uint32_t n)
uint32_t i;
for (i = 0; i != n; i++)
- rte_pktmbuf_free(cop[i]->sym->m_src);
+ free_pkts(&cop[i]->sym->m_src, 1);
}
/* helper routine to enqueue bulk of crypto ops */