4 * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name of Intel Corporation nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 #ifndef _VIRTIO_RXTX_H_
35 #define _VIRTIO_RXTX_H_
37 #define RTE_PMD_VIRTIO_RX_MAX_BURST 64
39 struct virtnet_stats {
45 /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */
46 uint64_t size_bins[8];
51 /* dummy mbuf, for wraparound when processing RX ring. */
52 struct rte_mbuf fake_mbuf;
53 uint64_t mbuf_initializer; /**< value to init mbufs. */
54 struct rte_mempool *mpool; /**< mempool for mbuf allocation */
56 uint16_t queue_id; /**< DPDK queue index. */
57 uint16_t port_id; /**< Device port identifier. */
60 struct virtnet_stats stats;
62 const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
67 /**< memzone to populate hdr. */
68 const struct rte_memzone *virtio_net_hdr_mz;
69 phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
71 uint16_t queue_id; /**< DPDK queue index. */
72 uint16_t port_id; /**< Device port identifier. */
75 struct virtnet_stats stats;
77 const struct rte_memzone *mz; /**< mem zone to populate TX ring. */
82 /**< memzone to populate hdr. */
83 const struct rte_memzone *virtio_net_hdr_mz;
84 phys_addr_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
85 uint16_t port_id; /**< Device port identifier. */
86 const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
89 int virtio_rxq_vec_setup(struct virtnet_rx *rxvq);
91 int virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,
94 #endif /* _VIRTIO_RXTX_H_ */