Re: [PATCH iwl-next v4 5/9] igc: Add support for frame preemption verification

From: Abdul Rahim, Faizal
Date: Tue Feb 18 2025 - 20:49:07 EST




On 17/2/2025 7:31 pm, Simon Horman wrote:
On Mon, Feb 10, 2025 at 02:02:03AM -0500, Faizal Rahim wrote:

...

diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c

...

+bool igc_fpe_transmitted_smd_v(union igc_adv_tx_desc *tx_desc)
+{
+ u8 smd = FIELD_GET(IGC_TXD_POPTS_SMD_MASK, tx_desc->read.olinfo_status);

olininfo_status is little-endian, so I think it needs
to be converted to host byte order when used as an
argument to FIELD_GET().

Flagged by Sparse.

+
+ return smd == SMD_V;
+}

...

diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.h b/drivers/net/ethernet/intel/igc/igc_tsn.h

...

+static inline void igc_fpe_lp_event_status(union igc_adv_rx_desc *rx_desc,
+ struct ethtool_mmsv *mmsv)
+{
+ __le32 status_error = le32_to_cpu(rx_desc->wb.upper.status_error);

It looks like the type of status_error should be a host byte order integer,
such as u32.

Also flagged by Sparse.

Thanks for spotting these, I'll update them.