On Thu, 13 Jun 2024 11:39:29 +0800
Howard Wang <howard_w...@realsil.com.cn> wrote:
> +static void
> +rtl8126_sw_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats 
> *rte_stats)
> +{
> +     struct rtl8126_adapter *adapter = RTL8126_DEV_PRIVATE(dev);
> +     struct rtl8126_sw_stats *sw_stats = &adapter->sw_stats;
> +
> +     rte_stats->ibytes = sw_stats->rx_bytes;
> +     rte_stats->obytes = sw_stats->tx_bytes;
> +}
> +

There is ongoing discussion about how to handle thread safety for sw stats
in other drivers.  Without using atomic or volatile there is no guarantee that
on weakly ordered platforms that the stats will get reset properly.

> +static int
> +rtl8126_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats 
> *rte_stats)
> +{
> +     struct rtl8126_adapter *adapter = RTL8126_DEV_PRIVATE(dev);
> +     struct rtl8126_hw *hw = &adapter->hw;
> +
> +     if (rte_stats == NULL)
> +             return -EINVAL;

This is already checked and logged in rte_ethdev.c


Quite limiting that the device only support single rx and tx queue.

Does the device support primary/secondary process.

Reply via email to