summaryrefslogtreecommitdiff
path: root/sys/dev/netmap/netmap.c
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2015-07-19 18:07:25 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2015-07-19 18:07:25 +0000
commit847adfb7b309db039b91591e545ed5c3f28a3416 (patch)
tree53c257919e0af2de1b7a21f03661e4e25c7e744e /sys/dev/netmap/netmap.c
parent10b8ef3d6a7e3419068f1c39a24e389651f2321c (diff)
Notes
Diffstat (limited to 'sys/dev/netmap/netmap.c')
-rw-r--r--sys/dev/netmap/netmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index 60a31727860c..8094fe35256c 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -542,6 +542,7 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, generic_ringsize, CTLFLAG_RW, &netmap_generic_
SYSCTL_INT(_dev_netmap, OID_AUTO, generic_rings, CTLFLAG_RW, &netmap_generic_rings, 0 , "");
NMG_LOCK_T netmap_global_lock;
+int netmap_use_count = 0; /* number of active netmap instances */
/*
* mark the ring as stopped, and run through the locks
@@ -975,11 +976,11 @@ netmap_dtor_locked(struct netmap_priv_d *priv)
{
struct netmap_adapter *na = priv->np_na;
- /* number of active mmaps on this fd (FreeBSD only) */
+ /* number of active references to this fd */
if (--priv->np_refs > 0) {
return 0;
}
-
+ netmap_use_count--;
if (!na) {
return 1; //XXX is it correct?
}