diff options
author | luigi <luigi@FreeBSD.org> | 2015-02-14 19:41:26 +0000 |
---|---|---|
committer | luigi <luigi@FreeBSD.org> | 2015-02-14 19:41:26 +0000 |
commit | d6e510de0946d63a4f152a133e6d312d27102de8 (patch) | |
tree | e01a6f126d1bb3fec6e57115aa977b4c75cbfddd /sys/dev/netmap/netmap_freebsd.c | |
parent | c8630fd03efeecb182d2a5ca13d20bce4079da7e (diff) | |
download | FreeBSD-src-d6e510de0946d63a4f152a133e6d312d27102de8.zip FreeBSD-src-d6e510de0946d63a4f152a133e6d312d27102de8.tar.gz |
sync the code with the version in head. which the exception of
svn 275358 (M_FLOWID deprecation, only a couple of lines)
which cannot be merged.
if_lem_netmap.h, if_re_netmap.h:
- use the same (commented out) function to update the stat counters
as in HEAD. This is a no-op here
netmap.c
- merge 274459 (support for private knote lock)
and minor changes on nm_config and comments
netmap_freebsd.c
- merge 274459 (support for private knote lock)
- merge 274354 (initialize color if passed as argument)
netmap_generic.c
- fix a comment
netmap_kern.h
- revise the lock macros, using sx locks;
merge 274459 (private knote lock)
netmap_monitor.c
- use full memory barriers
netmap_pipe.c
- use full memory barriers, use length from the correct queue
(mostly cosmetic, since the queues typically have the same size)
Diffstat (limited to 'sys/dev/netmap/netmap_freebsd.c')
-rw-r--r-- | sys/dev/netmap/netmap_freebsd.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 160b7c0..3226708 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -466,6 +466,8 @@ netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, if (netmap_verbose) D("handle %p size %jd prot %d foff %jd", handle, (intmax_t)size, prot, (intmax_t)foff); + if (color) + *color = 0; dev_ref(vmh->dev); return 0; } @@ -654,25 +656,24 @@ netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) * and do not need the selrecord(). */ -void freebsd_selwakeup(struct selinfo *si, int pri); void -freebsd_selwakeup(struct selinfo *si, int pri) +freebsd_selwakeup(struct nm_selinfo *si, int pri) { if (netmap_verbose) - D("on knote %p", &si->si_note); - selwakeuppri(si, pri); + D("on knote %p", &si->si.si_note); + selwakeuppri(&si->si, pri); /* use a non-zero hint to tell the notification from the * call done in kqueue_scan() which uses 0 */ - KNOTE_UNLOCKED(&si->si_note, 0x100 /* notification */); + KNOTE_UNLOCKED(&si->si.si_note, 0x100 /* notification */); } static void netmap_knrdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = priv->np_rxsi; + struct selinfo *si = &priv->np_rxsi->si; D("remove selinfo %p", si); knlist_remove(&si->si_note, kn, 0); @@ -682,7 +683,7 @@ static void netmap_knwdetach(struct knote *kn) { struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; - struct selinfo *si = priv->np_txsi; + struct selinfo *si = &priv->np_txsi->si; D("remove selinfo %p", si); knlist_remove(&si->si_note, kn, 0); @@ -754,7 +755,7 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) struct netmap_priv_d *priv; int error; struct netmap_adapter *na; - struct selinfo *si; + struct nm_selinfo *si; int ev = kn->kn_filter; if (ev != EVFILT_READ && ev != EVFILT_WRITE) { @@ -777,7 +778,7 @@ netmap_kqfilter(struct cdev *dev, struct knote *kn) kn->kn_fop = (ev == EVFILT_WRITE) ? &netmap_wfiltops : &netmap_rfiltops; kn->kn_hook = priv; - knlist_add(&si->si_note, kn, 1); + knlist_add(&si->si.si_note, kn, 1); // XXX unlock(priv) ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", na, na->ifp->if_xname, curthread, priv, kn, |