summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluigi <luigi@FreeBSD.org>2014-06-06 14:57:16 +0000
committerluigi <luigi@FreeBSD.org>2014-06-06 14:57:16 +0000
commit36eb85a508e840cbe896fe0706202baa1952f314 (patch)
tree6f8ab76364f62505ec24ebe8e5f576db08485bf7
parent5e8a5eb68c5706d3c759a14e6f43bae0a90624cc (diff)
downloadFreeBSD-src-36eb85a508e840cbe896fe0706202baa1952f314.zip
FreeBSD-src-36eb85a508e840cbe896fe0706202baa1952f314.tar.gz
remove two debugging messages, align comments with the code
in our development trunk
-rw-r--r--sys/dev/netmap/netmap_generic.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c
index 7cb1b04..1cff019 100644
--- a/sys/dev/netmap/netmap_generic.c
+++ b/sys/dev/netmap/netmap_generic.c
@@ -81,18 +81,25 @@ __FBSDID("$FreeBSD$");
#include <dev/netmap/netmap_kern.h>
#include <dev/netmap/netmap_mem2.h>
-#define rtnl_lock() D("rtnl_lock called");
-#define rtnl_unlock() D("rtnl_unlock called");
+#define rtnl_lock() ND("rtnl_lock called");
+#define rtnl_unlock() ND("rtnl_unlock called");
#define MBUF_TXQ(m) ((m)->m_pkthdr.flowid)
#define MBUF_RXQ(m) ((m)->m_pkthdr.flowid)
#define smp_mb()
/*
- * mbuf wrappers
+ * FreeBSD mbuf allocator/deallocator in emulation mode:
+ *
+ * We allocate EXT_PACKET mbuf+clusters, but need to set M_NOFREE
+ * so that the destructor, if invoked, will not free the packet.
+ * In principle we should set the destructor only on demand,
+ * but since there might be a race we better do it on allocation.
+ * As a consequence, we also need to set the destructor or we
+ * would leak buffers.
*/
/*
- * we allocate an EXT_PACKET
+ * mbuf wrappers
*/
#define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE)
@@ -808,5 +815,5 @@ generic_netmap_attach(struct ifnet *ifp)
struct netmap_adapter *
netmap_getna(if_t ifp)
{
- return (NA((struct ifnet *)ifp));
+ return (NA((struct ifnet *)ifp));
}
OpenPOWER on IntegriCloud