Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 20:28:21 +0000 (UTC)
From:      Vincenzo Maffione <vmaffione@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r364731 - head/sys/dev/netmap
Message-ID:  <202008242028.07OKSLDL023679@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vmaffione
Date: Mon Aug 24 20:28:21 2020
New Revision: 364731
URL: https://svnweb.freebsd.org/changeset/base/364731

Log:
  netmap: use FreeBSD guards for epoch calls
  
  EPOCH calls are FreeBSD specific. Use guards to protect these, so
  that the code can compile under Linux.
  
  MFC after:	1 week

Modified:
  head/sys/dev/netmap/netmap.c

Modified: head/sys/dev/netmap/netmap.c
==============================================================================
--- head/sys/dev/netmap/netmap.c	Mon Aug 24 20:23:34 2020	(r364730)
+++ head/sys/dev/netmap/netmap.c	Mon Aug 24 20:28:21 2020	(r364731)
@@ -1149,11 +1149,13 @@ netmap_dtor(void *data)
 static void
 netmap_send_up(struct ifnet *dst, struct mbq *q)
 {
-	struct epoch_tracker et;
 	struct mbuf *m;
 	struct mbuf *head = NULL, *prev = NULL;
+#ifdef __FreeBSD__
+	struct epoch_tracker et;
 
 	NET_EPOCH_ENTER(et);
+#endif /* __FreeBSD__ */
 	/* Send packets up, outside the lock; head/prev machinery
 	 * is only useful for Windows. */
 	while ((m = mbq_dequeue(q)) != NULL) {
@@ -1165,7 +1167,9 @@ netmap_send_up(struct ifnet *dst, struct mbq *q)
 	}
 	if (head)
 		nm_os_send_up(dst, NULL, head);
+#ifdef __FreeBSD__
 	NET_EPOCH_EXIT(et);
+#endif /* __FreeBSD__ */
 	mbq_fini(q);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008242028.07OKSLDL023679>