* [PATCH net 1/1] qlge: Fix receive packets drop.
@ 2016-03-15 11:13 Manish Chopra
2016-03-18 23:22 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Manish Chopra @ 2016-03-15 11:13 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept-GELinuxNICDev, harish.patil
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>
---
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 9979764..b28e73e 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. */
--
2.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net 1/1] qlge: Fix receive packets drop.
2016-03-15 11:13 [PATCH net 1/1] qlge: Fix receive packets drop Manish Chopra
@ 2016-03-18 23:22 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-03-18 23:22 UTC (permalink / raw)
To: manish.chopra; +Cc: netdev, Dept-GELinuxNICDev, harish.patil
From: Manish Chopra <manish.chopra@qlogic.com>
Date: Tue, 15 Mar 2016 07:13:45 -0400
> 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>
Applied and queued up for -stable.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-18 23:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15 11:13 [PATCH net 1/1] qlge: Fix receive packets drop Manish Chopra
2016-03-18 23:22 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).