Skip to content

Commit d37bd5e

Browse files
roidayanSaeed Mahameed
authored andcommitted
net/mlx5e: CT: Correctly get flow rule
The correct way is to us the flow_cls_offload_flow_rule() wrapper instead of f->rule directly. Fixes: 4c3844d ("net/mlx5e: CT: Introduce connection tracking") Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Oz Shlomo <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 5e911e2 commit d37bd5e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,14 +699,15 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
699699
struct netlink_ext_ack *extack)
700700
{
701701
struct mlx5_tc_ct_priv *ct_priv = mlx5_tc_ct_get_ct_priv(priv);
702+
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
702703
struct flow_dissector_key_ct *mask, *key;
703704
bool trk, est, untrk, unest, new;
704705
u32 ctstate = 0, ctstate_mask = 0;
705706
u16 ct_state_on, ct_state_off;
706707
u16 ct_state, ct_state_mask;
707708
struct flow_match_ct match;
708709

709-
if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
710+
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
710711
return 0;
711712

712713
if (!ct_priv) {
@@ -715,7 +716,7 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
715716
return -EOPNOTSUPP;
716717
}
717718

718-
flow_rule_match_ct(f->rule, &match);
719+
flow_rule_match_ct(rule, &match);
719720

720721
key = match.key;
721722
mask = match.mask;

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
130130
struct flow_cls_offload *f,
131131
struct netlink_ext_ack *extack)
132132
{
133-
if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
133+
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
134+
135+
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
134136
return 0;
135137

136138
NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");

0 commit comments

Comments
 (0)