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
This commit is contained in:
parent
592d300e34
commit
b7d6913862
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=364731
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user