diff options
author | Shahed Shaikh <shahed.shaikh@qlogic.com> | 2014-04-14 10:02:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-14 13:43:52 -0400 |
commit | 7b546842b1e87f5b7929cf15e9cd1ac861b14de3 (patch) | |
tree | 59e9026ed03121e8ce8d225bb1d1a5a8803399c2 | |
parent | 4d52e1e8d1e198962dcbfabf9c06425c38eb23d0 (diff) |
qlcnic: Fix max ring count calculation
Do not read max rings count from qlcnic_get_nic_info(). Use driver defined
values for 82xx adapters. In case of 83xx adapters, use minimum of firmware
provided and driver defined values.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c index 3ca3118efb3a..ba20c721ee97 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | |||
@@ -2139,8 +2139,6 @@ static int qlcnic_83xx_get_nic_configuration(struct qlcnic_adapter *adapter) | |||
2139 | ahw->max_mac_filters = nic_info.max_mac_filters; | 2139 | ahw->max_mac_filters = nic_info.max_mac_filters; |
2140 | ahw->max_mtu = nic_info.max_mtu; | 2140 | ahw->max_mtu = nic_info.max_mtu; |
2141 | 2141 | ||
2142 | adapter->max_tx_rings = ahw->max_tx_ques; | ||
2143 | adapter->max_sds_rings = ahw->max_rx_ques; | ||
2144 | /* eSwitch capability indicates vNIC mode. | 2142 | /* eSwitch capability indicates vNIC mode. |
2145 | * vNIC and SRIOV are mutually exclusive operational modes. | 2143 | * vNIC and SRIOV are mutually exclusive operational modes. |
2146 | * If SR-IOV capability is detected, SR-IOV physical function | 2144 | * If SR-IOV capability is detected, SR-IOV physical function |
@@ -2161,6 +2159,7 @@ static int qlcnic_83xx_get_nic_configuration(struct qlcnic_adapter *adapter) | |||
2161 | int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) | 2159 | int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) |
2162 | { | 2160 | { |
2163 | struct qlcnic_hardware_context *ahw = adapter->ahw; | 2161 | struct qlcnic_hardware_context *ahw = adapter->ahw; |
2162 | u16 max_sds_rings, max_tx_rings; | ||
2164 | int ret; | 2163 | int ret; |
2165 | 2164 | ||
2166 | ret = qlcnic_83xx_get_nic_configuration(adapter); | 2165 | ret = qlcnic_83xx_get_nic_configuration(adapter); |
@@ -2173,18 +2172,21 @@ int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter) | |||
2173 | if (qlcnic_83xx_config_vnic_opmode(adapter)) | 2172 | if (qlcnic_83xx_config_vnic_opmode(adapter)) |
2174 | return -EIO; | 2173 | return -EIO; |
2175 | 2174 | ||
2176 | adapter->max_sds_rings = QLCNIC_MAX_VNIC_SDS_RINGS; | 2175 | max_sds_rings = QLCNIC_MAX_VNIC_SDS_RINGS; |
2177 | adapter->max_tx_rings = QLCNIC_MAX_VNIC_TX_RINGS; | 2176 | max_tx_rings = QLCNIC_MAX_VNIC_TX_RINGS; |
2178 | } else if (ret == QLC_83XX_DEFAULT_OPMODE) { | 2177 | } else if (ret == QLC_83XX_DEFAULT_OPMODE) { |
2179 | ahw->nic_mode = QLCNIC_DEFAULT_MODE; | 2178 | ahw->nic_mode = QLCNIC_DEFAULT_MODE; |
2180 | adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; | 2179 | adapter->nic_ops->init_driver = qlcnic_83xx_init_default_driver; |
2181 | ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; | 2180 | ahw->idc.state_entry = qlcnic_83xx_idc_ready_state_entry; |
2182 | adapter->max_sds_rings = QLCNIC_MAX_SDS_RINGS; | 2181 | max_sds_rings = QLCNIC_MAX_SDS_RINGS; |
2183 | adapter->max_tx_rings = QLCNIC_MAX_TX_RINGS; | 2182 | max_tx_rings = QLCNIC_MAX_TX_RINGS; |
2184 | } else { | 2183 | } else { |
2185 | return -EIO; | 2184 | return -EIO; |
2186 | } | 2185 | } |
2187 | 2186 | ||
2187 | adapter->max_sds_rings = min(ahw->max_rx_ques, max_sds_rings); | ||
2188 | adapter->max_tx_rings = min(ahw->max_tx_ques, max_tx_rings); | ||
2189 | |||
2188 | return 0; | 2190 | return 0; |
2189 | } | 2191 | } |
2190 | 2192 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c index 64dcbf33d8f0..a81ad5088b07 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | |||
@@ -883,8 +883,6 @@ int qlcnic_82xx_get_nic_info(struct qlcnic_adapter *adapter, | |||
883 | npar_info->max_rx_ques = le16_to_cpu(nic_info->max_rx_ques); | 883 | npar_info->max_rx_ques = le16_to_cpu(nic_info->max_rx_ques); |
884 | npar_info->capabilities = le32_to_cpu(nic_info->capabilities); | 884 | npar_info->capabilities = le32_to_cpu(nic_info->capabilities); |
885 | npar_info->max_mtu = le16_to_cpu(nic_info->max_mtu); | 885 | npar_info->max_mtu = le16_to_cpu(nic_info->max_mtu); |
886 | adapter->max_tx_rings = npar_info->max_tx_ques; | ||
887 | adapter->max_sds_rings = npar_info->max_rx_ques; | ||
888 | } | 886 | } |
889 | 887 | ||
890 | qlcnic_free_mbx_args(&cmd); | 888 | qlcnic_free_mbx_args(&cmd); |