Skip to contentSkip to conversation

idpf: add missing cpu_to_le32 in idpf_tx_splitq_build_flow_desc

PATCH Superseded Willem de Bruijn 2 participants 4 messages Jul 31 – Aug 3

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 idpf: add missing cpu_to_le32 in idpf_tx_splitq_build_flow_desc

From: Willem de Bruijn <[email protected]>

idpf_tx_splitq_build_flow_desc performs a 32-bit store to &cmd_dtype to set the 8-bit cmd_dtype and zero the adjacent 3-byte timestamp field in a single operation.

Descriptors are in little endian. Add missing cpu_to_le32 and cast to __le32 to ensure the fields are written correctly also on big endian platforms.

---

A follow-up so_txtime patch will initialize ts[] from params. At that point the 32-bit cast can be removed entirely and replaced with a straightforward u8 store to cmd_dtype.

https://lore.kernel.org/netdev/[email protected]/

---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/idpf/idpf_txrx.c +1 -1
index c724d429a7aa..91ca75e45463 100644
@@ -2408,7 +2408,7 @@ void idpf_tx_splitq_build_flow_desc(union idpf_tx_flex_desc *desc,
 				    struct idpf_tx_splitq_params *params,
 				    u16 td_cmd, u16 size)
 {
-	*(u32 *)&desc->flow.qw1.cmd_dtype = (u8)(params->dtype | td_cmd);
+	*(__le32 *)&desc->flow.qw1.cmd_dtype = cpu_to_le32((u8)(params->dtype | td_cmd));
 	desc->flow.qw1.rxr_bufsize = cpu_to_le16((u16)size);
 	desc->flow.qw1.compl_tag = cpu_to_le16(params->compl_tag);
 }
Signature · 1 line
2.55.0.508.g3f0d502094-goog
#1 lore raw
Quoted 11 lines · Willem de Bruijn

From: Willem de Bruijn <[email protected]>

idpf_tx_splitq_build_flow_desc performs a 32-bit store to &cmd_dtype to set the 8-bit cmd_dtype and zero the adjacent 3-byte timestamp field in a single operation.

Descriptors are in little endian. Add missing cpu_to_le32 and cast to __le32 to ensure the fields are written correctly also on big endian platforms.

Fixes 1a49cf814fe1 ("idpf: add Tx timestamp flows")

Forgot the tag. Apologies.

maintainer Reviewed-by
#2 lore raw
Quoted 11 lines · Willem de Bruijn
Quoted 10 lines · Willem de Bruijn

From: Willem de Bruijn <[email protected]>

idpf_tx_splitq_build_flow_desc performs a 32-bit store to &cmd_dtype to set the 8-bit cmd_dtype and zero the adjacent 3-byte timestamp field in a single operation.

Descriptors are in little endian. Add missing cpu_to_le32 and cast to __le32 to ensure the fields are written correctly also on big endian platforms.

Quoted 5 lines
Quoted 1 line
Fixes 1a49cf814fe1 ("idpf: add Tx timestamp flows")

Forgot the tag. Apologies.

I see it's for 'iwl-net' but IWL isn't on the send list. Seems straightforward enough that if netdev wants to take it directly, it's ok with me. If yes,

Otherwise, could you add the Fixes and include IWL ([email protected]) on the send?

Thanks,
Tony

#3 lore raw
Quoted 24 lines · Tony Nguyen
Quoted 11 lines · Willem de Bruijn
Quoted 10 lines · Willem de Bruijn

From: Willem de Bruijn <[email protected]>

idpf_tx_splitq_build_flow_desc performs a 32-bit store to &cmd_dtype to set the 8-bit cmd_dtype and zero the adjacent 3-byte timestamp field in a single operation.

Descriptors are in little endian. Add missing cpu_to_le32 and cast to __le32 to ensure the fields are written correctly also on big endian platforms.

Quoted 5 lines
Quoted 1 line
Fixes 1a49cf814fe1 ("idpf: add Tx timestamp flows")

Forgot the tag. Apologies.

I see it's for 'iwl-net' but IWL isn't on the send list. Seems straightforward enough that if netdev wants to take it directly, it's ok with me. If yes,

Quoted 8 lines

Otherwise, could you add the Fixes and include IWL ([email protected]) on the send?

Thanks,
Tony

Oops. Resent with both and your Reviewed-by. Thanks Tony.

https://lore.kernel.org/netdev/[email protected]/