nvq 176 drivers/vhost/net.c static int vhost_net_buf_produce(struct vhost_net_virtqueue *nvq) nvq 178 drivers/vhost/net.c struct vhost_net_buf *rxq = &nvq->rxq; nvq 181 drivers/vhost/net.c rxq->tail = ptr_ring_consume_batched(nvq->rx_ring, rxq->queue, nvq 186 drivers/vhost/net.c static void vhost_net_buf_unproduce(struct vhost_net_virtqueue *nvq) nvq 188 drivers/vhost/net.c struct vhost_net_buf *rxq = &nvq->rxq; nvq 190 drivers/vhost/net.c if (nvq->rx_ring && !vhost_net_buf_is_empty(rxq)) { nvq 191 drivers/vhost/net.c ptr_ring_unconsume(nvq->rx_ring, rxq->queue + rxq->head, nvq 209 drivers/vhost/net.c static int vhost_net_buf_peek(struct vhost_net_virtqueue *nvq) nvq 211 drivers/vhost/net.c struct vhost_net_buf *rxq = &nvq->rxq; nvq 216 drivers/vhost/net.c if (!vhost_net_buf_produce(nvq)) nvq 361 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = nvq 366 drivers/vhost/net.c for (i = nvq->done_idx; i != nvq->upend_idx; i = (i + 1) % UIO_MAXIOV) { nvq 376 drivers/vhost/net.c add = min(UIO_MAXIOV - nvq->done_idx, j); nvq 378 drivers/vhost/net.c &vq->heads[nvq->done_idx], add); nvq 379 drivers/vhost/net.c nvq->done_idx = (nvq->done_idx + add) % UIO_MAXIOV; nvq 424 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = nvq 426 drivers/vhost/net.c struct vhost_poll *poll = n->poll + (nvq - n->vqs); nvq 435 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = nvq 437 drivers/vhost/net.c struct vhost_poll *poll = n->poll + (nvq - n->vqs); nvq 447 drivers/vhost/net.c static void vhost_net_signal_used(struct vhost_net_virtqueue *nvq) nvq 449 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 452 drivers/vhost/net.c if (!nvq->done_idx) nvq 455 drivers/vhost/net.c vhost_add_used_and_signal_n(dev, vq, vq->heads, nvq->done_idx); nvq 456 drivers/vhost/net.c nvq->done_idx = 0; nvq 460 drivers/vhost/net.c struct vhost_net_virtqueue *nvq, nvq 466 drivers/vhost/net.c .num = nvq->batched_xdp, nvq 467 drivers/vhost/net.c .ptr = nvq->xdp, nvq 471 drivers/vhost/net.c if (nvq->batched_xdp == 0) nvq 477 drivers/vhost/net.c vq_err(&nvq->vq, "Fail to batch sending packets\n"); nvq 482 drivers/vhost/net.c vhost_net_signal_used(nvq); nvq 483 drivers/vhost/net.c nvq->batched_xdp = 0; nvq 587 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; nvq 588 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 590 drivers/vhost/net.c return (nvq->upend_idx + UIO_MAXIOV - nvq->done_idx) % UIO_MAXIOV > nvq 607 drivers/vhost/net.c struct vhost_net_virtqueue *nvq, nvq 612 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 615 drivers/vhost/net.c ret = vhost_net_tx_get_vq_desc(net, nvq, out, in, msg, busyloop_intr); nvq 627 drivers/vhost/net.c *len = init_iov_iter(vq, &msg->msg_iter, nvq->vhost_hlen, *out); nvq 630 drivers/vhost/net.c *len, nvq->vhost_hlen); nvq 682 drivers/vhost/net.c static int vhost_net_build_xdp(struct vhost_net_virtqueue *nvq, nvq 685 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 691 drivers/vhost/net.c struct xdp_buff *xdp = &nvq->xdp[nvq->batched_xdp]; nvq 696 drivers/vhost/net.c int pad = SKB_DATA_ALIGN(VHOST_NET_RX_PAD + headroom + nvq->sock_hlen); nvq 697 drivers/vhost/net.c int sock_hlen = nvq->sock_hlen; nvq 701 drivers/vhost/net.c if (unlikely(len < nvq->sock_hlen)) nvq 752 drivers/vhost/net.c ++nvq->batched_xdp; nvq 759 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; nvq 760 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 778 drivers/vhost/net.c if (nvq->done_idx == VHOST_NET_BATCH) nvq 779 drivers/vhost/net.c vhost_tx_batch(net, nvq, sock, &msg); nvq 781 drivers/vhost/net.c head = get_tx_bufs(net, nvq, &msg, &out, &in, &len, nvq 804 drivers/vhost/net.c err = vhost_net_build_xdp(nvq, &msg.msg_iter); nvq 808 drivers/vhost/net.c vhost_tx_batch(net, nvq, sock, &msg); nvq 818 drivers/vhost/net.c vhost_tx_batch(net, nvq, sock, &msg); nvq 838 drivers/vhost/net.c vq->heads[nvq->done_idx].id = cpu_to_vhost32(vq, head); nvq 839 drivers/vhost/net.c vq->heads[nvq->done_idx].len = 0; nvq 840 drivers/vhost/net.c ++nvq->done_idx; nvq 843 drivers/vhost/net.c vhost_tx_batch(net, nvq, sock, &msg); nvq 848 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; nvq 849 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 873 drivers/vhost/net.c head = get_tx_bufs(net, nvq, &msg, &out, &in, &len, nvq 896 drivers/vhost/net.c ubuf = nvq->ubuf_info + nvq->upend_idx; nvq 898 drivers/vhost/net.c vq->heads[nvq->upend_idx].id = cpu_to_vhost32(vq, head); nvq 899 drivers/vhost/net.c vq->heads[nvq->upend_idx].len = VHOST_DMA_IN_PROGRESS; nvq 901 drivers/vhost/net.c ubuf->ctx = nvq->ubufs; nvq 902 drivers/vhost/net.c ubuf->desc = nvq->upend_idx; nvq 908 drivers/vhost/net.c ubufs = nvq->ubufs; nvq 910 drivers/vhost/net.c nvq->upend_idx = (nvq->upend_idx + 1) % UIO_MAXIOV; nvq 928 drivers/vhost/net.c nvq->upend_idx = ((unsigned)nvq->upend_idx - 1) nvq 950 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_TX]; nvq 951 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 1097 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = &net->vqs[VHOST_NET_VQ_RX]; nvq 1098 drivers/vhost/net.c struct vhost_virtqueue *vq = &nvq->vq; nvq 1134 drivers/vhost/net.c vhost_hlen = nvq->vhost_hlen; nvq 1135 drivers/vhost/net.c sock_hlen = nvq->sock_hlen; nvq 1148 drivers/vhost/net.c headcount = get_rx_bufs(vq, vq->heads + nvq->done_idx, nvq 1169 drivers/vhost/net.c if (nvq->rx_ring) nvq 1170 drivers/vhost/net.c msg.msg_control = vhost_net_buf_consume(&nvq->rxq); nvq 1223 drivers/vhost/net.c nvq->done_idx += headcount; nvq 1224 drivers/vhost/net.c if (nvq->done_idx > VHOST_NET_BATCH) nvq 1225 drivers/vhost/net.c vhost_net_signal_used(nvq); nvq 1237 drivers/vhost/net.c vhost_net_signal_used(nvq); nvq 1343 drivers/vhost/net.c struct vhost_net_virtqueue *nvq = nvq 1350 drivers/vhost/net.c vhost_net_buf_unproduce(nvq); nvq 1351 drivers/vhost/net.c nvq->rx_ring = NULL; nvq 1494 drivers/vhost/net.c struct vhost_net_virtqueue *nvq; nvq 1508 drivers/vhost/net.c nvq = &n->vqs[index]; nvq 1534 drivers/vhost/net.c vhost_net_buf_unproduce(nvq); nvq 1542 drivers/vhost/net.c nvq->rx_ring = get_tap_ptr_ring(fd); nvq 1544 drivers/vhost/net.c oldubufs = nvq->ubufs; nvq 1545 drivers/vhost/net.c nvq->ubufs = ubufs;