Skip to contentSkip to conversation

virtchnl: Fix layout of RSS structures

PATCH New Tony Nguyen 2 participants 2 messages Jan 28, 2021 – Mar 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 virtchnl: Fix layout of RSS structures

From: Norbert Ciosek <[email protected]>

Remove padding from RSS structures. Previous layout could lead to unwanted compiler optimizations in loops when iterating over key and lut arrays.

Fixes 65ece6de0114 ("virtchnl: Add missing explicit padding to structures")

---
v3: Removed footer
v2: Removed padding instead of moving "key" and "lut" fields at the end of RSS structures.

 include/linux/avf/virtchnl.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/avf/virtchnl.h +0 -2
index 40bad71865ea..532bcbfc4716 100644
@@ -476,7 +476,6 @@ struct virtchnl_rss_key {
 	u16 vsi_id;
 	u16 key_len;
 	u8 key[1];         /* RSS hash key, packed bytes */
-	u8 pad[1];
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_key);
@@ -485,7 +484,6 @@ struct virtchnl_rss_lut {
 	u16 vsi_id;
 	u16 lut_entries;
 	u8 lut[1];        /* RSS lookup table */
-	u8 pad[1];
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_lut);
Signature · 1 line
2.26.2
#1 lore raw

PATCH v3 1/1 virtchnl: Fix layout of RSS structures

Quoted 47 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Tony Nguyen
Sent: czwartek, 28 stycznia 2021 19:17
To: intel-wired-lan at lists.osuosl.org
Cc: Ciosek, NorbertX <[email protected]>
Subject: [Intel-wired-lan] [net-queue v3] virtchnl: Fix layout of RSS structures

From: Norbert Ciosek <[email protected]>

Remove padding from RSS structures. Previous layout could lead to unwanted compiler optimizations in loops when iterating over key and lut arrays.

Fixes 65ece6de0114 ("virtchnl: Add missing explicit padding to structures")

---
v3: Removed footer
v2: Removed padding instead of moving "key" and "lut" fields at the end of RSS structures.

 include/linux/avf/virtchnl.h | 2 --
 1 file changed, 2 deletions(-)
include/linux/avf/virtchnl.h index renamed from include/linux/avf/virtchnl.h +0 -0

40bad71865ea..532bcbfc4716 100644

include/linux/avf/virtchnl.h +0 -1
@@ -476,7 +476,6 @@ struct virtchnl_rss_key {
 	u16 vsi_id;
 	u16 key_len;
 	u8 key[1];         /* RSS hash key, packed bytes */
-	u8 pad[1];
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_key); @@ -485,7 +484,6 @@

struct virtchnl_rss_lut {

include/linux/avf/virtchnl.h +0 -2
 	u16 vsi_id;
 	u16 lut_entries;
 	u8 lut[1];        /* RSS lookup table */
-	u8 pad[1];
 };
 
 VIRTCHNL_CHECK_STRUCT_LEN(6, virtchnl_rss_lut);
--
Quoted 2 lines

2.26.2