git: 3f2b9607756d - main - vtnet: set VNET context in RX handler

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Thu, 28 Mar 2024 21:13:59 UTC
The branch main has been updated by glebius:

URL: https://cgit.FreeBSD.org/src/commit/?id=3f2b9607756d0f92ca29c844db0718b313a06634

commit 3f2b9607756d0f92ca29c844db0718b313a06634
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2024-03-28 21:12:39 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2024-03-28 21:12:39 +0000

    vtnet: set VNET context in RX handler
    
    The context is required for NIC-level pfil(9) filtering.
---
 sys/dev/virtio/network/if_vtnet.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
index 1c731b496f12..5b854ad6cbb7 100644
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -2086,6 +2086,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq)
 
 	VTNET_RXQ_LOCK_ASSERT(rxq);
 
+	CURVNET_SET_QUIET(if_getvnet(ifp));
 	while (count-- > 0) {
 		struct mbuf *m;
 		uint32_t len, nbufs, adjsz;
@@ -2179,6 +2180,7 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq)
 #endif
 		virtqueue_notify(vq);
 	}
+	CURVNET_RESTORE();
 
 	return (count > 0 ? 0 : EAGAIN);
 }