diff options
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 30 |
2 files changed, 12 insertions, 19 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index 461596096383..88349b8fa39a 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -946,7 +946,6 @@ struct qlcnic_ipaddr { | |||
946 | #define QLCNIC_PCI_REG_MSIX_TBL 0x44 | 946 | #define QLCNIC_PCI_REG_MSIX_TBL 0x44 |
947 | #define QLCNIC_MSIX_TBL_PGSIZE 4096 | 947 | #define QLCNIC_MSIX_TBL_PGSIZE 4096 |
948 | 948 | ||
949 | #define QLCNIC_NETDEV_WEIGHT 128 | ||
950 | #define QLCNIC_ADAPTER_UP_MAGIC 777 | 949 | #define QLCNIC_ADAPTER_UP_MAGIC 777 |
951 | 950 | ||
952 | #define __QLCNIC_FW_ATTACHED 0 | 951 | #define __QLCNIC_FW_ATTACHED 0 |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 8d06f884818d..b7b245b43b87 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -1458,7 +1458,7 @@ void qlcnic_82xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring) | |||
1458 | int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter, | 1458 | int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter, |
1459 | struct net_device *netdev) | 1459 | struct net_device *netdev) |
1460 | { | 1460 | { |
1461 | int ring, max_sds_rings; | 1461 | int ring; |
1462 | struct qlcnic_host_sds_ring *sds_ring; | 1462 | struct qlcnic_host_sds_ring *sds_ring; |
1463 | struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; | 1463 | struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; |
1464 | struct qlcnic_host_tx_ring *tx_ring; | 1464 | struct qlcnic_host_tx_ring *tx_ring; |
@@ -1466,25 +1466,22 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter, | |||
1466 | if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings)) | 1466 | if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings)) |
1467 | return -ENOMEM; | 1467 | return -ENOMEM; |
1468 | 1468 | ||
1469 | max_sds_rings = adapter->max_sds_rings; | ||
1470 | |||
1471 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { | 1469 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { |
1472 | sds_ring = &recv_ctx->sds_rings[ring]; | 1470 | sds_ring = &recv_ctx->sds_rings[ring]; |
1473 | if (qlcnic_check_multi_tx(adapter) && | 1471 | if (qlcnic_check_multi_tx(adapter) && |
1474 | !adapter->ahw->diag_test && | 1472 | !adapter->ahw->diag_test && |
1475 | (adapter->max_drv_tx_rings > 1)) { | 1473 | (adapter->max_drv_tx_rings > 1)) { |
1476 | netif_napi_add(netdev, &sds_ring->napi, qlcnic_rx_poll, | 1474 | netif_napi_add(netdev, &sds_ring->napi, qlcnic_rx_poll, |
1477 | QLCNIC_NETDEV_WEIGHT * 2); | 1475 | NAPI_POLL_WEIGHT); |
1478 | } else { | 1476 | } else { |
1479 | if (ring == (adapter->max_sds_rings - 1)) | 1477 | if (ring == (adapter->max_sds_rings - 1)) |
1480 | netif_napi_add(netdev, &sds_ring->napi, | 1478 | netif_napi_add(netdev, &sds_ring->napi, |
1481 | qlcnic_poll, | 1479 | qlcnic_poll, |
1482 | QLCNIC_NETDEV_WEIGHT / | 1480 | NAPI_POLL_WEIGHT); |
1483 | max_sds_rings); | ||
1484 | else | 1481 | else |
1485 | netif_napi_add(netdev, &sds_ring->napi, | 1482 | netif_napi_add(netdev, &sds_ring->napi, |
1486 | qlcnic_rx_poll, | 1483 | qlcnic_rx_poll, |
1487 | QLCNIC_NETDEV_WEIGHT * 2); | 1484 | NAPI_POLL_WEIGHT); |
1488 | } | 1485 | } |
1489 | } | 1486 | } |
1490 | 1487 | ||
@@ -1497,7 +1494,7 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter, | |||
1497 | for (ring = 0; ring < adapter->max_drv_tx_rings; ring++) { | 1494 | for (ring = 0; ring < adapter->max_drv_tx_rings; ring++) { |
1498 | tx_ring = &adapter->tx_ring[ring]; | 1495 | tx_ring = &adapter->tx_ring[ring]; |
1499 | netif_napi_add(netdev, &tx_ring->napi, qlcnic_tx_poll, | 1496 | netif_napi_add(netdev, &tx_ring->napi, qlcnic_tx_poll, |
1500 | QLCNIC_NETDEV_WEIGHT); | 1497 | NAPI_POLL_WEIGHT); |
1501 | } | 1498 | } |
1502 | } | 1499 | } |
1503 | 1500 | ||
@@ -1963,7 +1960,7 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter) | |||
1963 | int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter, | 1960 | int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter, |
1964 | struct net_device *netdev) | 1961 | struct net_device *netdev) |
1965 | { | 1962 | { |
1966 | int ring, max_sds_rings, temp; | 1963 | int ring; |
1967 | struct qlcnic_host_sds_ring *sds_ring; | 1964 | struct qlcnic_host_sds_ring *sds_ring; |
1968 | struct qlcnic_host_tx_ring *tx_ring; | 1965 | struct qlcnic_host_tx_ring *tx_ring; |
1969 | struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; | 1966 | struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; |
@@ -1971,25 +1968,22 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter, | |||
1971 | if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings)) | 1968 | if (qlcnic_alloc_sds_rings(recv_ctx, adapter->max_sds_rings)) |
1972 | return -ENOMEM; | 1969 | return -ENOMEM; |
1973 | 1970 | ||
1974 | max_sds_rings = adapter->max_sds_rings; | ||
1975 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { | 1971 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { |
1976 | sds_ring = &recv_ctx->sds_rings[ring]; | 1972 | sds_ring = &recv_ctx->sds_rings[ring]; |
1977 | if (adapter->flags & QLCNIC_MSIX_ENABLED) { | 1973 | if (adapter->flags & QLCNIC_MSIX_ENABLED) { |
1978 | if (!(adapter->flags & QLCNIC_TX_INTR_SHARED)) { | 1974 | if (!(adapter->flags & QLCNIC_TX_INTR_SHARED)) |
1979 | netif_napi_add(netdev, &sds_ring->napi, | 1975 | netif_napi_add(netdev, &sds_ring->napi, |
1980 | qlcnic_83xx_rx_poll, | 1976 | qlcnic_83xx_rx_poll, |
1981 | QLCNIC_NETDEV_WEIGHT * 2); | 1977 | NAPI_POLL_WEIGHT); |
1982 | } else { | 1978 | else |
1983 | temp = QLCNIC_NETDEV_WEIGHT / max_sds_rings; | ||
1984 | netif_napi_add(netdev, &sds_ring->napi, | 1979 | netif_napi_add(netdev, &sds_ring->napi, |
1985 | qlcnic_83xx_msix_sriov_vf_poll, | 1980 | qlcnic_83xx_msix_sriov_vf_poll, |
1986 | temp); | 1981 | NAPI_POLL_WEIGHT); |
1987 | } | ||
1988 | 1982 | ||
1989 | } else { | 1983 | } else { |
1990 | netif_napi_add(netdev, &sds_ring->napi, | 1984 | netif_napi_add(netdev, &sds_ring->napi, |
1991 | qlcnic_83xx_poll, | 1985 | qlcnic_83xx_poll, |
1992 | QLCNIC_NETDEV_WEIGHT / max_sds_rings); | 1986 | NAPI_POLL_WEIGHT); |
1993 | } | 1987 | } |
1994 | } | 1988 | } |
1995 | 1989 | ||
@@ -2004,7 +1998,7 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter, | |||
2004 | tx_ring = &adapter->tx_ring[ring]; | 1998 | tx_ring = &adapter->tx_ring[ring]; |
2005 | netif_napi_add(netdev, &tx_ring->napi, | 1999 | netif_napi_add(netdev, &tx_ring->napi, |
2006 | qlcnic_83xx_msix_tx_poll, | 2000 | qlcnic_83xx_msix_tx_poll, |
2007 | QLCNIC_NETDEV_WEIGHT); | 2001 | NAPI_POLL_WEIGHT); |
2008 | } | 2002 | } |
2009 | } | 2003 | } |
2010 | 2004 | ||