]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
net: hns: fix bug of getting the wrong tcam data
authorDaode Huang <huangdaode@hisilicon.com>
Tue, 21 Jun 2016 03:56:32 +0000 (11:56 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jun 2016 08:51:55 +0000 (04:51 -0400)
The current driver stores the high bit value of tcam data register
to the tcam data low element, stores the low bit value of tcam data
register to tcam data high element, this patch fixes this bug.

Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c

index 0958ceb3df2c6f83bbab709b7f3cca981a78e357..7f5c24894a8cfef542570b40b3fb9a4945638969 100644 (file)
@@ -975,9 +975,9 @@ static void hns_dsaf_tcam_uc_get(
 
        /*read tcam data*/
        ptbl_tcam_data->tbl_tcam_data_high
-               = dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_LOW_0_REG);
-       ptbl_tcam_data->tbl_tcam_data_low
                = dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_HIGH_0_REG);
+       ptbl_tcam_data->tbl_tcam_data_low
+               = dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_LOW_0_REG);
 
        /*read tcam mcast*/
        tcam_read_data0 = dsaf_read_dev(dsaf_dev,
@@ -1027,9 +1027,9 @@ static void hns_dsaf_tcam_mc_get(
 
        /*read tcam data*/
        ptbl_tcam_data->tbl_tcam_data_high =
-               dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_LOW_0_REG);
-       ptbl_tcam_data->tbl_tcam_data_low =
                dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_HIGH_0_REG);
+       ptbl_tcam_data->tbl_tcam_data_low =
+               dsaf_read_dev(dsaf_dev, DSAF_TBL_TCAM_RDATA_LOW_0_REG);
 
        /*read tcam mcast*/
        ptbl_tcam_mcast->tbl_mcast_port_msk[0] =