DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>
Cc: dev@dpdk.org, cristian.dumitrescu@intel.com,
	churchill.khangar@intel.com, yogesh.jangra@intel.com
Subject: Re: [dpdk-dev] [PATCH] port: add file descriptor SWX port
Date: Tue, 23 Mar 2021 11:25:38 -0700	[thread overview]
Message-ID: <20210323112538.3dc472fa@hermes.local> (raw)
In-Reply-To: <1616155326-2639-1-git-send-email-venkata.suresh.kumar.p@intel.com>

On Fri, 19 Mar 2021 08:02:06 -0400
Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com> wrote:

> +static void
> +__writer_flush(struct writer *p)
> +{
> +	struct rte_mbuf *pkt;
> +	void *pkt_data;
> +	size_t n_bytes;
> +	ssize_t ret;
> +	uint32_t i;
> +
> +	for (i = 0; i < p->n_pkts; i++) {
> +		pkt = p->pkts[i];
> +		pkt_data = rte_pktmbuf_mtod(pkt, void*);
> +		n_bytes = rte_pktmbuf_data_len(pkt);
> +
> +		ret = write(p->params.fd, pkt_data, n_bytes);
> +		if (ret < 0)
> +			break;
> +	}
> +
> +	TRACE("[FD %u] %u packets out\n",
> +		(uint32_t)p->params.fd,
> +		p->n_pkts);
> +
> +	for (i = 0; i < p->n_pkts; i++)
> +		rte_pktmbuf_free(p->pkts[i]);

Loop can be replaced by:
	rte_pktmbuf_free_bulk(p->pkts, p->n_pkts);

  parent reply	other threads:[~2021-03-23 18:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 12:02 Venkata Suresh Kumar P
2021-03-23 16:22 ` Thomas Monjalon
2021-03-23 18:07   ` P, Venkata Suresh Kumar
2021-03-23 18:38     ` Thomas Monjalon
2021-03-23 18:56       ` Dumitrescu, Cristian
2021-03-23 19:55         ` Thomas Monjalon
2021-03-24 10:23           ` Dumitrescu, Cristian
2021-03-23 18:24 ` Stephen Hemminger
2021-03-23 18:25 ` Stephen Hemminger [this message]
2021-03-23 18:29 ` Stephen Hemminger

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=20210323112538.3dc472fa@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=churchill.khangar@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=venkata.suresh.kumar.p@intel.com \
    --cc=yogesh.jangra@intel.com \
    /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).