Skip to content

Commit 763114d

Browse files
Liang Jiemehmetb0
authored andcommitted
net: sfc: Correct key_len for efx_tc_ct_zone_ht_params
BugLink: https://bugs.launchpad.net/bugs/2106632 [ Upstream commit a8620de72e5676993ec3a3b975f7c10908f5f60f ] 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: c3bb5c6 ("sfc: functions to register for conntrack zone offload") Signed-off-by: Liang Jie <liangjie@lixiang.com> Acked-by: Edward Cree <ecree.xilinx@gmail.com> Link: https://patch.msgid.link/20241230093709.3226854-1-buaajxlj@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>
1 parent b277977 commit 763114d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/sfc/tc_conntrack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static int efx_tc_flow_block(enum tc_setup_type type, void *type_data,
1616
void *cb_priv);
1717

1818
static const struct rhashtable_params efx_tc_ct_zone_ht_params = {
19-
.key_len = offsetof(struct efx_tc_ct_zone, linkage),
19+
.key_len = sizeof_field(struct efx_tc_ct_zone, zone),
2020
.key_offset = 0,
2121
.head_offset = offsetof(struct efx_tc_ct_zone, linkage),
2222
};

0 commit comments

Comments
 (0)