That USO works on these two cards 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. v1: https://lore.kernel.org/netdev/[email protected]/ v1 -> v2: - add missing prefixes on Fixes line (Eric) - collected Reviewed-by tags from Eric and Maciej 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
