DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk()
@ 2020-09-30 21:27 Stephen Hemminger
  2020-10-01 11:14 ` Andrew Rybchenko
  2020-10-07  7:30 ` Morten Brørup
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2020-09-30 21:27 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

The mbuf library now has routine to free multiple buffers.
Loop is no longer needed.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_ethdev/rte_ethdev.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index dfe5c1b488a0..307fbeb3a798 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2179,10 +2179,7 @@ void
 rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t unsent,
 		void *userdata __rte_unused)
 {
-	unsigned i;
-
-	for (i = 0; i < unsent; i++)
-		rte_pktmbuf_free(pkts[i]);
+	rte_pktmbuf_free_bulk(pkts, unsent);
 }
 
 void
@@ -2190,11 +2187,8 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf **pkts, uint16_t unsent,
 		void *userdata)
 {
 	uint64_t *count = userdata;
-	unsigned i;
-
-	for (i = 0; i < unsent; i++)
-		rte_pktmbuf_free(pkts[i]);
 
+	rte_pktmbuf_free_bulk(pkts, unsent);
 	*count += unsent;
 }
 
-- 
2.27.0


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

* Re: [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk()
  2020-09-30 21:27 [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk() Stephen Hemminger
@ 2020-10-01 11:14 ` Andrew Rybchenko
  2020-10-01 13:02   ` Ferruh Yigit
  2020-10-07  7:30 ` Morten Brørup
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Rybchenko @ 2020-10-01 11:14 UTC (permalink / raw)
  To: Stephen Hemminger, Thomas Monjalon, Ferruh Yigit; +Cc: dev

On 10/1/20 12:27 AM, Stephen Hemminger wrote:
> The mbuf library now has routine to free multiple buffers.
> Loop is no longer needed.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Thanks, Stephen

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>


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

* Re: [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk()
  2020-10-01 11:14 ` Andrew Rybchenko
@ 2020-10-01 13:02   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2020-10-01 13:02 UTC (permalink / raw)
  To: Andrew Rybchenko, Stephen Hemminger, Thomas Monjalon; +Cc: dev

On 10/1/2020 12:14 PM, Andrew Rybchenko wrote:
> On 10/1/20 12:27 AM, Stephen Hemminger wrote:
>> The mbuf library now has routine to free multiple buffers.
>> Loop is no longer needed.
>>
>> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> 
> Thanks, Stephen
> 
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> 

Applied to dpdk-next-net/main, thanks.

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

* Re: [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk()
  2020-09-30 21:27 [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk() Stephen Hemminger
  2020-10-01 11:14 ` Andrew Rybchenko
@ 2020-10-07  7:30 ` Morten Brørup
  1 sibling, 0 replies; 4+ messages in thread
From: Morten Brørup @ 2020-10-07  7:30 UTC (permalink / raw)
  To: Stephen Hemminger, dev

> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stephen Hemminger
> Sent: Wednesday, September 30, 2020 11:27 PM
> 
> The mbuf library now has routine to free multiple buffers.
> Loop is no longer needed.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  lib/librte_ethdev/rte_ethdev.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c
> b/lib/librte_ethdev/rte_ethdev.c
> index dfe5c1b488a0..307fbeb3a798 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -2179,10 +2179,7 @@ void
>  rte_eth_tx_buffer_drop_callback(struct rte_mbuf **pkts, uint16_t
> unsent,
>  		void *userdata __rte_unused)
>  {
> -	unsigned i;
> -
> -	for (i = 0; i < unsent; i++)
> -		rte_pktmbuf_free(pkts[i]);
> +	rte_pktmbuf_free_bulk(pkts, unsent);
>  }
> 
>  void
> @@ -2190,11 +2187,8 @@ rte_eth_tx_buffer_count_callback(struct rte_mbuf
> **pkts, uint16_t unsent,
>  		void *userdata)
>  {
>  	uint64_t *count = userdata;
> -	unsigned i;
> -
> -	for (i = 0; i < unsent; i++)
> -		rte_pktmbuf_free(pkts[i]);
> 
> +	rte_pktmbuf_free_bulk(pkts, unsent);
>  	*count += unsent;
>  }
> 
> --
> 2.27.0
> 

Reviewed-by: Morten Brørup <mb@smartsharesystems.com>


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

end of thread, other threads:[~2020-10-07  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 21:27 [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk() Stephen Hemminger
2020-10-01 11:14 ` Andrew Rybchenko
2020-10-01 13:02   ` Ferruh Yigit
2020-10-07  7:30 ` Morten Brørup

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git