diff options
author | huangdaode <huangdaode@hisilicon.com> | 2016-01-18 04:24:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-18 11:52:37 -0500 |
commit | 918f618f564e208dd181d8ac7525694ccf4bc097 (patch) | |
tree | f3855c3a99c0183d68f0e844c9b8b3cdd0b855c8 | |
parent | 23195ec00503c6c29daea5b6c780787c0b5f1bf3 (diff) |
net: hns: bug fix about hisilicon TSO BD mode
The current upstreaming code fails to set the tso_mode register
when initilizes, when processes large size packets, the default 4 bd is
not enough, so this patch initilizes it and set the default value to 8 bds
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | 5 |
3 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c index d2263c72bd8a..12188807468c 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | |||
@@ -369,8 +369,17 @@ int hns_rcb_common_init_hw(struct rcb_common_cb *rcb_common) | |||
369 | dsaf_write_dev(rcb_common, RCB_COM_CFG_ENDIAN_REG, | 369 | dsaf_write_dev(rcb_common, RCB_COM_CFG_ENDIAN_REG, |
370 | HNS_RCB_COMMON_ENDIAN); | 370 | HNS_RCB_COMMON_ENDIAN); |
371 | 371 | ||
372 | dsaf_write_dev(rcb_common, RCB_COM_CFG_FNA_REG, 0x0); | 372 | if (AE_IS_VER1(rcb_common->dsaf_dev->dsaf_ver)) { |
373 | dsaf_write_dev(rcb_common, RCB_COM_CFG_FA_REG, 0x1); | 373 | dsaf_write_dev(rcb_common, RCB_COM_CFG_FNA_REG, 0x0); |
374 | dsaf_write_dev(rcb_common, RCB_COM_CFG_FA_REG, 0x1); | ||
375 | } else { | ||
376 | dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_USER_REG, | ||
377 | RCB_COM_CFG_FNA_B, false); | ||
378 | dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_USER_REG, | ||
379 | RCB_COM_CFG_FA_B, true); | ||
380 | dsaf_set_dev_bit(rcb_common, RCBV2_COM_CFG_TSO_MODE_REG, | ||
381 | RCB_COM_TSO_MODE_B, HNS_TSO_MODE_8BD_32K); | ||
382 | } | ||
374 | 383 | ||
375 | return 0; | 384 | return 0; |
376 | } | 385 | } |
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h index 29041b18741a..81fe9f849973 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.h | |||
@@ -54,6 +54,9 @@ struct rcb_common_cb; | |||
54 | #define HNS_DUMP_REG_NUM 500 | 54 | #define HNS_DUMP_REG_NUM 500 |
55 | #define HNS_STATIC_REG_NUM 12 | 55 | #define HNS_STATIC_REG_NUM 12 |
56 | 56 | ||
57 | #define HNS_TSO_MODE_8BD_32K 1 | ||
58 | #define HNS_TSO_MDOE_4BD_16K 0 | ||
59 | |||
57 | enum rcb_int_flag { | 60 | enum rcb_int_flag { |
58 | RCB_INT_FLAG_TX = 0x1, | 61 | RCB_INT_FLAG_TX = 0x1, |
59 | RCB_INT_FLAG_RX = (0x1 << 1), | 62 | RCB_INT_FLAG_RX = (0x1 << 1), |
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h index 5d1b746e141d..f0c4f9b09d5b 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h +++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_reg.h | |||
@@ -363,6 +363,8 @@ | |||
363 | #define RCB_COM_CFG_FA_REG 0x3C | 363 | #define RCB_COM_CFG_FA_REG 0x3C |
364 | #define RCB_COM_CFG_PKT_TC_BP_REG 0x40 | 364 | #define RCB_COM_CFG_PKT_TC_BP_REG 0x40 |
365 | #define RCB_COM_CFG_PPE_TNL_CLKEN_REG 0x44 | 365 | #define RCB_COM_CFG_PPE_TNL_CLKEN_REG 0x44 |
366 | #define RCBV2_COM_CFG_USER_REG 0x30 | ||
367 | #define RCBV2_COM_CFG_TSO_MODE_REG 0x50 | ||
366 | 368 | ||
367 | #define RCB_COM_INTMSK_TX_PKT_REG 0x3A0 | 369 | #define RCB_COM_INTMSK_TX_PKT_REG 0x3A0 |
368 | #define RCB_COM_RINT_TX_PKT_REG 0x3A8 | 370 | #define RCB_COM_RINT_TX_PKT_REG 0x3A8 |
@@ -860,6 +862,9 @@ | |||
860 | 862 | ||
861 | #define PPE_COMMON_CNT_CLR_CE_B 0 | 863 | #define PPE_COMMON_CNT_CLR_CE_B 0 |
862 | #define PPE_COMMON_CNT_CLR_SNAP_EN_B 1 | 864 | #define PPE_COMMON_CNT_CLR_SNAP_EN_B 1 |
865 | #define RCB_COM_TSO_MODE_B 0 | ||
866 | #define RCB_COM_CFG_FNA_B 1 | ||
867 | #define RCB_COM_CFG_FA_B 0 | ||
863 | 868 | ||
864 | #define GMAC_DUPLEX_TYPE_B 0 | 869 | #define GMAC_DUPLEX_TYPE_B 0 |
865 | 870 | ||