aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorShahed Shaikh <shahed.shaikh@qlogic.com>2014-06-11 14:09:12 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-11 18:44:29 -0400
commit18e0d625336a7690dcb358e2f4157becfa65183b (patch)
tree7d8eca8c18346706dbe7217b68dc9a3dd1afe17e /drivers/net
parent4da005cf1e30897520106114a8ce11a5aa558497 (diff)
qlcnic: Optimize ring count validations
- Check interrupt mode at the start of qlcnic_set_channels(). - Do not validate ring count if they are not going to change. Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c9
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c10
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 5bacf5210aed..1b7f3dbae289 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -726,6 +726,11 @@ static int qlcnic_set_channels(struct net_device *dev,
726 struct qlcnic_adapter *adapter = netdev_priv(dev); 726 struct qlcnic_adapter *adapter = netdev_priv(dev);
727 int err; 727 int err;
728 728
729 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
730 netdev_err(dev, "No RSS/TSS support in non MSI-X mode\n");
731 return -EINVAL;
732 }
733
729 if (channel->other_count || channel->combined_count) 734 if (channel->other_count || channel->combined_count)
730 return -EINVAL; 735 return -EINVAL;
731 736
@@ -734,7 +739,7 @@ static int qlcnic_set_channels(struct net_device *dev,
734 if (err) 739 if (err)
735 return err; 740 return err;
736 741
737 if (channel->rx_count) { 742 if (adapter->drv_sds_rings != channel->rx_count) {
738 err = qlcnic_validate_rings(adapter, channel->rx_count, 743 err = qlcnic_validate_rings(adapter, channel->rx_count,
739 QLCNIC_RX_QUEUE); 744 QLCNIC_RX_QUEUE);
740 if (err) { 745 if (err) {
@@ -745,7 +750,7 @@ static int qlcnic_set_channels(struct net_device *dev,
745 adapter->drv_rss_rings = channel->rx_count; 750 adapter->drv_rss_rings = channel->rx_count;
746 } 751 }
747 752
748 if (channel->tx_count) { 753 if (adapter->drv_tx_rings != channel->tx_count) {
749 err = qlcnic_validate_rings(adapter, channel->tx_count, 754 err = qlcnic_validate_rings(adapter, channel->tx_count,
750 QLCNIC_TX_QUEUE); 755 QLCNIC_TX_QUEUE);
751 if (err) { 756 if (err) {
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 1c188919cdda..4fc186713b66 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -4003,16 +4003,6 @@ int qlcnic_validate_rings(struct qlcnic_adapter *adapter, __u32 ring_cnt,
4003 strcpy(buf, "Tx"); 4003 strcpy(buf, "Tx");
4004 } 4004 }
4005 4005
4006 if (!QLCNIC_IS_MSI_FAMILY(adapter)) {
4007 netdev_err(netdev, "No RSS/TSS support in INT-x mode\n");
4008 return -EINVAL;
4009 }
4010
4011 if (adapter->flags & QLCNIC_MSI_ENABLED) {
4012 netdev_err(netdev, "No RSS/TSS support in MSI mode\n");
4013 return -EINVAL;
4014 }
4015
4016 if (!is_power_of_2(ring_cnt)) { 4006 if (!is_power_of_2(ring_cnt)) {
4017 netdev_err(netdev, "%s rings value should be a power of 2\n", 4007 netdev_err(netdev, "%s rings value should be a power of 2\n",
4018 buf); 4008 buf);