-/*
- * Allocate a host supported pktmbuf.
- */
-static __rte_always_inline struct rte_mbuf *
-virtio_dev_pktmbuf_alloc(struct virtio_net *dev, struct rte_mempool *mp,
- uint32_t data_len)
-{
- struct rte_mbuf *pkt = rte_pktmbuf_alloc(mp);
-
- if (unlikely(pkt == NULL)) {
- VHOST_LOG_DATA(ERR,
- "Failed to allocate memory for mbuf.\n");
- return NULL;
- }
-
- if (virtio_dev_pktmbuf_prep(dev, pkt, data_len)) {
- /* Data doesn't fit into the buffer and the host supports
- * only linear buffers
- */
- rte_pktmbuf_free(pkt);
- return NULL;
- }
-
- return pkt;
-}
-