Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152599655
D8675.id22608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8675.id22608.diff
View Options
Index: sys/dev/hyperv/netvsc/if_hn.c
===================================================================
--- sys/dev/hyperv/netvsc/if_hn.c
+++ sys/dev/hyperv/netvsc/if_hn.c
@@ -1924,17 +1924,20 @@
static int
hn_txpkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd)
{
- int error, send_failed = 0;
+ int error, send_failed = 0, has_bpf;
again:
- /*
- * Make sure that this txd and any aggregated txds are not freed
- * before ETHER_BPF_MTAP.
- */
- hn_txdesc_hold(txd);
+ has_bpf = bpf_peers_present(ifp->if_bpf);
+ if (has_bpf) {
+ /*
+ * Make sure that this txd and any aggregated txds are not
+ * freed before ETHER_BPF_MTAP.
+ */
+ hn_txdesc_hold(txd);
+ }
error = txr->hn_sendpkt(txr, txd);
if (!error) {
- if (bpf_peers_present(ifp->if_bpf)) {
+ if (has_bpf) {
const struct hn_txdesc *tmp_txd;
ETHER_BPF_MTAP(ifp, txd->m);
@@ -1957,7 +1960,8 @@
txr->hn_pkts += txr->hn_stat_pkts;
txr->hn_sends++;
}
- hn_txdesc_put(txr, txd);
+ if (has_bpf)
+ hn_txdesc_put(txr, txd);
if (__predict_false(error)) {
int freed;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 10:25 PM (21 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31626265
Default Alt Text
D8675.id22608.diff (1 KB)
Attached To
Mode
D8675: hyperv/hn: Don't hold txdesc, if no BPFs are attached.
Attached
Detach File
Event Timeline
Log In to Comment