Re: [Intel-wired-lan] [PATCH net-next v5] ixgbe: implement get_queue_stats_rx

Jakub Kicinski <[email protected]>
Newsgroups org.osuosl.intel-wired-lan,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
On Fri, 14 Aug 2026 19:44:36 +0530 Kshitiz Bartariya wrote:
> +static void ixgbe_get_queue_stats_rx(struct net_device *dev, int idx,
> +				     struct netdev_queue_stats_rx *stats)
> +{
> +	struct ixgbe_adapter *adapter = ixgbe_from_netdev(dev);
> +	struct ixgbe_ring *ring = READ_ONCE(adapter->rx_ring[idx]);
> +	u64 bytes, packets, alloc_rx_page_failed, alloc_rx_buff_failed,
> +		csum_err;
> +	unsigned int start;
> +
> +	if (ring) {
> +		do {
> +			start = u64_stats_fetch_begin(&ring->syncp);
> +			bytes = ring->stats.bytes;
> +			packets = ring->stats.packets;
> +			alloc_rx_page_failed =
> +				ring->rx_stats.alloc_rx_page_failed;
> +			alloc_rx_buff_failed =
> +				ring->rx_stats.alloc_rx_buff_failed;
> +			csum_err = ring->rx_stats.csum_err;
> +		} while (u64_stats_fetch_retry(&ring->syncp, start));
> +	}
> +
> +	stats->bytes = bytes;

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:9772:6: warning: variable 'bytes' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
-- 
pw-not: cr
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.