lfences

Link to this paste: http://bugs.dragonflybsd.org/pastes/378

Added by tuxillo almost 3 years ago.
Syntax: Plain Text

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/sys/dev/virtual/net/if_vke.c b/sys/dev/virtual/net/if_vke.c
index 8c1d23d..21f0844 100644
--- a/sys/dev/virtual/net/if_vke.c
+++ b/sys/dev/virtual/net/if_vke.c
@@ -158,7 +158,7 @@ vke_txfifo_done_enqueue(struct vke_softc *sc, struct mbuf *m)
        while (NETFIFOINDEX(fifo->windex + 1) == NETFIFOINDEX(fifo->rindex)) {
                usleep(20000);
        }
-
+       cpu_lfence();
        fifo->array[NETFIFOINDEX(fifo->windex)] = m;
        cpu_sfence();
        ++fifo->windex;
@@ -176,7 +176,7 @@ vke_txfifo_done_dequeue(struct vke_softc *sc, struct mbuf *nm)

        if (NETFIFOINDEX(fifo->rindex) == NETFIFOINDEX(fifo->windex))
                return (NULL);
-
+       cpu_lfence();
        m = fifo->array[NETFIFOINDEX(fifo->rindex)];
        fifo->array[NETFIFOINDEX(fifo->rindex)] = nm;
        cpu_lfence();
@@ -194,7 +194,7 @@ vke_txfifo_enqueue(struct vke_softc *sc, struct mbuf *m)

        if (NETFIFOINDEX(fifo->windex + 1) == NETFIFOINDEX(fifo->rindex))
                return (-1);
-
+       cpu_lfence();
        fifo->array[NETFIFOINDEX(fifo->windex)] = m;
        cpu_sfence();
        ++fifo->windex;
@@ -214,7 +214,7 @@ vke_txfifo_dequeue(struct vke_softc *sc)

        if (NETFIFOINDEX(fifo->rindex) == NETFIFOINDEX(fifo->windex))
                return (NULL);
-
+       cpu_lfence();
        m = fifo->array[NETFIFOINDEX(fifo->rindex)];
        fifo->array[NETFIFOINDEX(fifo->rindex)] = NULL;

@@ -587,7 +587,7 @@ vke_rx_thread(cothread_t cotd)
                        usleep(20000);
                        continue;
                }
-
+               cpu_lfence();
                /*
                 * Load data into the rx fifo
                 */

Download