examples/ipsec-secgw: use bulk free

Message ID 20231221044033.432-1-anoobj@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series examples/ipsec-secgw: use bulk free |

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/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Anoob Joseph Dec. 21, 2023, 4:40 a.m. UTC
  Use rte_pktmbuf_free_bulk() API instead of looping through the packets
and freeing individually.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/ipsec-secgw/ipsec-secgw.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Konstantin Ananyev Jan. 2, 2024, 6:14 p.m. UTC | #1
> Use rte_pktmbuf_free_bulk() API instead of looping through the packets
> and freeing individually.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  examples/ipsec-secgw/ipsec-secgw.h | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h
> index 53665adf03..8baab44ee7 100644
> --- a/examples/ipsec-secgw/ipsec-secgw.h
> +++ b/examples/ipsec-secgw/ipsec-secgw.h
> @@ -232,10 +232,7 @@ free_reassembly_fail_pkt(struct rte_mbuf *mb)
>  static inline void
>  free_pkts(struct rte_mbuf *mb[], uint32_t n)
>  {
> -	uint32_t i;
> -
> -	for (i = 0; i != n; i++)
> -		rte_pktmbuf_free(mb[i]);
> +	rte_pktmbuf_free_bulk(mb, n);
> 
>  	core_stats_update_drop(n);
>  }
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
 

> 2.25.1
  
Akhil Goyal Jan. 9, 2024, 5:39 p.m. UTC | #2
> Subject: [PATCH] examples/ipsec-secgw: use bulk free
> 
> Use rte_pktmbuf_free_bulk() API instead of looping through the packets
> and freeing individually.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
  

Patch

diff --git a/examples/ipsec-secgw/ipsec-secgw.h b/examples/ipsec-secgw/ipsec-secgw.h
index 53665adf03..8baab44ee7 100644
--- a/examples/ipsec-secgw/ipsec-secgw.h
+++ b/examples/ipsec-secgw/ipsec-secgw.h
@@ -232,10 +232,7 @@  free_reassembly_fail_pkt(struct rte_mbuf *mb)
 static inline void
 free_pkts(struct rte_mbuf *mb[], uint32_t n)
 {
-	uint32_t i;
-
-	for (i = 0; i != n; i++)
-		rte_pktmbuf_free(mb[i]);
+	rte_pktmbuf_free_bulk(mb, n);
 
 	core_stats_update_drop(n);
 }