diff options
author | Manish Chopra <manish.chopra@qlogic.com> | 2016-03-15 12:13:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-19 00:15:50 +0100 |
commit | 2c9a266afefe137bff06bbe0fc48b4d3b3cb348c (patch) | |
tree | 729bfe99edc02b184cf933b9e797202c9ef6ec18 /drivers/net/ethernet/qlogic/qlge | |
parent | net: stmmac: Don't search for phys if mdio node is defined. (diff) | |
download | linux-2c9a266afefe137bff06bbe0fc48b4d3b3cb348c.tar.xz linux-2c9a266afefe137bff06bbe0fc48b4d3b3cb348c.zip |
qlge: Fix receive packets drop.
When running small packets [length < 256 bytes] traffic, packets were
being dropped due to invalid data in those packets which were
delivered by the driver upto the stack. Using pci_dma_sync_single_for_cpu
ensures copying latest and updated data into skb from the receive buffer.
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlge')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlge/qlge_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 997976426799..b28e73ea2c25 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c @@ -1648,7 +1648,18 @@ static void ql_process_mac_rx_skb(struct ql_adapter *qdev, return; } skb_reserve(new_skb, NET_IP_ALIGN); + + pci_dma_sync_single_for_cpu(qdev->pdev, + dma_unmap_addr(sbq_desc, mapaddr), + dma_unmap_len(sbq_desc, maplen), + PCI_DMA_FROMDEVICE); + memcpy(skb_put(new_skb, length), skb->data, length); + + pci_dma_sync_single_for_device(qdev->pdev, + dma_unmap_addr(sbq_desc, mapaddr), + dma_unmap_len(sbq_desc, maplen), + PCI_DMA_FROMDEVICE); skb = new_skb; /* Frame error, so drop the packet. */ |