DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "WanRenyong" <wanry@yunsilicon.com>
Cc: <dev@dpdk.org>, <ferruh.yigit@amd.com>
Subject: Re: [PATCH v3 19/19] net/xsc: add dev basic stats ops
Date: Thu, 19 Sep 2024 12:05:39 -0700	[thread overview]
Message-ID: <20240919120539.04e41a87@hermes.local> (raw)
In-Reply-To: <20240918060936.1231758-20-wanry@yunsilicon.com>

On Wed, 18 Sep 2024 14:09:36 +0800
"WanRenyong" <wanry@yunsilicon.com> wrote:

> @@ -166,6 +169,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  		/* Fill wqe */
>  		wqe->va = rte_cpu_to_le_64(rte_pktmbuf_iova(rep));
>  		rte_pktmbuf_data_len(seg) = len;
> +		rxq->stats.rx_bytes += rte_pktmbuf_pkt_len(pkt);
>  
>  		*(pkts++) = pkt;
>  		pkt = NULL;
> @@ -200,6 +204,7 @@ xsc_rx_burst(void *dpdk_rxq, struct rte_mbuf **pkts, uint16_t pkts_n)
>  		rxq->nb_rx_hold = 0;
>  	}
>  
> +	rxq->stats.rx_pkts += nb_pkts;
>  	return nb_pkts;
>  }

You can a small performance boost by keeping a total_bytes counter in rx_burst function
and only add it to rx_bytes after the loop.

      parent reply	other threads:[~2024-09-19 19:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-18  6:09 WanRenyong
2024-09-19 19:04 ` Stephen Hemminger
2024-09-19 19:05 ` Stephen Hemminger [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=20240919120539.04e41a87@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=wanry@yunsilicon.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).