mirror of https://gitee.com/openkylin/linux.git
qlcnic: reduce rx ring size
If eswitch is enabled, rcv ring size can be reduce, as physical port is partition-ed. Signed-off-by: Sony Chacko <sony.chacko@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e5edb7b19f
commit
90d1900555
|
@ -146,11 +146,13 @@
|
||||||
#define MAX_CMD_DESCRIPTORS 1024
|
#define MAX_CMD_DESCRIPTORS 1024
|
||||||
#define MAX_RCV_DESCRIPTORS_1G 4096
|
#define MAX_RCV_DESCRIPTORS_1G 4096
|
||||||
#define MAX_RCV_DESCRIPTORS_10G 8192
|
#define MAX_RCV_DESCRIPTORS_10G 8192
|
||||||
|
#define MAX_RCV_DESCRIPTORS_VF 2048
|
||||||
#define MAX_JUMBO_RCV_DESCRIPTORS_1G 512
|
#define MAX_JUMBO_RCV_DESCRIPTORS_1G 512
|
||||||
#define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024
|
#define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024
|
||||||
|
|
||||||
#define DEFAULT_RCV_DESCRIPTORS_1G 2048
|
#define DEFAULT_RCV_DESCRIPTORS_1G 2048
|
||||||
#define DEFAULT_RCV_DESCRIPTORS_10G 4096
|
#define DEFAULT_RCV_DESCRIPTORS_10G 4096
|
||||||
|
#define DEFAULT_RCV_DESCRIPTORS_VF 1024
|
||||||
#define MAX_RDS_RINGS 2
|
#define MAX_RDS_RINGS 2
|
||||||
|
|
||||||
#define get_next_index(index, length) \
|
#define get_next_index(index, length) \
|
||||||
|
@ -971,6 +973,8 @@ struct qlcnic_adapter {
|
||||||
u16 num_txd;
|
u16 num_txd;
|
||||||
u16 num_rxd;
|
u16 num_rxd;
|
||||||
u16 num_jumbo_rxd;
|
u16 num_jumbo_rxd;
|
||||||
|
u16 max_rxd;
|
||||||
|
u16 max_jumbo_rxd;
|
||||||
|
|
||||||
u8 max_rds_rings;
|
u8 max_rds_rings;
|
||||||
u8 max_sds_rings;
|
u8 max_sds_rings;
|
||||||
|
|
|
@ -437,14 +437,8 @@ qlcnic_get_ringparam(struct net_device *dev,
|
||||||
ring->rx_jumbo_pending = adapter->num_jumbo_rxd;
|
ring->rx_jumbo_pending = adapter->num_jumbo_rxd;
|
||||||
ring->tx_pending = adapter->num_txd;
|
ring->tx_pending = adapter->num_txd;
|
||||||
|
|
||||||
if (adapter->ahw.port_type == QLCNIC_GBE) {
|
ring->rx_max_pending = adapter->max_rxd;
|
||||||
ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G;
|
ring->rx_jumbo_max_pending = adapter->max_jumbo_rxd;
|
||||||
ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_1G;
|
|
||||||
} else {
|
|
||||||
ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G;
|
|
||||||
ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
|
||||||
}
|
|
||||||
|
|
||||||
ring->tx_max_pending = MAX_CMD_DESCRIPTORS;
|
ring->tx_max_pending = MAX_CMD_DESCRIPTORS;
|
||||||
|
|
||||||
ring->rx_mini_max_pending = 0;
|
ring->rx_mini_max_pending = 0;
|
||||||
|
@ -472,24 +466,17 @@ qlcnic_set_ringparam(struct net_device *dev,
|
||||||
struct ethtool_ringparam *ring)
|
struct ethtool_ringparam *ring)
|
||||||
{
|
{
|
||||||
struct qlcnic_adapter *adapter = netdev_priv(dev);
|
struct qlcnic_adapter *adapter = netdev_priv(dev);
|
||||||
u16 max_rcv_desc = MAX_RCV_DESCRIPTORS_10G;
|
|
||||||
u16 max_jumbo_desc = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
|
||||||
u16 num_rxd, num_jumbo_rxd, num_txd;
|
u16 num_rxd, num_jumbo_rxd, num_txd;
|
||||||
|
|
||||||
|
|
||||||
if (ring->rx_mini_pending)
|
if (ring->rx_mini_pending)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
if (adapter->ahw.port_type == QLCNIC_GBE) {
|
|
||||||
max_rcv_desc = MAX_RCV_DESCRIPTORS_1G;
|
|
||||||
max_jumbo_desc = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
|
||||||
}
|
|
||||||
|
|
||||||
num_rxd = qlcnic_validate_ringparam(ring->rx_pending,
|
num_rxd = qlcnic_validate_ringparam(ring->rx_pending,
|
||||||
MIN_RCV_DESCRIPTORS, max_rcv_desc, "rx");
|
MIN_RCV_DESCRIPTORS, adapter->max_rxd, "rx");
|
||||||
|
|
||||||
num_jumbo_rxd = qlcnic_validate_ringparam(ring->rx_jumbo_pending,
|
num_jumbo_rxd = qlcnic_validate_ringparam(ring->rx_jumbo_pending,
|
||||||
MIN_JUMBO_DESCRIPTORS, max_jumbo_desc, "rx jumbo");
|
MIN_JUMBO_DESCRIPTORS, adapter->max_jumbo_rxd,
|
||||||
|
"rx jumbo");
|
||||||
|
|
||||||
num_txd = qlcnic_validate_ringparam(ring->tx_pending,
|
num_txd = qlcnic_validate_ringparam(ring->tx_pending,
|
||||||
MIN_CMD_DESCRIPTORS, MAX_CMD_DESCRIPTORS, "tx");
|
MIN_CMD_DESCRIPTORS, MAX_CMD_DESCRIPTORS, "tx");
|
||||||
|
|
|
@ -656,13 +656,23 @@ qlcnic_check_options(struct qlcnic_adapter *adapter)
|
||||||
|
|
||||||
dev_info(&pdev->dev, "firmware v%d.%d.%d\n",
|
dev_info(&pdev->dev, "firmware v%d.%d.%d\n",
|
||||||
fw_major, fw_minor, fw_build);
|
fw_major, fw_minor, fw_build);
|
||||||
|
|
||||||
if (adapter->ahw.port_type == QLCNIC_XGBE) {
|
if (adapter->ahw.port_type == QLCNIC_XGBE) {
|
||||||
adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_10G;
|
if (adapter->flags & QLCNIC_ESWITCH_ENABLED) {
|
||||||
|
adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_VF;
|
||||||
|
adapter->max_rxd = MAX_RCV_DESCRIPTORS_VF;
|
||||||
|
} else {
|
||||||
|
adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_10G;
|
||||||
|
adapter->max_rxd = MAX_RCV_DESCRIPTORS_10G;
|
||||||
|
}
|
||||||
|
|
||||||
adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
||||||
|
adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G;
|
||||||
|
|
||||||
} else if (adapter->ahw.port_type == QLCNIC_GBE) {
|
} else if (adapter->ahw.port_type == QLCNIC_GBE) {
|
||||||
adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G;
|
adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G;
|
||||||
adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G;
|
adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G;
|
||||||
|
adapter->max_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G;
|
||||||
|
adapter->max_rxd = MAX_RCV_DESCRIPTORS_1G;
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter->msix_supported = !!use_msi_x;
|
adapter->msix_supported = !!use_msi_x;
|
||||||
|
|
Loading…
Reference in New Issue