[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231218120858.GC6288@kernel.org>
Date: Mon, 18 Dec 2023 12:08:58 +0000
From: Simon Horman <horms@...nel.org>
To: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
Cc: intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
larysa.zaremba@...el.com, przemyslaw.kitszel@...el.com,
aleksander.lobakin@...el.com
Subject: Re: [PATCH iwl-net] idpf: avoid compiler introduced padding in
virtchnl2_rss_key struct
On Fri, Dec 15, 2023 at 03:48:07PM -0800, Pavan Kumar Linga wrote:
> Size of the virtchnl2_rss_key struct should be 7 bytes but the
> compiler introduces a padding byte for the structure alignment.
> This results in idpf sending an additional byte of memory to the device
> control plane than the expected buffer size. As the control plane
> enforces virtchnl message size checks to validate the message,
> set RSS key message fails resulting in the driver load failure.
>
> Remove implicit compiler padding by using "__packed" structure
> attribute for the virtchnl2_rss_key struct.
>
> Also there is no need to use __DECLARE_FLEX_ARRAY macro for the
> 'key_flex' struct field. So drop it.
>
> Fixes: 0d7502a9b4a7 ("virtchnl: add virtchnl version 2 ops")
> Reviewed-by: Larysa Zaremba <larysa.zaremba@...el.com>
> Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@...el.com>
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists