1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
5 #ifndef _VIRTIO_RXTX_H_
6 #define _VIRTIO_RXTX_H_
8 #define RTE_PMD_VIRTIO_RX_MAX_BURST 64
10 struct virtnet_stats {
16 /* Size bins in array as RFC 2819, undersized [0], 64 [1], etc */
17 uint64_t size_bins[8];
22 /* dummy mbuf, for wraparound when processing RX ring. */
23 struct rte_mbuf fake_mbuf;
24 uint64_t mbuf_initializer; /**< value to init mbufs. */
25 struct rte_mempool *mpool; /**< mempool for mbuf allocation */
27 uint16_t queue_id; /**< DPDK queue index. */
28 uint16_t port_id; /**< Device port identifier. */
31 struct virtnet_stats stats;
33 const struct rte_memzone *mz; /**< mem zone to populate RX ring. */
38 /**< memzone to populate hdr. */
39 const struct rte_memzone *virtio_net_hdr_mz;
40 rte_iova_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
42 uint16_t queue_id; /**< DPDK queue index. */
43 uint16_t port_id; /**< Device port identifier. */
46 struct virtnet_stats stats;
48 const struct rte_memzone *mz; /**< mem zone to populate TX ring. */
53 /**< memzone to populate hdr. */
54 const struct rte_memzone *virtio_net_hdr_mz;
55 rte_iova_t virtio_net_hdr_mem; /**< hdr for each xmit packet */
56 uint16_t port_id; /**< Device port identifier. */
57 const struct rte_memzone *mz; /**< mem zone to populate CTL ring. */
58 rte_spinlock_t lock; /**< spinlock for control queue. */
61 int virtio_rxq_vec_setup(struct virtnet_rx *rxvq);
62 void virtio_update_packet_stats(struct virtnet_stats *stats,
63 struct rte_mbuf *mbuf);
65 #endif /* _VIRTIO_RXTX_H_ */