Commit f4f4096b authored by Roi Dayan's avatar Roi Dayan Committed by Saeed Mahameed

net/mlx5e: E-Switch, Fix comparing termination table instance

The pkt_reformat pointer being saved under flow_act and not
dest attribute in the termination table instance.
Fix the comparison pointers.

Also fix returning success if one pkt_reformat pointer is null
and the other is not.

Fixes: 249ccc3c ("net/mlx5e: Add support for offloading traffic from uplink to uplink")
Signed-off-by: default avatarRoi Dayan <roid@nvidia.com>
Reviewed-by: default avatarChris Mi <cmi@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 9e064308
...@@ -30,9 +30,9 @@ mlx5_eswitch_termtbl_hash(struct mlx5_flow_act *flow_act, ...@@ -30,9 +30,9 @@ mlx5_eswitch_termtbl_hash(struct mlx5_flow_act *flow_act,
sizeof(dest->vport.num), hash); sizeof(dest->vport.num), hash);
hash = jhash((const void *)&dest->vport.vhca_id, hash = jhash((const void *)&dest->vport.vhca_id,
sizeof(dest->vport.num), hash); sizeof(dest->vport.num), hash);
if (dest->vport.pkt_reformat) if (flow_act->pkt_reformat)
hash = jhash(dest->vport.pkt_reformat, hash = jhash(flow_act->pkt_reformat,
sizeof(*dest->vport.pkt_reformat), sizeof(*flow_act->pkt_reformat),
hash); hash);
return hash; return hash;
} }
...@@ -53,9 +53,11 @@ mlx5_eswitch_termtbl_cmp(struct mlx5_flow_act *flow_act1, ...@@ -53,9 +53,11 @@ mlx5_eswitch_termtbl_cmp(struct mlx5_flow_act *flow_act1,
if (ret) if (ret)
return ret; return ret;
return dest1->vport.pkt_reformat && dest2->vport.pkt_reformat ? if (flow_act1->pkt_reformat && flow_act2->pkt_reformat)
memcmp(dest1->vport.pkt_reformat, dest2->vport.pkt_reformat, return memcmp(flow_act1->pkt_reformat, flow_act2->pkt_reformat,
sizeof(*dest1->vport.pkt_reformat)) : 0; sizeof(*flow_act1->pkt_reformat));
return !(flow_act1->pkt_reformat == flow_act2->pkt_reformat);
} }
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment