diff options
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r-- | drivers/net/cnic.c | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index e5539f05cbfa..04e299f46455 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -3925,8 +3925,9 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev) | |||
3925 | HC_INDEX_DEF_C_ETH_ISCSI_CQ_CONS; | 3925 | HC_INDEX_DEF_C_ETH_ISCSI_CQ_CONS; |
3926 | context->cstorm_st_context.status_block_id = BNX2X_DEF_SB_ID; | 3926 | context->cstorm_st_context.status_block_id = BNX2X_DEF_SB_ID; |
3927 | 3927 | ||
3928 | context->xstorm_st_context.statistics_data = (cli | | 3928 | if (cli < MAX_X_STAT_COUNTER_ID) |
3929 | XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE); | 3929 | context->xstorm_st_context.statistics_data = cli | |
3930 | XSTORM_ETH_ST_CONTEXT_STATISTICS_ENABLE; | ||
3930 | 3931 | ||
3931 | context->xstorm_ag_context.cdu_reserved = | 3932 | context->xstorm_ag_context.cdu_reserved = |
3932 | CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(BNX2X_ISCSI_L2_CID, func), | 3933 | CDU_RSRVD_VALUE_TYPE_A(BNX2X_HW_CID(BNX2X_ISCSI_L2_CID, func), |
@@ -3934,10 +3935,12 @@ static void cnic_init_bnx2x_tx_ring(struct cnic_dev *dev) | |||
3934 | ETH_CONNECTION_TYPE); | 3935 | ETH_CONNECTION_TYPE); |
3935 | 3936 | ||
3936 | /* reset xstorm per client statistics */ | 3937 | /* reset xstorm per client statistics */ |
3937 | val = BAR_XSTRORM_INTMEM + | 3938 | if (cli < MAX_X_STAT_COUNTER_ID) { |
3938 | XSTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); | 3939 | val = BAR_XSTRORM_INTMEM + |
3939 | for (i = 0; i < sizeof(struct xstorm_per_client_stats) / 4; i++) | 3940 | XSTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); |
3940 | CNIC_WR(dev, val + i * 4, 0); | 3941 | for (i = 0; i < sizeof(struct xstorm_per_client_stats) / 4; i++) |
3942 | CNIC_WR(dev, val + i * 4, 0); | ||
3943 | } | ||
3941 | 3944 | ||
3942 | cp->tx_cons_ptr = | 3945 | cp->tx_cons_ptr = |
3943 | &cp->bnx2x_def_status_blk->c_def_status_block.index_values[ | 3946 | &cp->bnx2x_def_status_blk->c_def_status_block.index_values[ |
@@ -3984,9 +3987,11 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev) | |||
3984 | BNX2X_ISCSI_RX_SB_INDEX_NUM; | 3987 | BNX2X_ISCSI_RX_SB_INDEX_NUM; |
3985 | context->ustorm_st_context.common.clientId = cli; | 3988 | context->ustorm_st_context.common.clientId = cli; |
3986 | context->ustorm_st_context.common.status_block_id = BNX2X_DEF_SB_ID; | 3989 | context->ustorm_st_context.common.status_block_id = BNX2X_DEF_SB_ID; |
3987 | context->ustorm_st_context.common.flags = | 3990 | if (cli < MAX_U_STAT_COUNTER_ID) { |
3988 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS; | 3991 | context->ustorm_st_context.common.flags = |
3989 | context->ustorm_st_context.common.statistics_counter_id = cli; | 3992 | USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_STATISTICS; |
3993 | context->ustorm_st_context.common.statistics_counter_id = cli; | ||
3994 | } | ||
3990 | context->ustorm_st_context.common.mc_alignment_log_size = 0; | 3995 | context->ustorm_st_context.common.mc_alignment_log_size = 0; |
3991 | context->ustorm_st_context.common.bd_buff_size = | 3996 | context->ustorm_st_context.common.bd_buff_size = |
3992 | cp->l2_single_buf_size; | 3997 | cp->l2_single_buf_size; |
@@ -4017,10 +4022,13 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev) | |||
4017 | 4022 | ||
4018 | /* client tstorm info */ | 4023 | /* client tstorm info */ |
4019 | tstorm_client.mtu = cp->l2_single_buf_size - 14; | 4024 | tstorm_client.mtu = cp->l2_single_buf_size - 14; |
4020 | tstorm_client.config_flags = | 4025 | tstorm_client.config_flags = TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE; |
4021 | (TSTORM_ETH_CLIENT_CONFIG_E1HOV_REM_ENABLE | | 4026 | |
4022 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE); | 4027 | if (cli < MAX_T_STAT_COUNTER_ID) { |
4023 | tstorm_client.statistics_counter_id = cli; | 4028 | tstorm_client.config_flags |= |
4029 | TSTORM_ETH_CLIENT_CONFIG_STATSITICS_ENABLE; | ||
4030 | tstorm_client.statistics_counter_id = cli; | ||
4031 | } | ||
4024 | 4032 | ||
4025 | CNIC_WR(dev, BAR_TSTRORM_INTMEM + | 4033 | CNIC_WR(dev, BAR_TSTRORM_INTMEM + |
4026 | TSTORM_CLIENT_CONFIG_OFFSET(port, cli), | 4034 | TSTORM_CLIENT_CONFIG_OFFSET(port, cli), |
@@ -4030,16 +4038,21 @@ static void cnic_init_bnx2x_rx_ring(struct cnic_dev *dev) | |||
4030 | ((u32 *)&tstorm_client)[1]); | 4038 | ((u32 *)&tstorm_client)[1]); |
4031 | 4039 | ||
4032 | /* reset tstorm per client statistics */ | 4040 | /* reset tstorm per client statistics */ |
4033 | val = BAR_TSTRORM_INTMEM + | 4041 | if (cli < MAX_T_STAT_COUNTER_ID) { |
4034 | TSTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); | 4042 | |
4035 | for (i = 0; i < sizeof(struct tstorm_per_client_stats) / 4; i++) | 4043 | val = BAR_TSTRORM_INTMEM + |
4036 | CNIC_WR(dev, val + i * 4, 0); | 4044 | TSTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); |
4045 | for (i = 0; i < sizeof(struct tstorm_per_client_stats) / 4; i++) | ||
4046 | CNIC_WR(dev, val + i * 4, 0); | ||
4047 | } | ||
4037 | 4048 | ||
4038 | /* reset ustorm per client statistics */ | 4049 | /* reset ustorm per client statistics */ |
4039 | val = BAR_USTRORM_INTMEM + | 4050 | if (cli < MAX_U_STAT_COUNTER_ID) { |
4040 | USTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); | 4051 | val = BAR_USTRORM_INTMEM + |
4041 | for (i = 0; i < sizeof(struct ustorm_per_client_stats) / 4; i++) | 4052 | USTORM_PER_COUNTER_ID_STATS_OFFSET(port, cli); |
4042 | CNIC_WR(dev, val + i * 4, 0); | 4053 | for (i = 0; i < sizeof(struct ustorm_per_client_stats) / 4; i++) |
4054 | CNIC_WR(dev, val + i * 4, 0); | ||
4055 | } | ||
4043 | 4056 | ||
4044 | cp->rx_cons_ptr = | 4057 | cp->rx_cons_ptr = |
4045 | &cp->bnx2x_def_status_blk->u_def_status_block.index_values[ | 4058 | &cp->bnx2x_def_status_blk->u_def_status_block.index_values[ |