[RFC,08/10] net/virtio: remove weak symbols
Commit Message
Rather than use weak symbols, expose stubs symbols when needed.
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/virtio/meson.build | 5 +++++
drivers/net/virtio/virtio_rxtx.c | 6 ++++--
drivers/net/virtio/virtio_rxtx_simple.c | 4 +++-
3 files changed, 12 insertions(+), 3 deletions(-)
@@ -28,6 +28,7 @@ cflags += no_wvla_cflag
if arch_subdir == 'x86'
if cc_has_avx512
cflags += ['-DCC_AVX512_SUPPORT']
+ cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
virtio_avx512_lib = static_library('virtio_avx512_lib',
'virtio_rxtx_packed.c',
dependencies: [static_rte_ethdev,
@@ -43,11 +44,15 @@ if arch_subdir == 'x86'
cflags += '-DVIRTIO_ICC_UNROLL_PRAGMA'
endif
endif
+ cflags += ['-DVIRTIO_RXTX_VEC']
sources += files('virtio_rxtx_simple_sse.c')
elif arch_subdir == 'ppc'
+ cflags += ['-DVIRTIO_RXTX_VEC']
sources += files('virtio_rxtx_simple_altivec.c')
elif arch_subdir == 'arm' and dpdk_conf.get('RTE_ARCH_64')
+ cflags += ['-DVIRTIO_RXTX_PACKED_VEC']
sources += files('virtio_rxtx_packed.c')
+ cflags += ['-DVIRTIO_RXTX_VEC']
sources += files('virtio_rxtx_simple_neon.c')
endif
@@ -2045,7 +2045,8 @@ virtio_xmit_pkts_inorder(void *tx_queue,
return nb_tx;
}
-__rte_weak uint16_t
+#ifndef VIRTIO_RXTX_PACKED_VEC
+uint16_t
virtio_recv_pkts_packed_vec(void *rx_queue __rte_unused,
struct rte_mbuf **rx_pkts __rte_unused,
uint16_t nb_pkts __rte_unused)
@@ -2053,10 +2054,11 @@ virtio_recv_pkts_packed_vec(void *rx_queue __rte_unused,
return 0;
}
-__rte_weak uint16_t
+uint16_t
virtio_xmit_pkts_packed_vec(void *tx_queue __rte_unused,
struct rte_mbuf **tx_pkts __rte_unused,
uint16_t nb_pkts __rte_unused)
{
return 0;
}
+#endif /* DVIRTIO_RXTX_PACKED_VEC */
@@ -43,8 +43,9 @@ virtio_rxq_vec_setup(struct virtnet_rx *rxq)
return 0;
}
+#ifndef VIRTIO_RXTX_VEC
/* Stub for linkage when arch specific implementation is not available */
-__rte_weak uint16_t
+uint16_t
virtio_recv_pkts_vec(void *rx_queue __rte_unused,
struct rte_mbuf **rx_pkts __rte_unused,
uint16_t nb_pkts __rte_unused)
@@ -52,3 +53,4 @@ virtio_recv_pkts_vec(void *rx_queue __rte_unused,
rte_panic("Wrong weak function linked by linker\n");
return 0;
}
+#endif /* VIRTIO_RXTX_VEC */