Skip to content

Commit

Permalink
virtchnl: Fix layout of RSS structures
Browse files Browse the repository at this point in the history
[ Upstream commit 22f8b5d ]

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

Fixes: 65ece6d ("virtchnl: Add missing explicit padding to structures")
Signed-off-by: Norbert Ciosek <norbertx.ciosek@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
nciosekx authored and gregkh committed Apr 14, 2021
1 parent ffbb80e commit eab1127
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions include/linux/avf/virtchnl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit eab1127

Please sign in to comment.