[V2 14/18] net/hinic3: add Rx/Tx functions

Stephen Hemminger stephen at networkplumber.org
Thu Jun 26 22:04:47 CEST 2025


On Wed, 25 Jun 2025 10:28:10 +0800
Feifei Wang <wff_light at vip.163.com> wrote:

> +#ifdef HINIC3_XSTAT_MBUF_USE
> +		rxq->rxq_stats.rx_free_mbuf_bytes += pkts;
> +#endif
> +	}
> +	rxq->rxq_stats.burst_pkts = pkts;
> +	rxq->rxq_stats.tsc = rte_get_timer_cycles();
> +out:
> +	/* 10. Rearm mbuf to rxq. */
> +	hinic3_rearm_rxq_mbuf(rxq);
> +
> +#ifdef HINIC3_XSTAT_PROF_RX
> +	/* Do profiling stats. */
> +	t2 = rte_get_tsc_cycles();
> +	rxq->rxq_stats.app_tsc = t1 - rxq->prof_rx_end_tsc;
> +	rxq->prof_rx_end_tsc = t2;
> +	rxq->rxq_stats.pmd_tsc = t2 - t1;
> +#endif

I understand why you would want #ifdef's while testing a new driver.
But once it is released, they become latent problems.
The #ifdef code never gets tested, and may or may not have bugs
that are waiting to happen.

Please try and stick to the standard ifdefs that other drivers use.
For example for mbuf, maybe put it under mbuf debug #ifdef?


More information about the dev mailing list