Lines Matching defs:buf

664 		void *buf;
667 buf = virtqueue_get_buf(rq->vq, &buflen);
668 if (unlikely(!buf))
671 p = virt_to_head_page(buf);
672 off = buf - page_address(p);
699 void *buf, void *ctx,
711 struct page *page = virt_to_head_page(buf);
729 struct virtio_net_hdr_mrg_rxbuf *hdr = buf + header_offset;
739 int offset = buf - page_address(page) + header_offset;
754 buf = page_address(xdp_page);
759 xdp.data_hard_start = buf + VIRTNET_RX_PAD + vi->hdr_len;
808 skb = build_skb(buf, buflen);
816 buf += header_offset;
817 memcpy(skb_vnet_hdr(skb), buf, vi->hdr_len);
839 void *buf,
843 struct page *page = buf;
862 void *buf,
868 struct virtio_net_hdr_mrg_rxbuf *hdr = buf;
870 struct page *page = virt_to_head_page(buf);
871 int offset = buf - page_address(page);
1028 buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx);
1029 if (unlikely(!buf)) {
1039 page = virt_to_head_page(buf);
1068 offset = buf - page_address(page);
1088 buf = virtqueue_get_buf(rq->vq, &len);
1089 if (unlikely(!buf)) {
1096 page = virt_to_head_page(buf);
1107 void *buf, unsigned int len, void **ctx,
1119 put_page(virt_to_head_page(buf));
1121 give_pages(rq, buf);
1123 put_page(virt_to_head_page(buf));
1129 skb = receive_mergeable(dev, vi, rq, buf, ctx, len, xdp_xmit,
1132 skb = receive_big(dev, vi, rq, buf, len, stats);
1134 skb = receive_small(dev, vi, rq, buf, ctx, len, xdp_xmit, stats);
1174 char *buf;
1185 buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
1188 sg_init_one(rq->sg, buf + VIRTNET_RX_PAD + xdp_headroom,
1190 err = virtqueue_add_inbuf_ctx(rq->vq, rq->sg, 1, buf, ctx, gfp);
1192 put_page(virt_to_head_page(buf));
1268 char *buf;
1281 buf = (char *)page_address(alloc_frag->page) + alloc_frag->offset;
1282 buf += headroom; /* advance address leaving hole at front of pkt */
1295 sg_init_one(rq->sg, buf, len);
1297 err = virtqueue_add_inbuf_ctx(rq->vq, rq->sg, 1, buf, ctx, gfp);
1299 put_page(virt_to_head_page(buf));
1413 void *buf;
1420 (buf = virtqueue_get_buf_ctx(rq->vq, &len, &ctx))) {
1421 receive_buf(vi, rq, buf, len, ctx, xdp_xmit, &stats);
1426 (buf = virtqueue_get_buf(rq->vq, &len)) != NULL) {
1427 receive_buf(vi, rq, buf, len, NULL, xdp_xmit, &stats);
1951 void *buf;
1978 buf = kzalloc(((uc_count + mc_count) * ETH_ALEN) +
1980 mac_data = buf;
1981 if (!buf)
2010 kfree(buf);
2601 static int virtnet_get_phys_port_name(struct net_device *dev, char *buf,
2610 ret = snprintf(buf, len, "sby");
2750 static void virtnet_sq_free_unused_buf(struct virtqueue *vq, void *buf)
2752 if (!is_xdp_frame(buf))
2753 dev_kfree_skb(buf);
2755 xdp_return_frame(ptr_to_xdp(buf));
2758 static void virtnet_rq_free_unused_buf(struct virtqueue *vq, void *buf)
2764 put_page(virt_to_head_page(buf));
2766 give_pages(&vi->rq[i], buf);
2768 put_page(virt_to_head_page(buf));
2773 void *buf;
2778 while ((buf = virtqueue_detach_unused_buf(vq)) != NULL)
2779 virtnet_sq_free_unused_buf(vq, buf);
2785 while ((buf = virtqueue_detach_unused_buf(vq)) != NULL)
2786 virtnet_rq_free_unused_buf(vq, buf);
2970 char *buf)
2980 return sprintf(buf, "%u\n",