[PATCH v1 3/4] net/nbl: add support for imissed stats

Stephen Hemminger stephen at networkplumber.org
Fri Nov 7 17:05:15 CET 2025


On Thu,  6 Nov 2025 23:34:58 -0800
Dimon Zhao <dimon.zhao at nebula-matrix.com> wrote:

> +static int nbl_dev_update_hw_stats(struct rte_eth_dev *eth_dev)
> +{
> +	struct nbl_adapter *adapter = ETH_DEV_TO_NBL_DEV_PF_PRIV(eth_dev);
> +	struct nbl_dev_mgt *dev_mgt = NBL_ADAPTER_TO_DEV_MGT(adapter);
> +	struct nbl_dispatch_ops *disp_ops = NBL_DEV_MGT_TO_DISP_OPS(dev_mgt);
> +	struct nbl_dev_net_mgt *net_dev = NBL_DEV_MGT_TO_NET_DEV(dev_mgt);
> +	u32 *uvn_stat_pkt_drop;
> +	int i = 0;
> +	int ret = 0;
> +
> +	if (!net_dev->hw_stats_inited)
> +		return 0;
> +	uvn_stat_pkt_drop = rte_zmalloc("nbl_uvn_stat_pkt_drop",
> +				sizeof(*uvn_stat_pkt_drop) * (eth_dev->data->nb_rx_queues), 0);

Since the lifetime of this array is only for this function, please use standard pool.
	uvn_stat_pkt_drop = calloc(eth_dev->data->nb_rx_queues, sizeof(u32));



More information about the dev mailing list