net/qrtr/af_qrtr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
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.
Fixes: 5fdeb0d372ab ("net: qrtr: Implement outgoing flow control")
Signed-off-by: Alexander Wilhelm <alexander.wilhelm@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: 70b439bf06f6a12e491f827fa81a9887a11501f9
change-id: 20260324-b4-qrtr-fix-confirm_rx-on-big-endian-ee2b9637d265
Best regards,
--
Alexander Wilhelm <alexander.wilhelm@westermo.com>
On Tue, Mar 24, 2026 at 08:50:33AM +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.
>
> Fixes: 5fdeb0d372ab ("net: qrtr: Implement outgoing flow control")
> Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
- Mani
> ---
> 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: 70b439bf06f6a12e491f827fa81a9887a11501f9
> change-id: 20260324-b4-qrtr-fix-confirm_rx-on-big-endian-ee2b9637d265
>
> Best regards,
> --
> Alexander Wilhelm <alexander.wilhelm@westermo.com>
>
--
மணிவண்ணன் சதாசிவம்
On Tue, Mar 24, 2026 at 01:28:32PM +0530, Manivannan Sadhasivam wrote:
> On Tue, Mar 24, 2026 at 08:50:33AM +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.
> >
> > Fixes: 5fdeb0d372ab ("net: qrtr: Implement outgoing flow control")
> > Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
>
> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Sorry if this contradicts my review of v1.
But as this isn't strictly necessary let's target net-next
and drop the Fixes tag.
...
--
pw-bot: changes-requested
On Wed, Mar 25, 2026 at 06:07:37PM +0000, Simon Horman wrote:
> On Tue, Mar 24, 2026 at 01:28:32PM +0530, Manivannan Sadhasivam wrote:
> > On Tue, Mar 24, 2026 at 08:50:33AM +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.
> > >
> > > Fixes: 5fdeb0d372ab ("net: qrtr: Implement outgoing flow control")
> > > Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
> >
> > Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
>
> Sorry if this contradicts my review of v1.
>
> But as this isn't strictly necessary let's target net-next
> and drop the Fixes tag.
Sure, I will rebase onto the latest `net-next` repository and send out `v3`,
without a "Fixes" tag.
Best regards
Alexander Wilhelm
On Thu, Mar 26, 2026 at 07:45:07AM +0100, Alexander Wilhelm wrote:
> On Wed, Mar 25, 2026 at 06:07:37PM +0000, Simon Horman wrote:
> > On Tue, Mar 24, 2026 at 01:28:32PM +0530, Manivannan Sadhasivam wrote:
> > > On Tue, Mar 24, 2026 at 08:50:33AM +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.
> > > >
> > > > Fixes: 5fdeb0d372ab ("net: qrtr: Implement outgoing flow control")
> > > > Signed-off-by: Alexander Wilhelm <alexander.wilhelm@westermo.com>
> > >
> > > Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
> >
> > Sorry if this contradicts my review of v1.
> >
> > But as this isn't strictly necessary let's target net-next
> > and drop the Fixes tag.
>
> Sure, I will rebase onto the latest `net-next` repository and send out `v3`,
> without a "Fixes" tag.
>
FWIW: Adding Fixes tag doesn't mean that the patch should be queued for -rcS.
- Mani
--
மணிவண்ணன் சதாசிவம்
© 2016 - 2026 Red Hat, Inc.