Patch from Bryan to fix a virtqueue issue:

virtqueue: Fix non-indirect virtqueues

    We really must walk the entire descriptor chain in order
    to append the to be free'd chain to the existing free
    chain.

Submitted by:	Bryan Venteicher (bryanv@daemoninthecloset.org)
Reported by:	cognet
This commit is contained in:
Peter Grehan 2012-10-11 23:03:42 +00:00
parent a5450ddfbd
commit 1dbd8bc927

View File

@ -780,8 +780,8 @@ vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)
VQ_RING_ASSERT_CHAIN_TERM(vq);
vq->vq_free_cnt += dxp->ndescs;
dxp->ndescs--;
#ifdef INVARIANTS
if ((dp->flags & VRING_DESC_F_INDIRECT) == 0) {
while (dp->flags & VRING_DESC_F_NEXT) {
VQ_RING_ASSERT_VALID_IDX(vq, dp->next);
@ -789,10 +789,9 @@ vq_ring_free_chain(struct virtqueue *vq, uint16_t desc_idx)
dxp->ndescs--;
}
}
VQASSERT(vq, dxp->ndescs == 1,
VQASSERT(vq, dxp->ndescs == 0,
"failed to free entire desc chain, remaining: %d", dxp->ndescs);
#endif
dxp->ndescs = 0;
/*
* We must append the existing free chain, if any, to the end of