Skip to contentSkip to conversation

geneve: fix hint header definition wrt endianness

PATCH Applied Antoine Tenart 3 participants 3 messages Jul 9 – Jul 21

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 geneve: fix hint header definition wrt endianness

Bitfields are packed differently depending on the endianness, take it into account in the GRO hint header definition.

Fixes e0a12cbf262b ("geneve: add GRO hint output path")
Cc Paolo Abeni <[email protected]>
---
 drivers/net/geneve.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/geneve.c +10 -1
index 9afff7bcaa0b..b25b0c4de4d1 100644
@@ -43,8 +43,17 @@ MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN");
 #define GENEVE_OPT_GRO_HINT_LEN		1
 
 struct geneve_opt_gro_hint {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
 	u8	inner_proto_id:2,
-		nested_is_v6:1;
+		nested_is_v6:1,
+		rsvd:5;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+	u8	rsvd:5,
+		nested_is_v6:1,
+		inner_proto_id:2;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
 	u8	nested_nh_offset;
 	u8	nested_tp_offset;
 	u8	nested_hdr_len;
Signature · 1 line
2.55.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Antoine Tenart

Bitfields are packed differently depending on the endianness, take it into account in the GRO hint header definition.

Fixes e0a12cbf262b ("geneve: add GRO hint output path")
Cc Paolo Abeni <[email protected]>
#2 lore raw
In reply to Antoine Tenart
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Thu, 9 Jul 2026 14:48:00 +0200 you wrote:

Bitfields are packed differently depending on the endianness, take it into account in the GRO hint header definition.

Fixes e0a12cbf262b ("geneve: add GRO hint output path")
Cc Paolo Abeni <[email protected]>

[...]

Here is the summary with links:
- [net] geneve: fix hint header definition wrt endianness

    https://git.kernel.org/netdev/net/c/751bfa982b4a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html