public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field
@ 2026-03-26  7:17 Alexander Wilhelm
  2026-03-27  9:46 ` Simon Horman
  2026-03-27 12:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Wilhelm @ 2026-03-26  7:17 UTC (permalink / raw)
  To: Manivannan Sadhasivam, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Bjorn Andersson
  Cc: linux-arm-msm, netdev, linux-kernel

Convert confirm_rx to little endian when enqueueing and convert it back on
receive. This fixes control flow on big endian hosts, little endian is
unaffected.

On transmit, store confirm_rx as __le32 using cpu_to_le32(). On receive,
apply le32_to_cpu() before using the value. !! ensures the value is 0 or 1
in native endianness, so the conversion isn’t strictly required here, but
it is kept for consistency and clarity.

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
---
Changes in v3:
- Rebase on latest net-next tree
- Remove "Fixes" tag
- Link to v2: https://lore.kernel.org/r/20260324-b4-qrtr-fix-confirm_rx-on-big-endian-v2-1-674fb3f4865b@westermo.com

Changes in v2:
- Rebase on latest net tree
- Improve commit message
- Link to v1: https://lore.kernel.org/r/20260320-qrtr-fix-confirm_rx-on-big-endian-v1-1-e1a337dc1a38@westermo.com
---
 net/qrtr/af_qrtr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/qrtr/af_qrtr.c b/net/qrtr/af_qrtr.c
index 55fd2dd37588..bea1f1720e7f 100644
--- a/net/qrtr/af_qrtr.c
+++ b/net/qrtr/af_qrtr.c
@@ -365,7 +365,7 @@ static int qrtr_node_enqueue(struct qrtr_node *node, struct sk_buff *skb,
 	}
 
 	hdr->size = cpu_to_le32(len);
-	hdr->confirm_rx = !!confirm_rx;
+	hdr->confirm_rx = cpu_to_le32(!!confirm_rx);
 
 	rc = skb_put_padto(skb, ALIGN(len, 4) + sizeof(*hdr));
 
@@ -466,7 +466,7 @@ int qrtr_endpoint_post(struct qrtr_endpoint *ep, const void *data, size_t len)
 		cb->type = le32_to_cpu(v1->type);
 		cb->src_node = le32_to_cpu(v1->src_node_id);
 		cb->src_port = le32_to_cpu(v1->src_port_id);
-		cb->confirm_rx = !!v1->confirm_rx;
+		cb->confirm_rx = !!le32_to_cpu(v1->confirm_rx);
 		cb->dst_node = le32_to_cpu(v1->dst_node_id);
 		cb->dst_port = le32_to_cpu(v1->dst_port_id);
 

---
base-commit: d1e59a46973719e458bec78d00dd767d7a7ba71f
change-id: 20260324-b4-qrtr-fix-confirm_rx-on-big-endian-ee2b9637d265

Best regards,
-- 
Alexander Wilhelm <alexander.wilhelm@westermo.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field
  2026-03-26  7:17 [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field Alexander Wilhelm
@ 2026-03-27  9:46 ` Simon Horman
  2026-03-27 12:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2026-03-27  9:46 UTC (permalink / raw)
  To: Alexander Wilhelm
  Cc: Manivannan Sadhasivam, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Bjorn Andersson, linux-arm-msm,
	netdev, linux-kernel

On Thu, Mar 26, 2026 at 08:17:52AM +0100, Alexander Wilhelm wrote:
> Convert confirm_rx to little endian when enqueueing and convert it back on
> receive. This fixes control flow on big endian hosts, little endian is
> unaffected.
> 
> On transmit, store confirm_rx as __le32 using cpu_to_le32(). On receive,
> apply le32_to_cpu() before using the value. !! ensures the value is 0 or 1
> in native endianness, so the conversion isn’t strictly required here, but
> it is kept for consistency and clarity.
> 
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
> ---
> Changes in v3:
> - Rebase on latest net-next tree
> - Remove "Fixes" tag
> - Link to v2: https://lore.kernel.org/r/20260324-b4-qrtr-fix-confirm_rx-on-big-endian-v2-1-674fb3f4865b@westermo.com
> 
> Changes in v2:
> - Rebase on latest net tree
> - Improve commit message
> - Link to v1: https://lore.kernel.org/r/20260320-qrtr-fix-confirm_rx-on-big-endian-v1-1-e1a337dc1a38@westermo.com

Thanks for the updates.

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field
  2026-03-26  7:17 [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field Alexander Wilhelm
  2026-03-27  9:46 ` Simon Horman
@ 2026-03-27 12:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-03-27 12:20 UTC (permalink / raw)
  To: Alexander Wilhelm
  Cc: mani, davem, edumazet, kuba, pabeni, horms, andersson,
	linux-arm-msm, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 26 Mar 2026 08:17:52 +0100 you wrote:
> Convert confirm_rx to little endian when enqueueing and convert it back on
> receive. This fixes control flow on big endian hosts, little endian is
> unaffected.
> 
> On transmit, store confirm_rx as __le32 using cpu_to_le32(). On receive,
> apply le32_to_cpu() before using the value. !! ensures the value is 0 or 1
> in native endianness, so the conversion isn’t strictly required here, but
> it is kept for consistency and clarity.
> 
> [...]

Here is the summary with links:
  - [net-next,v3] net: qrtr: fix endian handling of confirm_rx field
    https://git.kernel.org/netdev/net-next/c/e4cf6087cab3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-27 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-26  7:17 [PATCH net-next v3] net: qrtr: fix endian handling of confirm_rx field Alexander Wilhelm
2026-03-27  9:46 ` Simon Horman
2026-03-27 12:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox