Skip to content

Commit 3487e98

Browse files
committed
Merge branch 'master' into gh
2 parents 6d6c59f + 706511d commit 3487e98

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

LINUX/veth_netmap.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ veth_netmap_reg(struct netmap_adapter *na, int onoff)
114114
/* Enable or disable flags and callbacks in na and ifp. */
115115
if (onoff) {
116116
for_rx_tx(t) {
117-
for (i = 0; i < nma_get_nrings(na, t) + 1; i++) {
117+
for (i = 0; i < nma_get_nrings(na, t); i++) {
118118
struct netmap_kring *kring = &NMR(na, t)[i];
119119

120120
if (nm_kring_pending_on(kring)) {
@@ -154,10 +154,15 @@ veth_netmap_reg(struct netmap_adapter *na, int onoff)
154154

155155
if (nm_kring_pending_off(kring)) {
156156
kring->nr_mode = NKR_NETMAP_OFF;
157-
/* mark the peer ring as no longer needed by us
158-
* (it may still be kept if sombody else is using it)
157+
/* If hw kring, mark the peer kring
158+
* as no longer needed by us (it may
159+
* still be kept if sombody else is
160+
* using it).
159161
*/
160-
kring->pipe->nr_kflags &= ~NKR_NEEDRING;
162+
if (kring->pipe) {
163+
kring->pipe->nr_kflags &=
164+
~NKR_NEEDRING;
165+
}
161166
}
162167
}
163168
}
@@ -212,7 +217,7 @@ veth_netmap_krings_create(struct netmap_adapter *na)
212217
if (error)
213218
goto del_krings1;
214219

215-
/* cross link the krings */
220+
/* cross link the krings (only the hw ones, not the host krings) */
216221
for_rx_tx(t) {
217222
enum txrx r = nm_txrx_swap(t); /* swap NR_TX <-> NR_RX */
218223
int i;

sys/dev/netmap/netmap.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,11 +1242,9 @@ netmap_txsync_to_host(struct netmap_kring *kring, int flags)
12421242
* They have been put in kring->rx_queue by netmap_transmit().
12431243
* We protect access to the kring using kring->rx_queue.lock
12441244
*
1245-
* This routine also does the selrecord if called from the poll handler
1246-
* (we know because sr != NULL).
1247-
*
1248-
* returns the number of packets delivered to tx queues in
1249-
* transparent mode, or a negative value if error
1245+
* also moves to the nic hw rings any packet the user has marked
1246+
* for transparent-mode forwarding, then sets the NR_FORWARD
1247+
* flag in the kring to let the caller push them out
12501248
*/
12511249
static int
12521250
netmap_rxsync_from_host(struct netmap_kring *kring, int flags)

sys/dev/netmap/netmap_pipe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ netmap_pipe_reg(struct netmap_adapter *na, int onoff)
390390
ND("%p: onoff %d", na, onoff);
391391
if (onoff) {
392392
for_rx_tx(t) {
393-
for (i = 0; i < nma_get_nrings(na, t) + 1; i++) {
393+
for (i = 0; i < nma_get_nrings(na, t); i++) {
394394
struct netmap_kring *kring = &NMR(na, t)[i];
395395

396396
if (nm_kring_pending_on(kring)) {
@@ -429,7 +429,9 @@ netmap_pipe_reg(struct netmap_adapter *na, int onoff)
429429
/* mark the peer ring as no longer needed by us
430430
* (it may still be kept if sombody else is using it)
431431
*/
432-
kring->pipe->nr_kflags &= ~NKR_NEEDRING;
432+
if (kring->pipe) {
433+
kring->pipe->nr_kflags &= ~NKR_NEEDRING;
434+
}
433435
}
434436
}
435437
}

utils/switch-modules/ovs-2.4.0/0001-datapath-netmap-VALE-support.patch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/INSTALL.NETMAP b/INSTALL.NETMAP
22
new file mode 100644
3-
index 000000000..f70466798
3+
index 000000000..664078ed3
44
--- /dev/null
55
+++ b/INSTALL.NETMAP
6-
@@ -0,0 +1,95 @@
6+
@@ -0,0 +1,99 @@
77
+ Using Open vSwitch with netmap (VALE)
88
+ ============================
99
+
@@ -38,6 +38,10 @@ index 000000000..f70466798
3838
+netmap kernel module (LINUX/Module.symvers).
3939
+
4040
+Before being able to build OVS, therefore, you need to build netmap.
41+
+When building netmap, run ./configure and make in the root directory of
42+
+the netmap repository; don't run those in the LINUX/ subdir or into
43+
+another build directory, otherwise the openvswitch module will not be
44+
+built with the correct dependencies in place.
4145
+
4246
+To quickly build and run, ovs-dev.py script can also be used:
4347
+

utils/switch-modules/ovs-2.6.1/0001-datapath-netmap-VALE-support.patch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/INSTALL.NETMAP b/INSTALL.NETMAP
22
new file mode 100644
3-
index 000000000..12ee16307
3+
index 000000000..7cf02e45e
44
--- /dev/null
55
+++ b/INSTALL.NETMAP
6-
@@ -0,0 +1,95 @@
6+
@@ -0,0 +1,99 @@
77
+ Using Open vSwitch with netmap (VALE)
88
+ ============================
99
+
@@ -38,6 +38,10 @@ index 000000000..12ee16307
3838
+netmap kernel module (LINUX/Module.symvers).
3939
+
4040
+Before being able to build OVS, therefore, you need to build netmap.
41+
+When building netmap, run ./configure and make in the root directory of
42+
+the netmap repository; don't run those in the LINUX/ subdir or into
43+
+another build directory, otherwise the openvswitch module will not be
44+
+built with the correct dependencies in place.
4145
+
4246
+To quickly build and run, ovs-dev.py script can also be used:
4347
+

0 commit comments

Comments
 (0)