net: hns: Incorrect offset address used for some registers.
authorYonglong Liu <liuyonglong@huawei.com>
Sat, 15 Dec 2018 03:53:20 +0000 (11:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:00:59 +0000 (10:00 +0100)
[ Upstream commit 4e1d4be681b2c26fd874adbf584bf034573ac45d ]

According to the hip06 Datasheet:
1. The offset of INGRESS_SW_VLAN_TAG_DISC should be 0x1A00+4*all_chn_num
2. The offset of INGRESS_IN_DATA_STP_DISC should be 0x1A50+4*all_chn_num

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c

index 1f056a6b167e7a1c7a19e5c94079131567bb7302..bc020dddd253111168bb8cd0fd731d1a5dd9ac87 100644 (file)
@@ -2159,9 +2159,9 @@ void hns_dsaf_update_stats(struct dsaf_device *dsaf_dev, u32 node_num)
                DSAF_INODE_LOCAL_ADDR_FALSE_NUM_0_REG + 0x80 * (u64)node_num);
 
        hw_stats->vlan_drop += dsaf_read_dev(dsaf_dev,
-               DSAF_INODE_SW_VLAN_TAG_DISC_0_REG + 0x80 * (u64)node_num);
+               DSAF_INODE_SW_VLAN_TAG_DISC_0_REG + 4 * (u64)node_num);
        hw_stats->stp_drop += dsaf_read_dev(dsaf_dev,
-               DSAF_INODE_IN_DATA_STP_DISC_0_REG + 0x80 * (u64)node_num);
+               DSAF_INODE_IN_DATA_STP_DISC_0_REG + 4 * (u64)node_num);
 
        /* pfc pause frame statistics stored in dsaf inode*/
        if ((node_num < DSAF_SERVICE_NW_NUM) && !is_ver1) {