Re: [PATCH net] net: sfc: Correct key_len for efx_tc_ct_zone_ht_params

From: Edward Cree
Date: Thu Jan 02 2025 - 10:37:06 EST


On 30/12/2024 09:37, Liang Jie wrote:
> From: Liang Jie <liangjie@xxxxxxxxxxx>
>
> In efx_tc_ct_zone_ht_params, the key_len was previously set to
> offsetof(struct efx_tc_ct_zone, linkage). This calculation is incorrect
> because it includes any padding between the zone field and the linkage
> field due to structure alignment, which can vary between systems.
>
> This patch updates key_len to use sizeof_field(struct efx_tc_ct_zone, zone)
> , ensuring that the hash table correctly uses the zone as the key. This fix
> prevents potential hash lookup errors and improves connection tracking
> reliability.
>
> Fixes: c3bb5c6acd4e ("sfc: functions to register for conntrack zone offload")
> Signed-off-by: Liang Jie <liangjie@xxxxxxxxxxx>

Thanks.

Acked-by: Edward Cree <ecree.xilinx@xxxxxxxxx>