Skip to content

Commit c535f16

Browse files
ddvladNipaLocal
authored andcommitted
net/mlx5: CT: Use the correct counter offset
Specifying the counter action is not enough, as it is used by multiple counters that were allocated in a bulk. By omitting the offset, rules will be associated with a different counter from the same bulk. Subsequently, the CT subsystem checks the correct counter, assumes that no traffic has triggered the rule, and ages out the rule. The end result is intermittent offloading of long lived connections, as rules are aged out then promptly re-added. Fix this by specifying the correct offset along with the counter rule. Fixes: 34eea5b ("net/mlx5e: CT: Add initial support for Hardware Steering") Signed-off-by: Vlad Dogaru <[email protected]> Reviewed-by: Yevgeny Kliteynik <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent fdb2755 commit c535f16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc/ct_fs_hmfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ static void mlx5_ct_fs_hmfs_fill_rule_actions(struct mlx5_ct_fs_hmfs *fs_hmfs,
173173

174174
memset(rule_actions, 0, NUM_CT_HMFS_RULES * sizeof(*rule_actions));
175175
rule_actions[0].action = mlx5_fc_get_hws_action(fs_hmfs->ctx, attr->counter);
176+
rule_actions[0].counter.offset =
177+
attr->counter->id - attr->counter->bulk->base_id;
176178
/* Modify header is special, it may require extra arguments outside the action itself. */
177179
if (mh_action->mh_data) {
178180
rule_actions[1].modify_header.offset = mh_action->mh_data->offset;

0 commit comments

Comments
 (0)