diff options
-rw-r--r-- | drivers/net/netxen/netxen_nic.h | 19 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_ethtool.c | 21 | ||||
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 33 |
3 files changed, 41 insertions, 32 deletions
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 3a4cbd5dcbd9..e017827472ac 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -200,13 +200,20 @@ | |||
200 | #define RCV_RING_JUMBO 1 | 200 | #define RCV_RING_JUMBO 1 |
201 | #define RCV_RING_LRO 2 | 201 | #define RCV_RING_LRO 2 |
202 | 202 | ||
203 | #define MAX_CMD_DESCRIPTORS 4096 | 203 | #define MIN_CMD_DESCRIPTORS 64 |
204 | #define MAX_RCV_DESCRIPTORS 16384 | 204 | #define MIN_RCV_DESCRIPTORS 64 |
205 | #define MAX_CMD_DESCRIPTORS_HOST 1024 | 205 | #define MIN_JUMBO_DESCRIPTORS 32 |
206 | #define MAX_RCV_DESCRIPTORS_1G 2048 | 206 | |
207 | #define MAX_RCV_DESCRIPTORS_10G 4096 | 207 | #define MAX_CMD_DESCRIPTORS 1024 |
208 | #define MAX_JUMBO_RCV_DESCRIPTORS 1024 | 208 | #define MAX_RCV_DESCRIPTORS_1G 4096 |
209 | #define MAX_RCV_DESCRIPTORS_10G 8192 | ||
210 | #define MAX_JUMBO_RCV_DESCRIPTORS_1G 512 | ||
211 | #define MAX_JUMBO_RCV_DESCRIPTORS_10G 1024 | ||
209 | #define MAX_LRO_RCV_DESCRIPTORS 8 | 212 | #define MAX_LRO_RCV_DESCRIPTORS 8 |
213 | |||
214 | #define DEFAULT_RCV_DESCRIPTORS_1G 2048 | ||
215 | #define DEFAULT_RCV_DESCRIPTORS_10G 4096 | ||
216 | |||
210 | #define NETXEN_CTX_SIGNATURE 0xdee0 | 217 | #define NETXEN_CTX_SIGNATURE 0xdee0 |
211 | #define NETXEN_CTX_SIGNATURE_V2 0x0002dee0 | 218 | #define NETXEN_CTX_SIGNATURE_V2 0x0002dee0 |
212 | #define NETXEN_CTX_RESET 0xbad0 | 219 | #define NETXEN_CTX_RESET 0xbad0 |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index e16ea46c24b8..80d286db8eb4 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -494,20 +494,21 @@ netxen_nic_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) | |||
494 | { | 494 | { |
495 | struct netxen_adapter *adapter = netdev_priv(dev); | 495 | struct netxen_adapter *adapter = netdev_priv(dev); |
496 | 496 | ||
497 | ring->rx_pending = 0; | 497 | ring->rx_pending = adapter->num_rxd; |
498 | ring->rx_jumbo_pending = 0; | 498 | ring->rx_jumbo_pending = adapter->num_jumbo_rxd; |
499 | ring->rx_pending += adapter->recv_ctx. | 499 | ring->rx_jumbo_pending += adapter->num_lro_rxd; |
500 | rds_rings[RCV_RING_NORMAL].num_desc; | ||
501 | ring->rx_jumbo_pending += adapter->recv_ctx. | ||
502 | rds_rings[RCV_RING_JUMBO].num_desc; | ||
503 | ring->tx_pending = adapter->num_txd; | 500 | ring->tx_pending = adapter->num_txd; |
504 | 501 | ||
505 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) | 502 | if (adapter->ahw.port_type == NETXEN_NIC_GBE) { |
506 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G; | 503 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_1G; |
507 | else | 504 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_1G; |
505 | } else { | ||
508 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G; | 506 | ring->rx_max_pending = MAX_RCV_DESCRIPTORS_10G; |
509 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS_HOST; | 507 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS_10G; |
510 | ring->rx_jumbo_max_pending = MAX_JUMBO_RCV_DESCRIPTORS; | 508 | } |
509 | |||
510 | ring->tx_max_pending = MAX_CMD_DESCRIPTORS; | ||
511 | |||
511 | ring->rx_mini_max_pending = 0; | 512 | ring->rx_mini_max_pending = 0; |
512 | ring->rx_mini_pending = 0; | 513 | ring->rx_mini_pending = 0; |
513 | } | 514 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 381bd8f027c0..1aa850a0b895 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -283,12 +283,16 @@ nx_update_dma_mask(struct netxen_adapter *adapter) | |||
283 | return 0; | 283 | return 0; |
284 | } | 284 | } |
285 | 285 | ||
286 | static void netxen_check_options(struct netxen_adapter *adapter) | 286 | static void |
287 | netxen_check_options(struct netxen_adapter *adapter) | ||
287 | { | 288 | { |
288 | if (adapter->ahw.port_type == NETXEN_NIC_XGBE) | 289 | if (adapter->ahw.port_type == NETXEN_NIC_XGBE) { |
289 | adapter->num_rxd = MAX_RCV_DESCRIPTORS_10G; | 290 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_10G; |
290 | else if (adapter->ahw.port_type == NETXEN_NIC_GBE) | 291 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_10G; |
291 | adapter->num_rxd = MAX_RCV_DESCRIPTORS_1G; | 292 | } else if (adapter->ahw.port_type == NETXEN_NIC_GBE) { |
293 | adapter->num_rxd = DEFAULT_RCV_DESCRIPTORS_1G; | ||
294 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS_1G; | ||
295 | } | ||
292 | 296 | ||
293 | adapter->msix_supported = 0; | 297 | adapter->msix_supported = 0; |
294 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { | 298 | if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { |
@@ -306,11 +310,15 @@ static void netxen_check_options(struct netxen_adapter *adapter) | |||
306 | } | 310 | } |
307 | } | 311 | } |
308 | 312 | ||
309 | adapter->num_txd = MAX_CMD_DESCRIPTORS_HOST; | 313 | adapter->num_txd = MAX_CMD_DESCRIPTORS; |
310 | adapter->num_jumbo_rxd = MAX_JUMBO_RCV_DESCRIPTORS; | ||
311 | adapter->num_lro_rxd = MAX_LRO_RCV_DESCRIPTORS; | ||
312 | 314 | ||
313 | return; | 315 | if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) { |
316 | adapter->num_lro_rxd = MAX_LRO_RCV_DESCRIPTORS; | ||
317 | adapter->max_rds_rings = 3; | ||
318 | } else { | ||
319 | adapter->num_lro_rxd = 0; | ||
320 | adapter->max_rds_rings = 2; | ||
321 | } | ||
314 | } | 322 | } |
315 | 323 | ||
316 | static int | 324 | static int |
@@ -908,11 +916,6 @@ netxen_nic_attach(struct netxen_adapter *adapter) | |||
908 | return -EIO; | 916 | return -EIO; |
909 | } | 917 | } |
910 | 918 | ||
911 | if (adapter->fw_major < 4) | ||
912 | adapter->max_rds_rings = 3; | ||
913 | else | ||
914 | adapter->max_rds_rings = 2; | ||
915 | |||
916 | err = netxen_alloc_sw_resources(adapter); | 919 | err = netxen_alloc_sw_resources(adapter); |
917 | if (err) { | 920 | if (err) { |
918 | printk(KERN_ERR "%s: Error in setting sw resources\n", | 921 | printk(KERN_ERR "%s: Error in setting sw resources\n", |
@@ -1923,8 +1926,6 @@ static struct pci_driver netxen_driver = { | |||
1923 | #endif | 1926 | #endif |
1924 | }; | 1927 | }; |
1925 | 1928 | ||
1926 | /* Driver Registration on NetXen card */ | ||
1927 | |||
1928 | static int __init netxen_init_module(void) | 1929 | static int __init netxen_init_module(void) |
1929 | { | 1930 | { |
1930 | printk(KERN_INFO "%s\n", netxen_nic_driver_string); | 1931 | printk(KERN_INFO "%s\n", netxen_nic_driver_string); |