diff options
| author | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2021-09-26 13:52:16 +0000 |
|---|---|---|
| committer | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2021-09-26 13:52:16 +0000 |
| commit | 6127ce9d91c81e3025aeb1d832750d827e28314f (patch) | |
| tree | 82eba0a6c1a493b7081aa3f46422e38bb20f6c48 /sys/dev/netmap | |
| parent | f7cef43aa9a357582a703c75dafa4a44c1b2f28c (diff) | |
Diffstat (limited to 'sys/dev/netmap')
| -rw-r--r-- | sys/dev/netmap/netmap_monitor.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/netmap/netmap_monitor.c b/sys/dev/netmap/netmap_monitor.c index 4827c2a7585f..e05313c1f792 100644 --- a/sys/dev/netmap/netmap_monitor.c +++ b/sys/dev/netmap/netmap_monitor.c @@ -737,8 +737,7 @@ netmap_monitor_parent_sync(struct netmap_kring *kring, u_int first_new, int new_ int free_slots, busy, sent = 0, m; u_int lim = kring->nkr_num_slots - 1; struct netmap_ring *ring = kring->ring, *mring = mkring->ring; - u_int max_len = NETMAP_BUF_SIZE(mkring->na); - + u_int max_len; mlim = mkring->nkr_num_slots - 1; /* we need to lock the monitor receive ring, since it @@ -770,9 +769,10 @@ netmap_monitor_parent_sync(struct netmap_kring *kring, u_int first_new, int new_ struct netmap_slot *s = &ring->slot[beg]; struct netmap_slot *ms = &mring->slot[i]; u_int copy_len = s->len; - char *src = NMB(kring->na, s), - *dst = NMB(mkring->na, ms); + char *src = NMB_O(kring, s), + *dst = NMB_O(mkring, ms); + max_len = NETMAP_BUF_SIZE(mkring->na) - nm_get_offset(mkring, ms); if (unlikely(copy_len > max_len)) { nm_prlim(5, "%s->%s: truncating %d to %d", kring->name, mkring->name, copy_len, max_len); @@ -966,7 +966,9 @@ netmap_get_monitor_na(struct nmreq_header *hdr, struct netmap_adapter **na, pna->monitor_id++); /* the monitor supports the host rings iff the parent does */ - mna->up.na_flags |= (pna->na_flags & NAF_HOST_RINGS); + mna->up.na_flags |= (pna->na_flags & NAF_HOST_RINGS) & ~NAF_OFFSETS; + if (!zcopy) + mna->up.na_flags |= NAF_OFFSETS; /* a do-nothing txsync: monitors cannot be used to inject packets */ mna->up.nm_txsync = netmap_monitor_txsync; mna->up.nm_rxsync = netmap_monitor_rxsync; |
