Lines Matching refs:total_sg
236 unsigned int total_sg) in virtqueue_use_indirect() argument
242 return (vq->indirect && total_sg > 1 && vq->vq.num_free); in virtqueue_use_indirect()
476 unsigned int total_sg, in alloc_indirect_split() argument
490 size = sizeof(*desc) * total_sg + sizeof(*extra) * total_sg; in alloc_indirect_split()
496 extra = (struct vring_desc_extra *)&desc[total_sg]; in alloc_indirect_split()
498 for (i = 0; i < total_sg; i++) in alloc_indirect_split()
531 unsigned int total_sg, in virtqueue_add_split() argument
559 BUG_ON(total_sg == 0); in virtqueue_add_split()
563 if (virtqueue_use_indirect(vq, total_sg)) in virtqueue_add_split()
564 desc = alloc_indirect_split(_vq, total_sg, gfp); in virtqueue_add_split()
567 WARN_ON_ONCE(total_sg > vq->split.vring.num && !vq->indirect); in virtqueue_add_split()
576 extra = (struct vring_desc_extra *)&desc[total_sg]; in virtqueue_add_split()
582 descs_used = total_sg; in virtqueue_add_split()
643 vq, desc, total_sg * sizeof(struct vring_desc), in virtqueue_add_split()
651 total_sg * sizeof(struct vring_desc), in virtqueue_add_split()
702 for (n = 0; n < total_sg; n++) { in virtqueue_add_split()
1295 static struct vring_packed_desc *alloc_indirect_packed(unsigned int total_sg, in alloc_indirect_packed() argument
1309 size = (sizeof(*desc) + sizeof(*extra)) * total_sg; in alloc_indirect_packed()
1315 extra = (struct vring_desc_extra *)&desc[total_sg]; in alloc_indirect_packed()
1317 for (i = 0; i < total_sg; i++) in alloc_indirect_packed()
1325 unsigned int total_sg, in virtqueue_add_indirect_packed() argument
1340 desc = alloc_indirect_packed(total_sg, gfp); in virtqueue_add_indirect_packed()
1344 extra = (struct vring_desc_extra *)&desc[total_sg]; in virtqueue_add_indirect_packed()
1381 total_sg * sizeof(struct vring_packed_desc), in virtqueue_add_indirect_packed()
1387 vq->packed.vring.desc[head].len = cpu_to_le32(total_sg * in virtqueue_add_indirect_packed()
1393 vq->packed.desc_extra[id].len = total_sg * in virtqueue_add_indirect_packed()
1450 unsigned int total_sg, in virtqueue_add_packed() argument
1478 BUG_ON(total_sg == 0); in virtqueue_add_packed()
1480 if (virtqueue_use_indirect(vq, total_sg)) { in virtqueue_add_packed()
1481 err = virtqueue_add_indirect_packed(vq, sgs, total_sg, out_sgs, in virtqueue_add_packed()
1494 WARN_ON_ONCE(total_sg > vq->packed.vring.num && !vq->indirect); in virtqueue_add_packed()
1498 descs_used = total_sg; in virtqueue_add_packed()
1522 (++c == total_sg ? 0 : VRING_DESC_F_NEXT) | in virtqueue_add_packed()
1589 for (n = 0; n < total_sg; n++) { in virtqueue_add_packed()
2270 unsigned int total_sg, in virtqueue_add() argument
2280 return vq->packed_ring ? virtqueue_add_packed(_vq, sgs, total_sg, in virtqueue_add()
2282 virtqueue_add_split(_vq, sgs, total_sg, in virtqueue_add()
2307 unsigned int i, total_sg = 0; in virtqueue_add_sgs() local
2314 total_sg++; in virtqueue_add_sgs()
2316 return virtqueue_add(_vq, sgs, total_sg, out_sgs, in_sgs, in virtqueue_add_sgs()