Re: [PATCH net-next v11 2/5] hinic3: Add ethtool statistic ops

From: Dimitri Daskalakis

Date: Tue Jul 21 2026 - 15:30:47 EST


On 7/20/26 8:53 AM, Fan Gong wrote:
+
+static u64 get_val_of_ptr(u32 size, const void *ptr)
+{
+ u64 ret = size == sizeof(u64) ? *(u64 *)ptr :
+ size == sizeof(u32) ? *(u32 *)ptr :
+ size == sizeof(u16) ? *(u16 *)ptr :
+ *(u8 *)ptr;
+
+ return ret;
+}
Why is this needed? It looks like all the counters in hinic3_rx_queue_stats, hinic3_tx_queue_stats, and hinic3_port_stats are u64.