aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorManish Chopra <manish.chopra@qlogic.com>2013-04-24 08:42:39 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-24 19:34:05 -0400
commit6389b76dfdb0549649d48fb50ca03242fb16a705 (patch)
tree6abf39ec4a7c472a4535242eb399e2ad892f9aca /drivers
parent01f27fc085574b301248d4da241e9d5ebd61e5c9 (diff)
qlcnic: Enhance channel configuration logs
o Add logs for various failure conditions during channel configuration. Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic.h2
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c2
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c32
3 files changed, 28 insertions, 8 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index 8d02dd75c9a2..f699ccee65dc 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -1474,7 +1474,7 @@ void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings);
1474int qlcnic_diag_alloc_res(struct net_device *netdev, int test); 1474int qlcnic_diag_alloc_res(struct net_device *netdev, int test);
1475netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev); 1475netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev);
1476int qlcnic_set_max_rss(struct qlcnic_adapter *, u8, size_t); 1476int qlcnic_set_max_rss(struct qlcnic_adapter *, u8, size_t);
1477int qlcnic_validate_max_rss(u8, u8); 1477int qlcnic_validate_max_rss(struct qlcnic_adapter *, __u32);
1478void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter); 1478void qlcnic_alloc_lb_filters_mem(struct qlcnic_adapter *adapter);
1479int qlcnic_enable_msix(struct qlcnic_adapter *, u32); 1479int qlcnic_enable_msix(struct qlcnic_adapter *, u32);
1480 1480
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 9f7aade4667c..59350c287f63 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -635,7 +635,7 @@ static int qlcnic_set_channels(struct net_device *dev,
635 channel->tx_count != channel->max_tx) 635 channel->tx_count != channel->max_tx)
636 return -EINVAL; 636 return -EINVAL;
637 637
638 err = qlcnic_validate_max_rss(channel->max_rx, channel->rx_count); 638 err = qlcnic_validate_max_rss(adapter, channel->rx_count);
639 if (err) 639 if (err)
640 return err; 640 return err;
641 641
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 247a9f9b7bdc..0052953a255d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -3273,20 +3273,40 @@ qlcnicvf_start_firmware(struct qlcnic_adapter *adapter)
3273 return err; 3273 return err;
3274} 3274}
3275 3275
3276int qlcnic_validate_max_rss(u8 max_hw, u8 val) 3276int qlcnic_validate_max_rss(struct qlcnic_adapter *adapter,
3277 __u32 val)
3277{ 3278{
3279 struct net_device *netdev = adapter->netdev;
3280 u8 max_hw = adapter->ahw->max_rx_ques;
3278 u32 max_allowed; 3281 u32 max_allowed;
3279 3282
3280 if (max_hw > QLC_MAX_SDS_RINGS) { 3283 if (val > QLC_MAX_SDS_RINGS) {
3281 max_hw = QLC_MAX_SDS_RINGS; 3284 netdev_err(netdev, "RSS value should not be higher than %u\n",
3282 pr_info("max rss reset to %d\n", QLC_MAX_SDS_RINGS); 3285 QLC_MAX_SDS_RINGS);
3286 return -EINVAL;
3283 } 3287 }
3284 3288
3285 max_allowed = rounddown_pow_of_two(min_t(int, max_hw, 3289 max_allowed = rounddown_pow_of_two(min_t(int, max_hw,
3286 num_online_cpus())); 3290 num_online_cpus()));
3287 if ((val > max_allowed) || (val < 2) || !is_power_of_2(val)) { 3291 if ((val > max_allowed) || (val < 2) || !is_power_of_2(val)) {
3288 pr_info("rss_ring valid range [2 - %x] in powers of 2\n", 3292 if (!is_power_of_2(val))
3289 max_allowed); 3293 netdev_err(netdev, "RSS value should be a power of 2\n");
3294
3295 if (val < 2)
3296 netdev_err(netdev, "RSS value should not be lower than 2\n");
3297
3298 if (val > max_hw)
3299 netdev_err(netdev,
3300 "RSS value should not be higher than[%u], the max RSS rings supported by the adapter\n",
3301 max_hw);
3302
3303 if (val > num_online_cpus())
3304 netdev_err(netdev,
3305 "RSS value should not be higher than[%u], number of online CPUs in the system\n",
3306 num_online_cpus());
3307
3308 netdev_err(netdev, "Unable to configure %u RSS rings\n", val);
3309
3290 return -EINVAL; 3310 return -EINVAL;
3291 } 3311 }
3292 return 0; 3312 return 0;