[PATCH 3/4] net/gve: add checks for flow rule struct padding

Jasper Tran O'Leary
2026-03-27T00:19:42Z

Enforce struct size matches at compile time to ensure we do not have
unexpected padding added. Other admin queue structs already have this
check, so add it to flow rule structs as well.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
---
drivers/net/gve/gve_flow_rule.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/gve/gve_flow_rule.h b/drivers/net/gve/gve_flow_rule.h
index d597a6c..bdf2955 100644
--- a/drivers/net/gve/gve_flow_rule.h
+++ b/drivers/net/gve/gve_flow_rule.h
@@ -41,6 +41,7 @@ struct gve_flow_spec {
u8 tclass;
};
};
+GVE_CHECK_STRUCT_LEN(40, gve_flow_spec);

/* Flow rule parameters using mixed endianness.
* - flow_type and action are guest endian.
@@ -55,6 +56,7 @@ struct gve_flow_rule_params {
struct gve_flow_spec key;
struct gve_flow_spec mask;
};
+GVE_CHECK_STRUCT_LEN(84, gve_flow_rule_params);

struct gve_priv;

--
2.53.0.1118.gaef5881109-goog