pre-fill the tx ring with bogus empty packets

This commit is contained in:
JackDoan
2025-12-18 15:18:19 -06:00
parent 726e282d0a
commit 111efc0779
7 changed files with 57 additions and 50 deletions

View File

@@ -806,8 +806,11 @@ func (t *tun) WriteMany(x []*packet.OutPacket, q int) (int, error) {
}
func (t *tun) RecycleRxSeg(pkt TunPacket, kick bool, q int) error {
if pkt.GetPayload() == nil {
return nil
}
vpkt := pkt.(*vhostnet.VirtIOPacket)
err := t.vdev[q].ReceiveQueue.OfferDescriptorChains(vpkt.Chains, kick)
err := t.vdev[q].ReceiveQueue.OfferDescriptorChains([]uint16{vpkt.Chain}, kick)
vpkt.Reset() //intentionally ignoring err!
return err
}