* [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems
@ 2026-10-27 12:14 Magnus Karlsson
2026-10-27 12:14 ` [PATCH iwl-net 1/2] ice: " Magnus Karlsson
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Magnus Karlsson @ 2026-10-27 12:14 UTC (permalink / raw)
To: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni
Cc: Magnus Karlsson
That USO works for these two cards on 64-bit systems is just pure
luck. Currently, the computation of the UDP segmentation header is
performed using sizeof() a pointer instead of the sizeof() the UDP
header that the pointer points to. Since the UDP header happens to be
8 bytes long and a pointer is 8 bytes long on a 64-bit system, this
works on all those systems. But no such luck for anyone using a 32-bit
system as 8 bytes != 4 bytes. So fix this by using sizeof() the UDP
header that the pointer points to instead.
This was found by an LLM while implementing something else that used USO.
Magnus Karlsson (2):
ice: fix USO for 32-bit systems
iavf: fix USO for 32-bit systems
drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.38.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH iwl-net 1/2] ice: fix USO for 32-bit systems
2026-10-27 12:14 [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems Magnus Karlsson
@ 2026-10-27 12:14 ` Magnus Karlsson
2026-10-27 12:45 ` Eric Dumazet
2026-10-27 12:14 ` [PATCH iwl-net 2/2] iavf: " Magnus Karlsson
2026-10-27 12:20 ` [PATCH iwl-net 0/2] ice: " netdev-bot+sinfo
2 siblings, 1 reply; 9+ messages in thread
From: Magnus Karlsson @ 2026-10-27 12:14 UTC (permalink / raw)
To: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni
Cc: Magnus Karlsson
That USO works for 64-bit systems is just pure luck. Currently, the
computation of the UDP segmentation header is performed using sizeof()
a pointer instead of the sizeof() the UDP header that the pointer
points to. Since the UDP header happens to be 8 bytes long and a
pointer is 8 bytes long on a 64-bit system, this works on all those
systems. But no such luck for anyone using a 32-bit system as 8 bytes
!= 4 bytes. So fix this by using sizeof() the UDP header that the
pointer points to instead.
This was found by an LLM while implementing something else that used USO.
Fixes: a54e3b8cffd6 ("Support UDP segmentation offload")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
drivers/net/ethernet/intel/ice/ice_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index a2c7c4962882..d9ea812c5c4e 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1925,7 +1925,7 @@ int ice_tso(struct ice_tx_buf *first, struct ice_tx_offload_params *off)
csum_replace_by_diff(&l4.udp->check,
(__force __wsum)htonl(paylen));
/* compute length of UDP segmentation header */
- off->header_len = (u8)sizeof(l4.udp) + l4_start;
+ off->header_len = sizeof(*l4.udp) + l4_start;
} else {
csum_replace_by_diff(&l4.tcp->check,
(__force __wsum)htonl(paylen));
--
2.38.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH iwl-net 2/2] iavf: fix USO for 32-bit systems
2026-10-27 12:14 [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems Magnus Karlsson
2026-10-27 12:14 ` [PATCH iwl-net 1/2] ice: " Magnus Karlsson
@ 2026-10-27 12:14 ` Magnus Karlsson
2026-10-27 12:43 ` Eric Dumazet
2026-10-27 12:20 ` [PATCH iwl-net 0/2] ice: " netdev-bot+sinfo
2 siblings, 1 reply; 9+ messages in thread
From: Magnus Karlsson @ 2026-10-27 12:14 UTC (permalink / raw)
To: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni
Cc: Magnus Karlsson
That USO works for 64-bit systems is just pure luck. Currently, the
computation of the UDP segmentation header is performed using sizeof()
a pointer instead of the sizeof() the UDP header that the pointer
points to. Since the UDP header happens to be 8 bytes long and a
pointer is 8 bytes long on a 64-bit system, this works on all those
systems. But no such luck for anyone using a 32-bit system as 8 bytes
!= 4 bytes. So fix this by using sizeof() the UDP header that the
pointer points to instead.
This was found by an LLM while implementing something else that used USO.
Fixes: c91a4f9feb67a199c2 ("add support for UDP Segmentation Offload")
Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
index 8982cf75466f..2c290d7788d2 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
@@ -1807,7 +1807,7 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
csum_replace_by_diff(&l4.udp->check,
(__force __wsum)htonl(paylen));
/* compute length of UDP segmentation header */
- *hdr_len = (u8)sizeof(l4.udp) + l4_offset;
+ *hdr_len = sizeof(*l4.udp) + l4_offset;
} else {
csum_replace_by_diff(&l4.tcp->check,
(__force __wsum)htonl(paylen));
--
2.38.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems
2026-10-27 12:14 [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems Magnus Karlsson
2026-10-27 12:14 ` [PATCH iwl-net 1/2] ice: " Magnus Karlsson
2026-10-27 12:14 ` [PATCH iwl-net 2/2] iavf: " Magnus Karlsson
@ 2026-10-27 12:20 ` netdev-bot+sinfo
2 siblings, 0 replies; 9+ messages in thread
From: netdev-bot+sinfo @ 2026-10-27 12:20 UTC (permalink / raw)
To: Magnus Karlsson
Cc: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
edumazet, kuba, pabeni
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 2/2] iavf: fix USO for 32-bit systems
2026-10-27 12:14 ` [PATCH iwl-net 2/2] iavf: " Magnus Karlsson
@ 2026-10-27 12:43 ` Eric Dumazet
2026-10-27 12:56 ` Magnus Karlsson
0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2026-10-27 12:43 UTC (permalink / raw)
To: Magnus Karlsson
Cc: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
kuba, pabeni
Le mar. 27 oct. 2026 à 13:15, Magnus Karlsson
<magnus.karlsson@intel.com> a écrit :
>
> That USO works for 64-bit systems is just pure luck. Currently, the
> computation of the UDP segmentation header is performed using sizeof()
> a pointer instead of the sizeof() the UDP header that the pointer
> points to. Since the UDP header happens to be 8 bytes long and a
> pointer is 8 bytes long on a 64-bit system, this works on all those
> systems. But no such luck for anyone using a 32-bit system as 8 bytes
> != 4 bytes. So fix this by using sizeof() the UDP header that the
> pointer points to instead.
>
> This was found by an LLM while implementing something else that used USO.
>
> Fixes: c91a4f9feb67a199c2 ("add support for UDP Segmentation Offload")
Missing prefix? This was really:
Fixes: c91a4f9feb67 ("iavf: add support for UDP Segmentation Offload")
Other than this,
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
> Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
> ---
> drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> index 8982cf75466f..2c290d7788d2 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> @@ -1807,7 +1807,7 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
> csum_replace_by_diff(&l4.udp->check,
> (__force __wsum)htonl(paylen));
> /* compute length of UDP segmentation header */
> - *hdr_len = (u8)sizeof(l4.udp) + l4_offset;
> + *hdr_len = sizeof(*l4.udp) + l4_offset;
> } else {
> csum_replace_by_diff(&l4.tcp->check,
> (__force __wsum)htonl(paylen));
> --
> 2.38.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 1/2] ice: fix USO for 32-bit systems
2026-10-27 12:14 ` [PATCH iwl-net 1/2] ice: " Magnus Karlsson
@ 2026-10-27 12:45 ` Eric Dumazet
0 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-10-27 12:45 UTC (permalink / raw)
To: Magnus Karlsson
Cc: magnus.karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
kuba, pabeni
Le mar. 27 oct. 2026 à 13:15, Magnus Karlsson
<magnus.karlsson@intel.com> a écrit :
>
> That USO works for 64-bit systems is just pure luck. Currently, the
> computation of the UDP segmentation header is performed using sizeof()
> a pointer instead of the sizeof() the UDP header that the pointer
> points to. Since the UDP header happens to be 8 bytes long and a
> pointer is 8 bytes long on a 64-bit system, this works on all those
> systems. But no such luck for anyone using a 32-bit system as 8 bytes
> != 4 bytes. So fix this by using sizeof() the UDP header that the
> pointer points to instead.
>
> This was found by an LLM while implementing something else that used USO.
>
> Fixes: a54e3b8cffd6 ("Support UDP segmentation offload")
Missing prefix?
Fixes: a54e3b8cffd6 ("ice: Support UDP segmentation offload")
Other than this,
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
pw-bot: cr
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 2/2] iavf: fix USO for 32-bit systems
2026-10-27 12:43 ` Eric Dumazet
@ 2026-10-27 12:56 ` Magnus Karlsson
2026-10-27 13:14 ` Maciej Fijalkowski
0 siblings, 1 reply; 9+ messages in thread
From: Magnus Karlsson @ 2026-10-27 12:56 UTC (permalink / raw)
To: Eric Dumazet
Cc: Magnus Karlsson, intel-wired-lan, anthony.l.nguyen, netdev,
maciej.fijalkowski, przemyslaw.kitszel, andrew+netdev, davem,
kuba, pabeni
On Tue, 27 Oct 2026 at 14:43, Eric Dumazet <edumazet@kernel.org> wrote:
>
> Le mar. 27 oct. 2026 à 13:15, Magnus Karlsson
> <magnus.karlsson@intel.com> a écrit :
> >
> > That USO works for 64-bit systems is just pure luck. Currently, the
> > computation of the UDP segmentation header is performed using sizeof()
> > a pointer instead of the sizeof() the UDP header that the pointer
> > points to. Since the UDP header happens to be 8 bytes long and a
> > pointer is 8 bytes long on a 64-bit system, this works on all those
> > systems. But no such luck for anyone using a 32-bit system as 8 bytes
> > != 4 bytes. So fix this by using sizeof() the UDP header that the
> > pointer points to instead.
> >
> > This was found by an LLM while implementing something else that used USO.
> >
> > Fixes: c91a4f9feb67a199c2 ("add support for UDP Segmentation Offload")
>
> Missing prefix? This was really:
>
> Fixes: c91a4f9feb67 ("iavf: add support for UDP Segmentation Offload")
You are correct on both accounts/patches. Do not know why I missed this, sorry.
Do you want a v2 with this added?
> Other than this,
> Reviewed-by: Eric Dumazet <edumazet@kernel.org>
>
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
> > ---
> > drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > index 8982cf75466f..2c290d7788d2 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > @@ -1807,7 +1807,7 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
> > csum_replace_by_diff(&l4.udp->check,
> > (__force __wsum)htonl(paylen));
> > /* compute length of UDP segmentation header */
> > - *hdr_len = (u8)sizeof(l4.udp) + l4_offset;
> > + *hdr_len = sizeof(*l4.udp) + l4_offset;
> > } else {
> > csum_replace_by_diff(&l4.tcp->check,
> > (__force __wsum)htonl(paylen));
> > --
> > 2.38.1
> >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 2/2] iavf: fix USO for 32-bit systems
2026-10-27 12:56 ` Magnus Karlsson
@ 2026-10-27 13:14 ` Maciej Fijalkowski
2026-10-27 13:15 ` Maciej Fijalkowski
0 siblings, 1 reply; 9+ messages in thread
From: Maciej Fijalkowski @ 2026-10-27 13:14 UTC (permalink / raw)
To: Magnus Karlsson
Cc: Eric Dumazet, Magnus Karlsson, intel-wired-lan, anthony.l.nguyen,
netdev, przemyslaw.kitszel, andrew+netdev, davem, kuba, pabeni
On Tue, Oct 27, 2026 at 02:56:07PM +0200, Magnus Karlsson wrote:
> On Tue, 27 Oct 2026 at 14:43, Eric Dumazet <edumazet@kernel.org> wrote:
> >
> > Le mar. 27 oct. 2026 à 13:15, Magnus Karlsson
> > <magnus.karlsson@intel.com> a écrit :
> > >
> > > That USO works for 64-bit systems is just pure luck. Currently, the
> > > computation of the UDP segmentation header is performed using sizeof()
> > > a pointer instead of the sizeof() the UDP header that the pointer
> > > points to. Since the UDP header happens to be 8 bytes long and a
> > > pointer is 8 bytes long on a 64-bit system, this works on all those
> > > systems. But no such luck for anyone using a 32-bit system as 8 bytes
> > > != 4 bytes. So fix this by using sizeof() the UDP header that the
> > > pointer points to instead.
> > >
> > > This was found by an LLM while implementing something else that used USO.
> > >
> > > Fixes: c91a4f9feb67a199c2 ("add support for UDP Segmentation Offload")
> >
> > Missing prefix? This was really:
> >
> > Fixes: c91a4f9feb67 ("iavf: add support for UDP Segmentation Offload")
>
> You are correct on both accounts/patches. Do not know why I missed this, sorry.
>
> Do you want a v2 with this added?
Current policy is that you need to wait 24h with posting next revisions.
Eric marked it as 'changes requested' so yes, you need a v2.
You can add my review tag as well, thanks for auditing intel drivers
against this bug.
MF
>
> > Other than this,
> > Reviewed-by: Eric Dumazet <edumazet@kernel.org>
> >
> > > Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
> > > ---
> > > drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > index 8982cf75466f..2c290d7788d2 100644
> > > --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > @@ -1807,7 +1807,7 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
> > > csum_replace_by_diff(&l4.udp->check,
> > > (__force __wsum)htonl(paylen));
> > > /* compute length of UDP segmentation header */
> > > - *hdr_len = (u8)sizeof(l4.udp) + l4_offset;
> > > + *hdr_len = sizeof(*l4.udp) + l4_offset;
> > > } else {
> > > csum_replace_by_diff(&l4.tcp->check,
> > > (__force __wsum)htonl(paylen));
> > > --
> > > 2.38.1
> > >
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH iwl-net 2/2] iavf: fix USO for 32-bit systems
2026-10-27 13:14 ` Maciej Fijalkowski
@ 2026-10-27 13:15 ` Maciej Fijalkowski
0 siblings, 0 replies; 9+ messages in thread
From: Maciej Fijalkowski @ 2026-10-27 13:15 UTC (permalink / raw)
To: Magnus Karlsson
Cc: Eric Dumazet, Magnus Karlsson, intel-wired-lan, anthony.l.nguyen,
netdev, przemyslaw.kitszel, andrew+netdev, davem, kuba, pabeni
On Tue, Oct 27, 2026 at 02:14:40PM +0100, Maciej Fijalkowski wrote:
> On Tue, Oct 27, 2026 at 02:56:07PM +0200, Magnus Karlsson wrote:
> > On Tue, 27 Oct 2026 at 14:43, Eric Dumazet <edumazet@kernel.org> wrote:
> > >
> > > Le mar. 27 oct. 2026 à 13:15, Magnus Karlsson
> > > <magnus.karlsson@intel.com> a écrit :
> > > >
> > > > That USO works for 64-bit systems is just pure luck. Currently, the
> > > > computation of the UDP segmentation header is performed using sizeof()
> > > > a pointer instead of the sizeof() the UDP header that the pointer
> > > > points to. Since the UDP header happens to be 8 bytes long and a
> > > > pointer is 8 bytes long on a 64-bit system, this works on all those
> > > > systems. But no such luck for anyone using a 32-bit system as 8 bytes
> > > > != 4 bytes. So fix this by using sizeof() the UDP header that the
> > > > pointer points to instead.
> > > >
> > > > This was found by an LLM while implementing something else that used USO.
> > > >
> > > > Fixes: c91a4f9feb67a199c2 ("add support for UDP Segmentation Offload")
> > >
> > > Missing prefix? This was really:
> > >
> > > Fixes: c91a4f9feb67 ("iavf: add support for UDP Segmentation Offload")
> >
> > You are correct on both accounts/patches. Do not know why I missed this, sorry.
> >
> > Do you want a v2 with this added?
>
> Current policy is that you need to wait 24h with posting next revisions.
> Eric marked it as 'changes requested' so yes, you need a v2.
>
> You can add my review tag as well, thanks for auditing intel drivers
> against this bug.
Also I believe currently we should not CC netdev on iwl submissions.
Przemek, Tony, correct me if I'm wrong.
>
> MF
>
> >
> > > Other than this,
> > > Reviewed-by: Eric Dumazet <edumazet@kernel.org>
> > >
> > > > Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
> > > > ---
> > > > drivers/net/ethernet/intel/iavf/iavf_txrx.c | 2 +-
> > > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > > index 8982cf75466f..2c290d7788d2 100644
> > > > --- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > > +++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
> > > > @@ -1807,7 +1807,7 @@ static int iavf_tso(struct iavf_tx_buffer *first, u8 *hdr_len,
> > > > csum_replace_by_diff(&l4.udp->check,
> > > > (__force __wsum)htonl(paylen));
> > > > /* compute length of UDP segmentation header */
> > > > - *hdr_len = (u8)sizeof(l4.udp) + l4_offset;
> > > > + *hdr_len = sizeof(*l4.udp) + l4_offset;
> > > > } else {
> > > > csum_replace_by_diff(&l4.tcp->check,
> > > > (__force __wsum)htonl(paylen));
> > > > --
> > > > 2.38.1
> > > >
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-10-27 13:15 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-27 12:14 [PATCH iwl-net 0/2] ice: iavf: fix USO for 32-bit systems Magnus Karlsson
2026-10-27 12:14 ` [PATCH iwl-net 1/2] ice: " Magnus Karlsson
2026-10-27 12:45 ` Eric Dumazet
2026-10-27 12:14 ` [PATCH iwl-net 2/2] iavf: " Magnus Karlsson
2026-10-27 12:43 ` Eric Dumazet
2026-10-27 12:56 ` Magnus Karlsson
2026-10-27 13:14 ` Maciej Fijalkowski
2026-10-27 13:15 ` Maciej Fijalkowski
2026-10-27 12:20 ` [PATCH iwl-net 0/2] ice: " netdev-bot+sinfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox