DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>, <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ethdev: use rte_pktmbuf_free_bulk()
Date: Wed, 7 Oct 2020 09:30:43 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35C6134C@smartserver.smartshare.dk> (raw)
In-Reply-To: <20200930212718.19276-1-stephen@networkplumber.org>

> 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>


      parent reply	other threads:[~2020-10-07  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 21:27 Stephen Hemminger
2020-10-01 11:14 ` Andrew Rybchenko
2020-10-01 13:02   ` Ferruh Yigit
2020-10-07  7:30 ` Morten Brørup [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98CBD80474FA8B44BF855DF32C47DC35C6134C@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).