Skip to content

Commit b36fc87

Browse files
IronShenkuba-moo
authored andcommitted
net: hns3: fix bug when calculating the TCAM table info
The function hclge_fd_convert_tuple() is used to convert tuples and tuples mask to TCAM x and y. But it misuses the source mac as source mac mask when convert INNER_SRC_MAC, which may cause the flow director rule works unexpectedly. So fix it. Fixes: 1173286 ("net: hns3: Add input key and action config support for flow director") Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Huazhong Tan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c75ec14 commit b36fc87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5245,9 +5245,9 @@ static bool hclge_fd_convert_tuple(u32 tuple_bit, u8 *key_x, u8 *key_y,
52455245
case BIT(INNER_SRC_MAC):
52465246
for (i = 0; i < ETH_ALEN; i++) {
52475247
calc_x(key_x[ETH_ALEN - 1 - i], rule->tuples.src_mac[i],
5248-
rule->tuples.src_mac[i]);
5248+
rule->tuples_mask.src_mac[i]);
52495249
calc_y(key_y[ETH_ALEN - 1 - i], rule->tuples.src_mac[i],
5250-
rule->tuples.src_mac[i]);
5250+
rule->tuples_mask.src_mac[i]);
52515251
}
52525252

52535253
return true;

0 commit comments

Comments
 (0)