mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
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: 4c3844d9e9
("net/mlx5e: CT: Introduce connection tracking")
Signed-off-by: Roi Dayan <roid@mellanox.com>
Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
5e911e2c06
commit
d37bd5e81e
2 changed files with 6 additions and 3 deletions
|
@ -699,6 +699,7 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct mlx5_tc_ct_priv *ct_priv = mlx5_tc_ct_get_ct_priv(priv);
|
struct mlx5_tc_ct_priv *ct_priv = mlx5_tc_ct_get_ct_priv(priv);
|
||||||
|
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
|
||||||
struct flow_dissector_key_ct *mask, *key;
|
struct flow_dissector_key_ct *mask, *key;
|
||||||
bool trk, est, untrk, unest, new;
|
bool trk, est, untrk, unest, new;
|
||||||
u32 ctstate = 0, ctstate_mask = 0;
|
u32 ctstate = 0, ctstate_mask = 0;
|
||||||
|
@ -706,7 +707,7 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
|
||||||
u16 ct_state, ct_state_mask;
|
u16 ct_state, ct_state_mask;
|
||||||
struct flow_match_ct match;
|
struct flow_match_ct match;
|
||||||
|
|
||||||
if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
|
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!ct_priv) {
|
if (!ct_priv) {
|
||||||
|
@ -715,7 +716,7 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
flow_rule_match_ct(f->rule, &match);
|
flow_rule_match_ct(rule, &match);
|
||||||
|
|
||||||
key = match.key;
|
key = match.key;
|
||||||
mask = match.mask;
|
mask = match.mask;
|
||||||
|
|
|
@ -130,7 +130,9 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv,
|
||||||
struct flow_cls_offload *f,
|
struct flow_cls_offload *f,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT))
|
struct flow_rule *rule = flow_cls_offload_flow_rule(f);
|
||||||
|
|
||||||
|
if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CT))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");
|
NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled.");
|
||||||
|
|
Loading…
Reference in a new issue