DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Junlong Wang <wang.junlong1@zte.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v1 4/5] net/zxdh: add support primary/secondary process
Date: Sun, 21 Dec 2025 09:00:18 -0800	[thread overview]
Message-ID: <20251221090018.62650e49@phoenix.local> (raw)
In-Reply-To: <20251220061521.289722-5-wang.junlong1@zte.com.cn>

On Sat, 20 Dec 2025 14:15:20 +0800
Junlong Wang <wang.junlong1@zte.com.cn> wrote:

> diff --git a/drivers/net/zxdh/zxdh_ethdev_ops.c b/drivers/net/zxdh/zxdh_ethdev_ops.c
> index 8fb315eeac..068dd21876 100644
> --- a/drivers/net/zxdh/zxdh_ethdev_ops.c
> +++ b/drivers/net/zxdh/zxdh_ethdev_ops.c
> @@ -1802,22 +1802,26 @@ zxdh_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats,
>  	struct zxdh_hw_mac_bytes mac_bytes = {0};
>  	uint32_t i = 0;
>  
> -	zxdh_hw_vqm_stats_get(dev, ZXDH_VQM_DEV_STATS_GET,  &vqm_stats);
> -	if (hw->is_pf)
> -		zxdh_hw_mac_stats_get(dev, &mac_stats, &mac_bytes);
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		zxdh_hw_vqm_stats_get(dev, ZXDH_VQM_DEV_STATS_GET,  &vqm_stats);
> +		if (hw->is_pf)
> +			zxdh_hw_mac_stats_get(dev, &mac_stats, &mac_bytes);
>  
> -	zxdh_hw_np_stats_get(dev, &np_stats);
> +		zxdh_hw_np_stats_get(dev, &np_stats);
>  
> -	stats->ipackets = vqm_stats.rx_total;
> -	stats->opackets = vqm_stats.tx_total;
> -	stats->ibytes = vqm_stats.rx_bytes;
> -	stats->obytes = vqm_stats.tx_bytes;
> -	stats->imissed = vqm_stats.rx_drop + mac_stats.rx_drop;
> -	stats->ierrors = vqm_stats.rx_error + mac_stats.rx_error + np_stats.rx_mtu_drop_pkts;
> -	stats->oerrors = vqm_stats.tx_error + mac_stats.tx_error + np_stats.tx_mtu_drop_pkts;
> +		stats->ipackets = vqm_stats.rx_total;
> +		stats->opackets = vqm_stats.tx_total;
> +		stats->ibytes = vqm_stats.rx_bytes;
> +		stats->obytes = vqm_stats.tx_bytes;
> +		stats->imissed = vqm_stats.rx_drop + mac_stats.rx_drop;
> +		stats->ierrors = vqm_stats.rx_error +
> +			mac_stats.rx_error + np_stats.rx_mtu_drop_pkts;
> +		stats->oerrors = vqm_stats.tx_error +
> +			mac_stats.tx_error + np_stats.tx_mtu_drop_pkts;
>  
> -	if (hw->i_mtr_en || hw->e_mtr_en)
> -		stats->imissed  += np_stats.rx_mtr_drop_pkts;
> +		if (hw->i_mtr_en || hw->e_mtr_en)
> +			stats->imissed  += np_stats.rx_mtr_drop_pkts;
> +	}
>  

Does this driver support getting stats in the secondary process?
There are some Network Virtual Appliance products that run with all the
work being done by secondary process and only use the primary as a watchdog for restart.

  reply	other threads:[~2025-12-21 17:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-20  6:15 [PATCH v1 0/5] net/zxdh: add support some new features Junlong Wang
2025-12-20  6:15 ` [PATCH v1 1/5] net/zxdh: add support for modifying queue depth Junlong Wang
2025-12-20  6:15 ` [PATCH v1 2/5] net/zxdh: optimize alloc queue resources Junlong Wang
2025-12-20  6:15 ` [PATCH v1 3/5] net/zxdh: add support set link speed get autoneg stats Junlong Wang
2025-12-21 16:57   ` Stephen Hemminger
2025-12-20  6:15 ` [PATCH v1 4/5] net/zxdh: add support primary/secondary process Junlong Wang
2025-12-21 17:00   ` Stephen Hemminger [this message]
2025-12-20  6:15 ` [PATCH v1 5/5] net/zxdh: add support GENEVE TSO and Rx outer UDP chksum Junlong Wang

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=20251221090018.62650e49@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=wang.junlong1@zte.com.cn \
    /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).