1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2015 Intel Corporation
11 #include <rte_cycles.h>
12 #include <rte_memory.h>
13 #include <rte_branch_prediction.h>
14 #include <rte_mempool.h>
15 #include <rte_malloc.h>
17 #include <rte_ether.h>
18 #include <rte_ethdev_driver.h>
19 #include <rte_prefetch.h>
20 #include <rte_string_fns.h>
21 #include <rte_errno.h>
22 #include <rte_byteorder.h>
24 #include "virtio_rxtx_simple.h"
26 #ifndef __INTEL_COMPILER
27 #pragma GCC diagnostic ignored "-Wcast-qual"
31 virtio_rxq_vec_setup(struct virtnet_rx *rxq)
34 struct rte_mbuf mb_def = { .buf_addr = 0 }; /* zeroed mbuf */
37 mb_def.data_off = RTE_PKTMBUF_HEADROOM;
38 mb_def.port = rxq->port_id;
39 rte_mbuf_refcnt_set(&mb_def, 1);
41 /* prevent compiler reordering: rearm_data covers previous fields */
42 rte_compiler_barrier();
43 p = (uintptr_t)&mb_def.rearm_data;
44 rxq->mbuf_initializer = *(uint64_t *)p;
49 /* Stub for linkage when arch specific implementation is not available */
51 virtio_recv_pkts_vec(void *rx_queue __rte_unused,
52 struct rte_mbuf **rx_pkts __rte_unused,
53 uint16_t nb_pkts __rte_unused)
55 rte_panic("Wrong weak function linked by linker\n");