From 204f91dd3a716784960430840d07e554a5734cde Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Tue, 11 Nov 2014 00:10:44 +0000 Subject: - 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 --- sys/dev/netmap/netmap_pipe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/netmap') diff --git a/sys/dev/netmap/netmap_pipe.c b/sys/dev/netmap/netmap_pipe.c index bc998c04a17e..ab77f4b6dcde 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) -- cgit v1.3