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);
 }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to