diff options
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 4 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ethtool.c | 23 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 14 |
3 files changed, 21 insertions, 20 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index a60ff17eafd8..6400e6a6d7ea 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -146,11 +146,13 @@ | |||
146 | #define MAX_CMD_DESCRIPTORS 1024 | 146 | #define MAX_CMD_DESCRIPTORS 1024 |
147 | #define MAX_RCV_DESCRIPTORS_1G 4096 | 147 | #define MAX_RCV_DESCRIPTORS_1G 4096 |
148 | #define MAX_RCV_DESCRIPTORS_10G 8192 | 148 | #define MAX_RCV_DESCRIPTORS_10G 8192 |
149 | #define MAX_RCV_DESCRIPTORS_VF 2048 | ||
149 | #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 | 150 | #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 |
150 | #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 | 151 | #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 |
151 | 152 | ||
152 | #define DEFAULT_RCV_DESCRIPTORS_1G 2048 | 153 | #define DEFAULT_RCV_DESCRIPTORS_1G 2048 |
153 | #define DEFAULT_RCV_DESCRIPTORS_10G 4096 | 154 | #define DEFAULT_RCV_DESCRIPTORS_10G 4096 |
155 | #define DEFAULT_RCV_DESCRIPTORS_VF 1024 | ||
154 | #define MAX_RDS_RINGS 2 | 156 | #define MAX_RDS_RINGS 2 |
155 | 157 | ||
156 | #define get_next_index(index, length) \ | 158 | #define get_next_index(index, length) \ |
@@ -971,6 +973,8 @@ struct qlcnic_adapter { | |||
971 | u16 num_txd; | 973 | u16 num_txd; |
972 | u16 num_rxd; | 974 | u16 num_rxd; |
973 | u16 num_jumbo_rxd; | 975 | u16 num_jumbo_rxd; |
976 | u16 max_rxd; | ||
977 | u16 max_jumbo_rxd; | ||
974 | 978 | ||
975 | u8 max_rds_rings; | 979 | u8 max_rds_rings; |
976 | u8 max_sds_rings; | 980 | u8 max_sds_rings; |
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c index 25e93a53fca0..ec21d24015c4 100644 --- a/drivers/net/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/qlcnic/qlcnic_ethtool.c | |||
@@ -437,14 +437,8 @@ qlcnic_get_ringparam(struct net_device *dev, | |||
437 | ring->rx_jumbo_pending = adapter->num_jumbo_rxd; | 437 | ring->rx_jumbo_pending = adapter->num_jumbo_rxd; |
438 | ring->tx_pending = adapter->num_txd; | 438 | ring->tx_pending = adapter->num_txd; |
439 | 439 | ||
440 | if (adapter->ahw.port_type == QLCNIC_GBE) { | 440 | ring->rx_max_pending = adapter->max_rxd; |
441 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G; | 441 | ring->rx_jumbo_max_pending = adapter->max_jumbo_rxd; |
442 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_1G; | ||
443 | } else { | ||
444 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G; | ||
445 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_10G; | ||
446 | } | ||
447 | |||
448 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS; | 442 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS; |
449 | 443 | ||
450 | ring->rx_mini_max_pending = 0; | 444 | ring->rx_mini_max_pending = 0; |
@@ -472,24 +466,17 @@ qlcnic_set_ringparam(struct net_device *dev, | |||
472 | struct ethtool_ringparam *ring) | 466 | struct ethtool_ringparam *ring) |
473 | { | 467 | { |
474 | struct qlcnic_adapter *adapter = netdev_priv(dev); | 468 | struct qlcnic_adapter *adapter = netdev_priv(dev); |
475 | u16 max_rcv_desc = MAX_RCV_DESCRIPTORS_10G; | ||
476 | u16 max_jumbo_desc = MAX_JUMBO_RCV_DESCRIPTORS_10G; | ||
477 | u16 num_rxd, num_jumbo_rxd, num_txd; | 469 | u16 num_rxd, num_jumbo_rxd, num_txd; |
478 | 470 | ||
479 | |||
480 | if (ring->rx_mini_pending) | 471 | if (ring->rx_mini_pending) |
481 | return -EOPNOTSUPP; | 472 | return -EOPNOTSUPP; |
482 | 473 | ||
483 | if (adapter->ahw.port_type == QLCNIC_GBE) { | ||
484 | max_rcv_desc = MAX_RCV_DESCRIPTORS_1G; | ||
485 | max_jumbo_desc = MAX_JUMBO_RCV_DESCRIPTORS_10G; | ||
486 | } | ||
487 | |||
488 | num_rxd = qlcnic_validate_ringparam(ring->rx_pending, | 474 | num_rxd = qlcnic_validate_ringparam(ring->rx_pending, |
489 | MIN_RCV_DESCRIPTORS, max_rcv_desc, "rx"); | 475 | MIN_RCV_DESCRIPTORS, adapter->max_rxd, "rx"); |
490 | 476 | ||
491 | num_jumbo_rxd = qlcnic_validate_ringparam(ring->rx_jumbo_pending, | 477 | num_jumbo_rxd = qlcnic_validate_ringparam(ring->rx_jumbo_pending, |
492 | MIN_JUMBO_DESCRIPTORS, max_jumbo_desc, "rx jumbo"); | 478 | MIN_JUMBO_DESCRIPTORS, adapter->max_jumbo_rxd, |
479 | "rx jumbo"); | ||
493 | 480 | ||
494 | num_txd = qlcnic_validate_ringparam(ring->tx_pending, | 481 | num_txd = qlcnic_validate_ringparam(ring->tx_pending, |
495 | MIN_CMD_DESCRIPTORS, MAX_CMD_DESCRIPTORS, "tx"); | 482 | MIN_CMD_DESCRIPTORS, MAX_CMD_DESCRIPTORS, "tx"); |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 5a3ce084c391..7a298cdf9ab3 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -656,13 +656,23 @@ qlcnic_check_options(struct qlcnic_adapter *adapter) | |||
656 | 656 | ||
657 | dev_info(&pdev->dev, "firmware v%d.%d.%d\n", | 657 | dev_info(&pdev->dev, "firmware v%d.%d.%d\n", |
658 | fw_major, fw_minor, fw_build); | 658 | fw_major, fw_minor, fw_build); |
659 | |||
660 | if (adapter->ahw.port_type == QLCNIC_XGBE) { | 659 | if (adapter->ahw.port_type == QLCNIC_XGBE) { |
661 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_10G; | 660 | if (adapter->flags & QLCNIC_ESWITCH_ENABLED) { |
661 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_VF; | ||
662 | adapter->max_rxd = MAX_RCV_DESCRIPTORS_VF; | ||
663 | } else { | ||
664 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_10G; | ||
665 | adapter->max_rxd = MAX_RCV_DESCRIPTORS_10G; | ||
666 | } | ||
667 | |||
662 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G; | 668 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G; |
669 | adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G; | ||
670 | |||
663 | } else if (adapter->ahw.port_type == QLCNIC_GBE) { | 671 | } else if (adapter->ahw.port_type == QLCNIC_GBE) { |
664 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G; | 672 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G; |
665 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G; | 673 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G; |
674 | adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G; | ||
675 | adapter->max_rxd = MAX_RCV_DESCRIPTORS_1G; | ||
666 | } | 676 | } |
667 | 677 | ||
668 | adapter->msix_supported = !!use_msi_x; | 678 | adapter->msix_supported = !!use_msi_x; |