RE: [EXTERNAL] [PATCH v6 1/6] common/cnxk: replace variable length state array

Tejasree Kondoj
2026-03-02T19:06:27Z

Hi Stephen,

Minor nit inline. With that

Acked-by: Tejasree Kondoj <ktejasree@marvell.com>

> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Thursday, February 5, 2026 11:26 PM
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Nithin Kumar
> Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar Kokkilagadda
> <kirankumark@marvell.com>; Sunil Kumar Kori <skori@marvell.com>; Satha
> Koteswara Rao Kottidi <skoteshwar@marvell.com>; Harman Kalra
> <hkalra@marvell.com>
> Subject: [EXTERNAL] [PATCH v6 1/6] common/cnxk: replace variable length
> state array
>
> The cipher function is always called with in_len = 16
> and there is an existing define for that.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/common/cnxk/roc_aes.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/common/cnxk/roc_aes.c b/drivers/common/cnxk/roc_aes.c
> index d84feb546a..babf149ccf 100644
> --- a/drivers/common/cnxk/roc_aes.c
> +++ b/drivers/common/cnxk/roc_aes.c
> @@ -157,9 +157,10 @@ static void
> cipher(uint8_t *in, uint8_t *out, uint32_t *ks, uint32_t key_rounds, uint8_t
> in_len)
> {
> uint8_t data_word_len = in_len / sizeof(uint32_t);
> - uint32_t state[data_word_len];
> + uint32_t state[AES_HASH_KEY_LEN / sizeof(uint32_t)];
[Tejasree] This line needs to be moved up to maintain reverse xmas tree.

> unsigned int i, round;
>
> + PLT_ASSERT(in_len <= AES_HASH_KEY_LEN);
> memcpy(state, in, sizeof(state));
>
> /* AddRoundKey(state, w[0, Nb-1]) // See Sec. 5.1.4 */
> --
> 2.51.0