gve: Fix Tx tcpdump panic

Ringing the doorbell before making the BPF call can result in the
mbuf being freed before the BPF call.

Reviewed-by:		markj
MFC-after:		3 days
Differential Revision: https://reviews.freebsd.org/D41189
This commit is contained in:
Shailend Chand 2023-07-26 22:22:31 -07:00 committed by Xin LI
parent 5ec2d94ade
commit 74861578d9

View File

@ -706,12 +706,12 @@ gve_xmit_br(struct gve_tx_ring *tx)
break;
}
drbr_advance(ifp, tx->br);
BPF_MTAP(ifp, mbuf);
bus_dmamap_sync(tx->desc_ring_mem.tag, tx->desc_ring_mem.map,
BUS_DMASYNC_PREWRITE);
gve_db_bar_write_4(priv, tx->com.db_offset, tx->req);
drbr_advance(ifp, tx->br);
BPF_MTAP(ifp, mbuf);
}
}