]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
qede: Fix barrier usage after tx doorbell write.
authorManish Chopra <manish.chopra@cavium.com>
Tue, 27 Mar 2018 13:34:41 +0000 (06:34 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Mar 2018 17:11:46 +0000 (13:11 -0400)
Since commit c5ad119fb6c09b0297446be05bd66602fa564758
("net: sched: pfifo_fast use skb_array") driver is exposed
to an issue where it is hitting NULL skbs while handling TX
completions. Driver uses mmiowb() to flush the writes to the
doorbell bar which is a write-combined bar, however on x86
mmiowb() does not flush the write combined buffer.

This patch fixes this problem by replacing mmiowb() with wmb()
after the write combined doorbell write so that writes are
flushed and synchronized from more than one processor.

V1->V2:
-------
This patch was marked as "superseded" in patchwork.
(Not really sure for what reason).Resending it as v2.

Signed-off-by: Ariel Elior <ariel.elior@cavium.com>
Signed-off-by: Manish Chopra <manish.chopra@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_fp.c

index dafc079ab6b97b47665ec363ecd6b47065a1e41f..2e921cab17920cfeab69c7939e916205af5962d8 100644 (file)
@@ -320,13 +320,11 @@ static inline void qede_update_tx_producer(struct qede_tx_queue *txq)
        barrier();
        writel(txq->tx_db.raw, txq->doorbell_addr);
 
-       /* mmiowb is needed to synchronize doorbell writes from more than one
-        * processor. It guarantees that the write arrives to the device before
-        * the queue lock is released and another start_xmit is called (possibly
-        * on another CPU). Without this barrier, the next doorbell can bypass
-        * this doorbell. This is applicable to IA64/Altix systems.
+       /* Fence required to flush the write combined buffer, since another
+        * CPU may write to the same doorbell address and data may be lost
+        * due to relaxed order nature of write combined bar.
         */
-       mmiowb();
+       wmb();
 }
 
 static int qede_xdp_xmit(struct qede_dev *edev, struct qede_fastpath *fp,