Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 2021 17:32:21 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 26d79d40a74f - main - Hyper-V: hn: Enter network epoch when required
Message-ID:  <202108261732.17QHWLXT023797@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=26d79d40a74fc804c76acd88a1f8f10f9827a2b3

commit 26d79d40a74fc804c76acd88a1f8f10f9827a2b3
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-08-26 17:27:04 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2021-08-26 17:32:00 +0000

    Hyper-V: hn: Enter network epoch when required
    
    PR:                             254695
---
 sys/dev/hyperv/netvsc/if_hn.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c
index cd0b5a5fa8b9..0ec398bed670 100644
--- a/sys/dev/hyperv/netvsc/if_hn.c
+++ b/sys/dev/hyperv/netvsc/if_hn.c
@@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/taskqueue.h>
 #include <sys/buf_ring.h>
 #include <sys/eventhandler.h>
+#include <sys/epoch.h>
 
 #include <machine/atomic.h>
 #include <machine/in_cksum.h>
@@ -2883,7 +2884,11 @@ static void
 hn_chan_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr)
 {
 #if defined(INET) || defined(INET6)
+	struct epoch_tracker et;
+
+	NET_EPOCH_ENTER(et);
 	tcp_lro_flush_all(&rxr->hn_lro);
+	NET_EPOCH_EXIT(et);
 #endif
 
 	/*
@@ -7459,6 +7464,7 @@ static void
 hn_nvs_handle_rxbuf(struct hn_rx_ring *rxr, struct vmbus_channel *chan,
     const struct vmbus_chanpkt_hdr *pkthdr)
 {
+	struct epoch_tracker et;
 	const struct vmbus_chanpkt_rxbuf *pkt;
 	const struct hn_nvs_hdr *nvs_hdr;
 	int count, i, hlen;
@@ -7496,6 +7502,7 @@ hn_nvs_handle_rxbuf(struct hn_rx_ring *rxr, struct vmbus_channel *chan,
 		return;
 	}
 
+	NET_EPOCH_ENTER(et);
 	/* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */
 	for (i = 0; i < count; ++i) {
 		int ofs, len;
@@ -7511,6 +7518,7 @@ hn_nvs_handle_rxbuf(struct hn_rx_ring *rxr, struct vmbus_channel *chan,
 		rxr->rsc.is_last = (i == (count - 1));
 		hn_rndis_rxpkt(rxr, rxr->hn_rxbuf + ofs, len);
 	}
+	NET_EPOCH_EXIT(et);
 
 	/*
 	 * Ack the consumed RXBUF associated w/ this channel packet,



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