1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Fix networking problem after r280026.

I've missed that network driver sometimes returns taken request back to
available queue without processing.  Add new helper function for that case.

Reported by:	flo
MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2015-03-15 16:09:39 +00:00
parent e72d4950e1
commit 7315946b80
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280041
3 changed files with 17 additions and 2 deletions

View File

@ -342,6 +342,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *sc)
* No more packets, but still some avail ring
* entries. Interrupt if needed/appropriate.
*/
vq_retchain(vq);
vq_endchains(vq, 0);
return;
}

View File

@ -372,8 +372,21 @@ vq_getchain(struct vqueue_info *vq, uint16_t *pidx,
}
/*
* Return the currently-first request chain to the guest, setting
* its I/O length to the provided value.
* Return the currently-first request chain back to the available queue.
*
* (This chain is the one you handled when you called vq_getchain()
* and used its positive return value.)
*/
void
vq_retchain(struct vqueue_info *vq)
{
vq->vq_last_avail--;
}
/*
* Return specified request chain to the guest, setting its I/O length
* to the provided value.
*
* (This chain is the one you handled when you called vq_getchain()
* and used its positive return value.)

View File

@ -453,6 +453,7 @@ void vi_set_io_bar(struct virtio_softc *, int);
int vq_getchain(struct vqueue_info *vq, uint16_t *pidx,
struct iovec *iov, int n_iov, uint16_t *flags);
void vq_retchain(struct vqueue_info *vq);
void vq_relchain(struct vqueue_info *vq, uint16_t idx, uint32_t iolen);
void vq_endchains(struct vqueue_info *vq, int used_all_avail);