Skip to content

Commit f4f4096

Browse files
roidayanSaeed Mahameed
authored andcommitted
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: 249ccc3 ("net/mlx5e: Add support for offloading traffic from uplink to uplink") Signed-off-by: Roi Dayan <[email protected]> Reviewed-by: Chris Mi <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]>
1 parent 9e06430 commit f4f4096

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ mlx5_eswitch_termtbl_hash(struct mlx5_flow_act *flow_act,
3030
sizeof(dest->vport.num), hash);
3131
hash = jhash((const void *)&dest->vport.vhca_id,
3232
sizeof(dest->vport.num), hash);
33-
if (dest->vport.pkt_reformat)
34-
hash = jhash(dest->vport.pkt_reformat,
35-
sizeof(*dest->vport.pkt_reformat),
33+
if (flow_act->pkt_reformat)
34+
hash = jhash(flow_act->pkt_reformat,
35+
sizeof(*flow_act->pkt_reformat),
3636
hash);
3737
return hash;
3838
}
@@ -53,9 +53,11 @@ mlx5_eswitch_termtbl_cmp(struct mlx5_flow_act *flow_act1,
5353
if (ret)
5454
return ret;
5555

56-
return dest1->vport.pkt_reformat && dest2->vport.pkt_reformat ?
57-
memcmp(dest1->vport.pkt_reformat, dest2->vport.pkt_reformat,
58-
sizeof(*dest1->vport.pkt_reformat)) : 0;
56+
if (flow_act1->pkt_reformat && flow_act2->pkt_reformat)
57+
return memcmp(flow_act1->pkt_reformat, flow_act2->pkt_reformat,
58+
sizeof(*flow_act1->pkt_reformat));
59+
60+
return !(flow_act1->pkt_reformat == flow_act2->pkt_reformat);
5961
}
6062

6163
static int

0 commit comments

Comments
 (0)