diff options
| author | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2019-02-12 09:26:05 +0000 |
|---|---|---|
| committer | Vincenzo Maffione <vmaffione@FreeBSD.org> | 2019-02-12 09:26:05 +0000 |
| commit | adf75b88b6bf12a8e23193335dcffd9cab6125a1 (patch) | |
| tree | a4807b4ddd36f454dd23f2ad9e14003a7d70392f /sys/dev/netmap/netmap_vale.c | |
| parent | 90d92a8d81df815e49013871b71cf89ccb216235 (diff) | |
Notes
Diffstat (limited to 'sys/dev/netmap/netmap_vale.c')
| -rw-r--r-- | sys/dev/netmap/netmap_vale.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/sys/dev/netmap/netmap_vale.c b/sys/dev/netmap/netmap_vale.c index 7aa8447b1639..77340acaf079 100644 --- a/sys/dev/netmap/netmap_vale.c +++ b/sys/dev/netmap/netmap_vale.c @@ -443,7 +443,7 @@ netmap_vale_attach(struct nmreq_header *hdr, void *auth_token) error = na->nm_bdg_ctl(hdr, na); if (error) goto unref_exit; - ND("registered %s to netmap-mode", na->name); + nm_prdis("registered %s to netmap-mode", na->name); } vpna = (struct netmap_vp_adapter *)na; req->port_index = vpna->bdg_port; @@ -531,7 +531,7 @@ netmap_vale_vp_dtor(struct netmap_adapter *na) struct netmap_vp_adapter *vpna = (struct netmap_vp_adapter*)na; struct nm_bridge *b = vpna->na_bdg; - ND("%s has %d references", na->name, na->na_refcount); + nm_prdis("%s has %d references", na->name, na->na_refcount); if (b) { netmap_bdg_detach_common(b, vpna->bdg_port, -1); @@ -540,7 +540,7 @@ netmap_vale_vp_dtor(struct netmap_adapter *na) if (na->ifp != NULL && !nm_iszombie(na)) { NM_DETACH_NA(na->ifp); if (vpna->autodelete) { - ND("releasing %s", na->ifp->if_xname); + nm_prdis("releasing %s", na->ifp->if_xname); NMG_UNLOCK(); nm_os_vi_detach(na->ifp); NMG_LOCK(); @@ -626,12 +626,12 @@ nm_vale_preflush(struct netmap_kring *kring, u_int end) * shared lock, waiting if we can sleep (if the source port is * attached to a user process) or with a trylock otherwise (NICs). */ - ND("wait rlock for %d packets", ((j > end ? lim+1 : 0) + end) - j); + nm_prdis("wait rlock for %d packets", ((j > end ? lim+1 : 0) + end) - j); if (na->up.na_flags & NAF_BDG_MAYSLEEP) BDG_RLOCK(b); else if (!BDG_RTRYLOCK(b)) return j; - ND(5, "rlock acquired for %d packets", ((j > end ? lim+1 : 0) + end) - j); + nm_prdis(5, "rlock acquired for %d packets", ((j > end ? lim+1 : 0) + end) - j); ft = kring->nkr_ft; for (; likely(j != end); j = nm_next(j, lim)) { @@ -642,7 +642,7 @@ nm_vale_preflush(struct netmap_kring *kring, u_int end) ft[ft_i].ft_flags = slot->flags; ft[ft_i].ft_offset = 0; - ND("flags is 0x%x", slot->flags); + nm_prdis("flags is 0x%x", slot->flags); /* we do not use the buf changed flag, but we still need to reset it */ slot->flags &= ~NS_BUF_CHANGED; @@ -665,7 +665,7 @@ nm_vale_preflush(struct netmap_kring *kring, u_int end) continue; } if (unlikely(netmap_verbose && frags > 1)) - RD(5, "%d frags at %d", frags, ft_i - frags); + nm_prlim(5, "%d frags at %d", frags, ft_i - frags); ft[ft_i - frags].ft_frags = frags; frags = 1; if (unlikely((int)ft_i >= bridge_batch)) @@ -813,8 +813,9 @@ nm_kr_space(struct netmap_kring *k, int is_rx) k->nr_tail >= k->nkr_num_slots || busy < 0 || busy >= k->nkr_num_slots) { - D("invalid kring, cur %d tail %d lease %d lease_idx %d lim %d", k->nr_hwcur, k->nr_hwtail, k->nkr_hwlease, - k->nkr_lease_idx, k->nkr_num_slots); + nm_prerr("invalid kring, cur %d tail %d lease %d lease_idx %d lim %d", + k->nr_hwcur, k->nr_hwtail, k->nkr_hwlease, + k->nkr_lease_idx, k->nkr_num_slots); } #endif return space; @@ -891,7 +892,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, struct nm_vale_q *d; struct nm_bdg_fwd *start_ft = NULL; - ND("slot %d frags %d", i, ft[i].ft_frags); + nm_prdis("slot %d frags %d", i, ft[i].ft_frags); if (na->up.virt_hdr_len < ft[i].ft_len) { ft[i].ft_offset = na->up.virt_hdr_len; @@ -907,7 +908,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, } dst_port = b->bdg_ops.lookup(start_ft, &dst_ring, na, b->private_data); if (netmap_verbose > 255) - RD(5, "slot %d port %d -> %d", i, me, dst_port); + nm_prlim(5, "slot %d port %d -> %d", i, me, dst_port); if (dst_port >= NM_BDG_NOPORT) continue; /* this packet is identified to be dropped */ else if (dst_port == NM_BDG_BROADCAST) @@ -954,7 +955,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, } } - ND(5, "pass 1 done %d pkts %d dsts", n, num_dsts); + nm_prdis(5, "pass 1 done %d pkts %d dsts", n, num_dsts); /* second pass: scan destinations */ for (i = 0; i < num_dsts; i++) { struct netmap_vp_adapter *dst_na; @@ -969,7 +970,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, int virt_hdr_mismatch = 0; d_i = dsts[i]; - ND("second pass %d port %d", i, d_i); + nm_prdis("second pass %d port %d", i, d_i); d = dst_ents + d_i; // XXX fix the division dst_na = b->bdg_ports[d_i/NM_BDG_MAXRINGS]; @@ -986,7 +987,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, * - when na is being deactivated but is still attached. */ if (unlikely(!nm_netmap_on(&dst_na->up))) { - ND("not in netmap mode!"); + nm_prdis("not in netmap mode!"); goto cleanup; } @@ -1004,7 +1005,7 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, if (unlikely(dst_na->up.virt_hdr_len != na->up.virt_hdr_len)) { if (netmap_verbose) { - RD(3, "virt_hdr_mismatch, src %d dst %d", na->up.virt_hdr_len, + nm_prlim(3, "virt_hdr_mismatch, src %d dst %d", na->up.virt_hdr_len, dst_na->up.virt_hdr_len); } /* There is a virtio-net header/offloadings mismatch between @@ -1026,11 +1027,11 @@ nm_vale_flush(struct nm_bdg_fwd *ft, u_int n, struct netmap_vp_adapter *na, KASSERT(dst_na->mfs > 0, ("vpna->mfs is 0")); needed = (needed * na->mfs) / (dst_na->mfs - WORST_CASE_GSO_HEADER) + 1; - ND(3, "srcmtu=%u, dstmtu=%u, x=%u", na->mfs, dst_na->mfs, needed); + nm_prdis(3, "srcmtu=%u, dstmtu=%u, x=%u", na->mfs, dst_na->mfs, needed); } } - ND(5, "pass 2 dst %d is %x %s", + nm_prdis(5, "pass 2 dst %d is %x %s", i, d_i, is_vp ? "virtual" : "nic/host"); dst_nr = d_i & (NM_BDG_MAXRINGS-1); nrings = dst_na->up.num_rx_rings; @@ -1096,7 +1097,7 @@ retry: if (unlikely(cnt > howmany)) break; /* no more space */ if (netmap_verbose && cnt > 1) - RD(5, "rx %d frags to %d", cnt, j); + nm_prlim(5, "rx %d frags to %d", cnt, j); ft_end = ft_p + cnt; if (unlikely(virt_hdr_mismatch)) { bdg_mismatch_datapath(na, dst_na, ft_p, ring, &j, lim, &howmany); @@ -1109,7 +1110,7 @@ retry: slot = &ring->slot[j]; dst = NMB(&dst_na->up, slot); - ND("send [%d] %d(%d) bytes at %s:%d", + nm_prdis("send [%d] %d(%d) bytes at %s:%d", i, (int)copy_len, (int)dst_len, NM_IFPNAME(dst_ifp), j); /* round to a multiple of 64 */ @@ -1117,7 +1118,7 @@ retry: if (unlikely(copy_len > NETMAP_BUF_SIZE(&dst_na->up) || copy_len > NETMAP_BUF_SIZE(&na->up))) { - RD(5, "invalid len %d, down to 64", (int)copy_len); + nm_prlim(5, "invalid len %d, down to 64", (int)copy_len); copy_len = dst_len = 64; // XXX } if (ft_p->ft_flags & NS_INDIRECT) { @@ -1153,10 +1154,10 @@ retry: * i can recover the slots, otherwise must * fill them with 0 to mark empty packets. */ - ND("leftover %d bufs", howmany); + nm_prdis("leftover %d bufs", howmany); if (nm_next(lease_idx, lim) == kring->nkr_lease_idx) { /* yes i am the last one */ - ND("roll back nkr_hwlease to %d", j); + nm_prdis("roll back nkr_hwlease to %d", j); kring->nkr_hwlease = j; } else { while (howmany-- > 0) { @@ -1321,7 +1322,7 @@ netmap_vale_vp_create(struct nmreq_header *hdr, struct ifnet *ifp, na->nm_krings_create = netmap_vale_vp_krings_create; na->nm_krings_delete = netmap_vale_vp_krings_delete; na->nm_dtor = netmap_vale_vp_dtor; - ND("nr_mem_id %d", req->nr_mem_id); + nm_prdis("nr_mem_id %d", req->nr_mem_id); na->nm_mem = nmd ? netmap_mem_get(nmd): netmap_mem_private_new( @@ -1592,11 +1593,11 @@ netmap_vi_create(struct nmreq_header *hdr, int autodelete) if (error) { goto err_2; } - ND("returning nr_mem_id %d", req->nr_mem_id); + nm_prdis("returning nr_mem_id %d", req->nr_mem_id); if (nmd) netmap_mem_put(nmd); NMG_UNLOCK(); - ND("created %s", ifp->if_xname); + nm_prdis("created %s", ifp->if_xname); return 0; err_2: |
