* [PATCH 0/1] qlcnic: add wmb() call in transmit data path.
@ 2016-06-29 21:51 Sony Chacko
2016-06-29 21:51 ` [PATCH 1/1] " Sony Chacko
0 siblings, 1 reply; 6+ messages in thread
From: Sony Chacko @ 2016-06-29 21:51 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
0001-qlcnic-add-wmb-call-in-transmit-data-path.patch
This patch adds a wmb() call in the Tx data path to ensure
writes are completed before hardware fetches updated Tx descriptors.
Please apply to net.
Thanks,
Sony
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
2016-06-29 21:51 [PATCH 0/1] qlcnic: add wmb() call in transmit data path Sony Chacko
@ 2016-06-29 21:51 ` Sony Chacko
2016-06-30 15:32 ` Lino Sanfilippo
2016-07-01 9:00 ` David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Sony Chacko @ 2016-06-29 21:51 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
Call wmb() to ensure writes are complete before
hardware fetches updated Tx descriptors.
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
index 607bb7d..87c642d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
@@ -772,6 +772,8 @@ netdev_tx_t qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tx_ring->tx_stats.tx_bytes += skb->len;
tx_ring->tx_stats.xmit_called++;
+ /* Ensure writes are complete before HW fetches Tx descriptors */
+ wmb();
qlcnic_update_cmd_producer(tx_ring);
return NETDEV_TX_OK;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
2016-06-29 21:51 ` [PATCH 1/1] " Sony Chacko
@ 2016-06-30 15:32 ` Lino Sanfilippo
2016-06-30 15:41 ` Lino Sanfilippo
2016-07-01 9:00 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Lino Sanfilippo @ 2016-06-30 15:32 UTC (permalink / raw)
To: Sony Chacko, davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
Hi,
On 29.06.2016 23:51, Sony Chacko wrote:
> + /* Ensure writes are complete before HW fetches Tx descriptors */
> + wmb();
> qlcnic_update_cmd_producer(tx_ring);
>
> return NETDEV_TX_OK;
>
Would not an mmiowb be more appropriate in this case?
Regards,
Lino
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
2016-06-30 15:32 ` Lino Sanfilippo
@ 2016-06-30 15:41 ` Lino Sanfilippo
2016-06-30 18:48 ` Sony Chacko
0 siblings, 1 reply; 6+ messages in thread
From: Lino Sanfilippo @ 2016-06-30 15:41 UTC (permalink / raw)
To: Sony Chacko, davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver
On 30.06.2016 17:32, Lino Sanfilippo wrote:
> Hi,
>
> On 29.06.2016 23:51, Sony Chacko wrote:
>
>> + /* Ensure writes are complete before HW fetches Tx descriptors */
>> + wmb();
>> qlcnic_update_cmd_producer(tx_ring);
>>
>> return NETDEV_TX_OK;
>>
>
> Would not an mmiowb be more appropriate in this case?
>
> Regards,
> Lino
Sorry, this was nonsense. This should be "dma_wmb" not "mmiowb".
Regards,
Lino
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
2016-06-30 15:41 ` Lino Sanfilippo
@ 2016-06-30 18:48 ` Sony Chacko
0 siblings, 0 replies; 6+ messages in thread
From: Sony Chacko @ 2016-06-30 18:48 UTC (permalink / raw)
To: Lino Sanfilippo, David Miller; +Cc: netdev, Dept-NX Linux NIC Driver
Subject: Re: [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
>
>> + /* Ensure writes are complete before HW fetches Tx descriptors */
>> + wmb();
>> qlcnic_update_cmd_producer(tx_ring);
>>
>> return NETDEV_TX_OK;
>>
>
> Would not an mmiowb be more appropriate in this case?
>
> Regards,
> Lino
Sorry, this was nonsense.This should be "dma_wmb" not "mmiowb".
Lino,
The patch is based on this kernel documentation.
https://www.kernel.org/doc/Documentation/memory-barriers.txt
/* force memory to sync before notifying device via MMIO */
wmb();
/* notify device of new descriptors */
writel(DESC_NOTIFY, doorbell);
}
The wmb() is needed to guarantee that the cache coherent memory writes have
completed before attempting a write to the cache incoherent MMIO region.
Thanks,
Sony
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] qlcnic: add wmb() call in transmit data path.
2016-06-29 21:51 ` [PATCH 1/1] " Sony Chacko
2016-06-30 15:32 ` Lino Sanfilippo
@ 2016-07-01 9:00 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2016-07-01 9:00 UTC (permalink / raw)
To: sony.chacko; +Cc: netdev, Dept_NX_Linux_NIC_Driver
From: Sony Chacko <sony.chacko@qlogic.com>
Date: Wed, 29 Jun 2016 17:51:34 -0400
> Call wmb() to ensure writes are complete before
> hardware fetches updated Tx descriptors.
>
> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-01 9:01 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-29 21:51 [PATCH 0/1] qlcnic: add wmb() call in transmit data path Sony Chacko
2016-06-29 21:51 ` [PATCH 1/1] " Sony Chacko
2016-06-30 15:32 ` Lino Sanfilippo
2016-06-30 15:41 ` Lino Sanfilippo
2016-06-30 18:48 ` Sony Chacko
2016-07-01 9:00 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.