summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2014-11-11 00:10:44 +0000
committerluigi <luigi@FreeBSD.org>2014-11-11 00:10:44 +0000
commit1db47d8b318d369b87c6132db0e3d38473d88f67 (patch)
tree547a3be35ca3532b405be6db0a9cf7cbd2a3c8cc
parentea5b796615ddbde24284c0c25900e8605469cf83 (diff)
downloadFreeBSD-src-1db47d8b318d369b87c6132db0e3d38473d88f67.zip
FreeBSD-src-1db47d8b318d369b87c6132db0e3d38473d88f67.tar.gz
- fix typo: use ring size from the rx ring, not the tx one (they should be
the same, but just in case); - reuse the previously computed len-1 value
-rw-r--r--sys/dev/netmap/netmap_pipe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/netmap/netmap_pipe.c b/sys/dev/netmap/netmap_pipe.c
index bc998c0..ab77f4b 100644
--- a/sys/dev/netmap/netmap_pipe.c
+++ b/sys/dev/netmap/netmap_pipe.c
@@ -197,10 +197,10 @@ netmap_pipe_txsync(struct netmap_kring *txkring, int flags)
if (m < 0)
m += txkring->nkr_num_slots;
limit = m;
- m = rxkring->nkr_num_slots - 1; /* max avail space on destination */
+ m = lim_rx; /* max avail space on destination */
busy = j - rxkring->nr_hwcur; /* busy slots */
if (busy < 0)
- busy += txkring->nkr_num_slots;
+ busy += rxkring->nkr_num_slots;
m -= busy; /* subtract busy slots */
ND(2, "m %d limit %d", m, limit);
if (m < limit)
OpenPOWER on IntegriCloud