Skip to content

Commit f058e46

Browse files
liuyonglong86davem330
authored andcommitted
net: hns: fix ICMP6 neighbor solicitation messages discard problem
ICMP6 neighbor solicitation messages will be discard by the Hip06 chips, because of not setting forwarding pool. Enable promisc mode has the same problem. This patch fix the wrong forwarding table configs for the multicast vague matching when enable promisc mode, and add forwarding pool for the forwarding table. Signed-off-by: Yonglong Liu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c0b0984 commit f058e46

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2750,6 +2750,17 @@ int hns_dsaf_get_regs_count(void)
27502750
return DSAF_DUMP_REGS_NUM;
27512751
}
27522752

2753+
static int hns_dsaf_get_port_id(u8 port)
2754+
{
2755+
if (port < DSAF_SERVICE_NW_NUM)
2756+
return port;
2757+
2758+
if (port >= DSAF_BASE_INNER_PORT_NUM)
2759+
return port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM;
2760+
2761+
return -EINVAL;
2762+
}
2763+
27532764
static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
27542765
{
27552766
struct dsaf_tbl_tcam_ucast_cfg tbl_tcam_ucast = {0, 1, 0, 0, 0x80};
@@ -2815,23 +2826,33 @@ static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
28152826
memset(&temp_key, 0x0, sizeof(temp_key));
28162827
mask_entry.addr[0] = 0x01;
28172828
hns_dsaf_set_mac_key(dsaf_dev, &mask_key, mask_entry.in_vlan_id,
2818-
port, mask_entry.addr);
2829+
0xf, mask_entry.addr);
28192830
tbl_tcam_mcast.tbl_mcast_item_vld = 1;
28202831
tbl_tcam_mcast.tbl_mcast_old_en = 0;
28212832

2822-
if (port < DSAF_SERVICE_NW_NUM) {
2823-
mskid = port;
2824-
} else if (port >= DSAF_BASE_INNER_PORT_NUM) {
2825-
mskid = port - DSAF_BASE_INNER_PORT_NUM + DSAF_SERVICE_NW_NUM;
2826-
} else {
2833+
/* set MAC port to handle multicast */
2834+
mskid = hns_dsaf_get_port_id(port);
2835+
if (mskid == -EINVAL) {
28272836
dev_err(dsaf_dev->dev, "%s,pnum(%d)error,key(%#x:%#x)\n",
28282837
dsaf_dev->ae_dev.name, port,
28292838
mask_key.high.val, mask_key.low.val);
28302839
return;
28312840
}
2841+
dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32],
2842+
mskid % 32, 1);
28322843

2844+
/* set pool bit map to handle multicast */
2845+
mskid = hns_dsaf_get_port_id(port_num);
2846+
if (mskid == -EINVAL) {
2847+
dev_err(dsaf_dev->dev,
2848+
"%s, pool bit map pnum(%d)error,key(%#x:%#x)\n",
2849+
dsaf_dev->ae_dev.name, port_num,
2850+
mask_key.high.val, mask_key.low.val);
2851+
return;
2852+
}
28332853
dsaf_set_bit(tbl_tcam_mcast.tbl_mcast_port_msk[mskid / 32],
28342854
mskid % 32, 1);
2855+
28352856
memcpy(&temp_key, &mask_key, sizeof(mask_key));
28362857
hns_dsaf_tcam_mc_cfg_vague(dsaf_dev, entry_index, &tbl_tcam_data_mc,
28372858
(struct dsaf_tbl_tcam_data *)(&mask_key),

0 commit comments

Comments
 (0)