diff options
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_init.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_init.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c index 01ce74ee99f9..1b621ca13e25 100644 --- a/drivers/net/qlcnic/qlcnic_init.c +++ b/drivers/net/qlcnic/qlcnic_init.c | |||
@@ -1287,6 +1287,7 @@ qlcnic_alloc_rx_skb(struct qlcnic_adapter *adapter, | |||
1287 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); | 1287 | rds_ring->dma_size, PCI_DMA_FROMDEVICE); |
1288 | 1288 | ||
1289 | if (pci_dma_mapping_error(pdev, dma)) { | 1289 | if (pci_dma_mapping_error(pdev, dma)) { |
1290 | adapter->stats.rx_dma_map_error++; | ||
1290 | dev_kfree_skb_any(skb); | 1291 | dev_kfree_skb_any(skb); |
1291 | buffer->skb = NULL; | 1292 | buffer->skb = NULL; |
1292 | return -ENOMEM; | 1293 | return -ENOMEM; |
@@ -1311,8 +1312,10 @@ static struct sk_buff *qlcnic_process_rxbuf(struct qlcnic_adapter *adapter, | |||
1311 | PCI_DMA_FROMDEVICE); | 1312 | PCI_DMA_FROMDEVICE); |
1312 | 1313 | ||
1313 | skb = buffer->skb; | 1314 | skb = buffer->skb; |
1314 | if (!skb) | 1315 | if (!skb) { |
1316 | adapter->stats.null_skb++; | ||
1315 | goto no_skb; | 1317 | goto no_skb; |
1318 | } | ||
1316 | 1319 | ||
1317 | if (likely(adapter->rx_csum && cksum == STATUS_CKSUM_OK)) { | 1320 | if (likely(adapter->rx_csum && cksum == STATUS_CKSUM_OK)) { |
1318 | adapter->stats.csummed++; | 1321 | adapter->stats.csummed++; |
@@ -1502,6 +1505,8 @@ qlcnic_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring, int max) | |||
1502 | 1505 | ||
1503 | if (rxbuf) | 1506 | if (rxbuf) |
1504 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); | 1507 | list_add_tail(&rxbuf->list, &sds_ring->free_list[ring]); |
1508 | else | ||
1509 | adapter->stats.null_rxbuf++; | ||
1505 | 1510 | ||
1506 | skip: | 1511 | skip: |
1507 | for (; desc_cnt > 0; desc_cnt--) { | 1512 | for (; desc_cnt > 0; desc_cnt--) { |
@@ -1549,9 +1554,10 @@ qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, u32 ringid, | |||
1549 | int producer, count = 0; | 1554 | int producer, count = 0; |
1550 | struct list_head *head; | 1555 | struct list_head *head; |
1551 | 1556 | ||
1557 | spin_lock(&rds_ring->lock); | ||
1558 | |||
1552 | producer = rds_ring->producer; | 1559 | producer = rds_ring->producer; |
1553 | 1560 | ||
1554 | spin_lock(&rds_ring->lock); | ||
1555 | head = &rds_ring->free_list; | 1561 | head = &rds_ring->free_list; |
1556 | while (!list_empty(head)) { | 1562 | while (!list_empty(head)) { |
1557 | 1563 | ||
@@ -1573,13 +1579,13 @@ qlcnic_post_rx_buffers(struct qlcnic_adapter *adapter, u32 ringid, | |||
1573 | 1579 | ||
1574 | producer = get_next_index(producer, rds_ring->num_desc); | 1580 | producer = get_next_index(producer, rds_ring->num_desc); |
1575 | } | 1581 | } |
1576 | spin_unlock(&rds_ring->lock); | ||
1577 | 1582 | ||
1578 | if (count) { | 1583 | if (count) { |
1579 | rds_ring->producer = producer; | 1584 | rds_ring->producer = producer; |
1580 | writel((producer-1) & (rds_ring->num_desc-1), | 1585 | writel((producer-1) & (rds_ring->num_desc-1), |
1581 | rds_ring->crb_rcv_producer); | 1586 | rds_ring->crb_rcv_producer); |
1582 | } | 1587 | } |
1588 | spin_unlock(&rds_ring->lock); | ||
1583 | } | 1589 | } |
1584 | 1590 | ||
1585 | static void | 1591 | static void |
@@ -1591,10 +1597,11 @@ qlcnic_post_rx_buffers_nodb(struct qlcnic_adapter *adapter, | |||
1591 | int producer, count = 0; | 1597 | int producer, count = 0; |
1592 | struct list_head *head; | 1598 | struct list_head *head; |
1593 | 1599 | ||
1594 | producer = rds_ring->producer; | ||
1595 | if (!spin_trylock(&rds_ring->lock)) | 1600 | if (!spin_trylock(&rds_ring->lock)) |
1596 | return; | 1601 | return; |
1597 | 1602 | ||
1603 | producer = rds_ring->producer; | ||
1604 | |||
1598 | head = &rds_ring->free_list; | 1605 | head = &rds_ring->free_list; |
1599 | while (!list_empty(head)) { | 1606 | while (!list_empty(head)) { |
1600 | 1607 | ||