eal: add shorthand __rte_weak macro
PATCH 1/10 eal: add shorthand __rte_weak macro
--- lib/librte_eal/common/include/rte_common.h | 5 +++++ 1 file changed, 5 insertions(+)
lib/librte_eal/common/include/rte_common.h +5 -0
@@ -68,6 +68,11 @@ typedef uint16_t unaligned_uint16_t;/******* Macro to mark functions and fields scheduled for removal *****/ #define __rte_deprecated __attribute__((__deprecated__)) +/** +* short definition to mark a function or variable to a weak reference. +*/ +#define __rte_weak __attribute__((__weak__)) +/*********** Macros to eliminate unused variable warnings ********/ /**
Signature · 1 line
2.17.1
PATCH 2/10 qat: update code to use __rte_weak macro
--- drivers/common/qat/qat_device.c | 12 ++++++------ drivers/common/qat/qat_qp.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/common/qat/qat_device.c +6 -6
@@ -239,37 +239,37 @@ static struct rte_pci_driver rte_qat_pmd = { .remove = qat_pci_remove }; -__attribute__((weak))int +__rte_weak int qat_sym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_asym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_sym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_comp_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ;
drivers/common/qat/qat_qp.c +1 -1
@@ -635,7 +635,7 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)return resp_counter; } -__attribute__((weak))int +__rte_weak int qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused) {return 0 ;
Signature · 1 line
2.17.1
Re: [PATCH 02/10] qat: update code to use __rte_weak macro
Quoted 10 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Keith Wiles
Sent: Friday, August 3, 2018 4:06 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH 02/10] qat: update code to use__rte_weakmacroSigned-off-by Keith Wiles <[email protected]>
PATCH 3/10 avf: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/avf/avf_rxtx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/avf/avf_rxtx.c +5 -5
@@ -1925,7 +1925,7 @@ avf_dev_tx_desc_status(void *tx_queue, uint16_t offset)return RTE_ETH_TX_DESC_FULL ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_recv_pkts_vec(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1933,7 +1933,7 @@ avf_recv_pkts_vec(__rte_unused void *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_recv_scattered_pkts_vec(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1941,7 +1941,7 @@ avf_recv_scattered_pkts_vec(__rte_unused void *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_xmit_fixed_burst_vec(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1949,13 +1949,13 @@ avf_xmit_fixed_burst_vec(__rte_unused void *tx_queue,return 0 ; } -int __attribute__((weak)) +__rte_weak int avf_rxq_vec_setup(__rte_unused struct avf_rx_queue *rxq) {return -1 ; } -int __attribute__((weak)) +__rte_weak int avf_txq_vec_setup(__rte_unused struct avf_tx_queue *txq) {return -1 ;
Signature · 1 line
2.17.1
PATCH 4/10 fm10k: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/fm10k/fm10k_ethdev.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +8 -8
@@ -129,13 +129,13 @@ fm10k_mbx_unlock(struct fm10k_hw *hw) }/* Stubs needed for linkage when vPMD is disabled */ -int __attribute__((weak)) +__rte_weak int fm10k_rx_vec_condition_check(__rte_unused struct rte_eth_dev *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_recv_pkts_vec( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts,
@@ -144,7 +144,7 @@ fm10k_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_recv_scattered_pkts_vec( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts,
@@ -153,33 +153,33 @@ fm10k_recv_scattered_pkts_vec(return 0 ; } -int __attribute__((weak)) +__rte_weak int fm10k_rxq_vec_setup(__rte_unused struct fm10k_rx_queue *rxq) {return -1 ; } -void __attribute__((weak)) +__rte_weak voidfm10k_rx_queue_release_mbufs_vec ( __rte_unused struct fm10k_rx_queue *rxq) {return ; } -void __attribute__((weak)) +__rte_weak void fm10k_txq_vec_setup(__rte_unused struct fm10k_tx_queue *txq) {return ; } -int __attribute__((weak)) +__rte_weak int fm10k_tx_vec_condition_check(__rte_unused struct fm10k_tx_queue *txq) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_xmit_fixed_burst_vec(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
Signature · 1 line
2.17.1
PATCH 5/10 i40e: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/i40e/i40e_rxtx.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/net/i40e/i40e_rxtx.c +10 -10
@@ -3165,13 +3165,13 @@ i40e_set_default_pctype_table(struct rte_eth_dev *dev) }/* Stubs needed for linkage when CONFIG_RTE_I40E_INC_VECTOR is set to 'n' */ -int __attribute__((weak)) +__rte_weak int i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -3180,7 +3180,7 @@ i40e_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -3189,7 +3189,7 @@ i40e_recv_scattered_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3197,7 +3197,7 @@ i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3205,25 +3205,25 @@ i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue,return 0 ; } -int __attribute__((weak)) +__rte_weak int i40e_rxq_vec_setup(struct i40e_rx_queue __rte_unused *rxq) {return -1 ; } -int __attribute__((weak)) +__rte_weak int i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq) {return -1 ; } -void __attribute__((weak)) +__rte_weak void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq) {return ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3231,7 +3231,7 @@ i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_xmit_pkts_vec_avx2(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts)
Signature · 1 line
2.17.1
PATCH 6/10 ixgbe: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx.c +4 -4
@@ -5715,13 +5715,13 @@ ixgbe_config_rss_filter(struct rte_eth_dev *dev, }/* Stubs needed for linkage when CONFIG_RTE_IXGBE_INC_VECTOR is set to 'n' */ -int __attribute__((weak)) +__rte_weak int ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t ixgbe_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5730,7 +5730,7 @@ ixgbe_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t ixgbe_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5739,7 +5739,7 @@ ixgbe_recv_scattered_pkts_vec(return 0 ; } -int __attribute__((weak)) +__rte_weak int ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) {return -1 ;
Signature · 1 line
2.17.1
PATCH 7/10 mlx5: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/mlx5/mlx5_rxtx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/mlx5/mlx5_rxtx.c +7 -7
@@ -2324,7 +2324,7 @@ removed_rx_burst(void *dpdk_txq __rte_unused,* (e.g. mlx5_rxtx_vec_sse.c for x86). */ -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_tx_burst_raw_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2332,7 +2332,7 @@ mlx5_tx_burst_raw_vec(void *dpdk_txq __rte_unused,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_tx_burst_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2340,7 +2340,7 @@ mlx5_tx_burst_vec(void *dpdk_txq __rte_unused,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_rx_burst_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2348,25 +2348,25 @@ mlx5_rx_burst_vec(void *dpdk_txq __rte_unused,return 0 ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_raw_vec_tx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_vec_tx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_vec_rx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ;
Signature · 1 line
2.17.1
Re: [PATCH 07/10] mlx5: update code to use __rte_weak macro
Quoted 5 lines · Keith Wiles
Signed-off-by Keith Wiles <[email protected]>---
Thanks
PATCH 8/10 virtio: update code to use __rte_weak macro
In reply to Keith Wiles--- drivers/net/virtio/virtio_rxtx_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -47,7 +47,7 @@ virtio_rxq_vec_setup(struct virtnet_rx *rxq) }/* Stub for linkage when arch specific implementation is not available */ -uint16_t __attribute__((weak)) +__rte_weak uint16_t virtio_recv_pkts_vec(void *rx_queue __rte_unused, struct rte_mbuf **rx_pkts __rte_unused, uint16_t nb_pkts __rte_unused)
Signature · 1 line
2.17.1
PATCH 9/10 acl: update code to use __rte_weak macro
In reply to Keith Wiles--- lib/librte_acl/rte_acl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/librte_acl/rte_acl.c +4 -4
@@ -16,7 +16,7 @@ EAL_REGISTER_TAILQ(rte_acl_tailq)* If the compiler doesn't support AVX2 instructions, * then the dummy one would be used instead for AVX2 classify method. */ -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -26,7 +26,7 @@ rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -36,7 +36,7 @@ rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -46,7 +46,7 @@ rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_altivec(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
Signature · 1 line
2.17.1
PATCH 10/10 bpf: update code to use __rte_weak macro
In reply to Keith Wiles--- lib/librte_bpf/bpf_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_bpf/bpf_load.c +1 -1
@@ -131,7 +131,7 @@ rte_bpf_load(const struct rte_bpf_prm *prm)return bpf; } -__rte_experimental __attribute__ ((weak)) struct rte_bpf * +__rte_experimental __rte_weak struct rte_bpf *rte_bpf_elf_load (const struct rte_bpf_prm *prm,const char *fname,const char *sname) {
Signature · 1 line
2.17.1
Quoted 10 lines · keith.wiles at intel.com (Keith Wiles)
Signed-off-by Keith Wiles <keith.wiles at intel.com>--- lib/librte_eal/common/include/rte_common.h | 5 +++++ 1 file changed, 5 insertions(+)lib/librte_eal/common/include/rte_common.h +0
-0
lib/librte_eal/common/include/rte_common.h typedef uint16_t unaligned_uint16_t; · line 74
Quoted 7 lines
lib/librte_eal/common/include/rte_common.h +4
-0@@ -68,6 +68,11 @@ typedef uint16_t unaligned_uint16_t;/******* Macro to mark functions and fields scheduled for removal *****/ #define __rte_deprecated __attribute__((__deprecated__)) +/** +* short definition to mark a function or variable to a weak reference. +*/ +#define __rte_weak __attribute__((__weak__))
Looks good to me.
Since the change is all mechanical same change in further patches, what do you think merging this patchset into single patch?
Quoted 24 lines · Ferruh
Quoted 10 lines · keith.wiles at intel.com (Keith Wiles)
Signed-off-by Keith Wiles <keith.wiles at intel.com>---
lib/librte_eal/common/include/rte_common.h| 5 +++++1 file changed, 5 insertions(+)lib/librte_eal/common/include/rte_common.h +0
-0lib/librte_eal/common/include/rte_common.h typedef uint16_t unaligned_uint16_t; · line 74
Quoted 7 lines
lib/librte_eal/common/include/rte_common.h +4
-0@@ -68,6 +68,11 @@ typedef uint16_t unaligned_uint16_t;/******* Macro to mark functions and fields scheduled for removal *****/ #define __rte_deprecated __attribute__((__deprecated__)) +/** +* short definition to mark a function or variable to a weak reference. +*/ +#define __rte_weak __attribute__((__weak__))Looks good to me.
Quoted 4 lines
Reviewed-by Ferruh Yigit <[email protected]>Since the change is all mechanical same change in further patches, what do you think merging this patchset into single patch?
I do not have a problem merging this into one, just time to do it is my big problem. The only reason I split this up was to give each owner of the file to review them.
Regards,
Keith
PATCH v2 1/1 add shorthand support for __rte_weak macro
eal: add shorthand __rte_weak macro
qat: update code to use __rte_weak macro
avf: update code to use __rte_weak macro
fm10k: update code to use __rte_weak macro
i40e: update code to use __rte_weak macro
ixgbe: update code to use __rte_weak macro
mlx5: update code to use __rte_weak macro
virtio: update code to use __rte_weak macro
acl: update code to use __rte_weak macro
bpf: update code to use __rte_weak macro
Merge all of the patches into one patch
--- drivers/common/qat/qat_device.c | 12 ++++++------ drivers/common/qat/qat_qp.c | 2 +- drivers/net/avf/avf_rxtx.c | 10 +++++----- drivers/net/fm10k/fm10k_ethdev.c | 16 ++++++++-------- drivers/net/i40e/i40e_rxtx.c | 20 ++++++++++---------- drivers/net/ixgbe/ixgbe_rxtx.c | 8 ++++---- drivers/net/mlx5/mlx5_rxtx.c | 14 +++++++------- drivers/net/virtio/virtio_rxtx_simple.c | 2 +- lib/librte_acl/rte_acl.c | 8 ++++---- lib/librte_bpf/bpf_load.c | 2 +- lib/librte_eal/common/include/rte_common.h | 5 +++++ 11 files changed, 52 insertions(+), 47 deletions(-)
drivers/common/qat/qat_device.c +6 -6
@@ -239,37 +239,37 @@ static struct rte_pci_driver rte_qat_pmd = { .remove = qat_pci_remove }; -__attribute__((weak))int +__rte_weak int qat_sym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_asym_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_sym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_asym_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_comp_dev_create(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ; } -__attribute__((weak))int +__rte_weak int qat_comp_dev_destroy(struct qat_pci_device *qat_pci_dev __rte_unused) {return 0 ;
drivers/common/qat/qat_qp.c +1 -1
@@ -635,7 +635,7 @@ qat_dequeue_op_burst(void *qp, void **ops, uint16_t nb_ops)return resp_counter; } -__attribute__((weak))int +__rte_weak int qat_comp_process_response(void **op __rte_unused, uint8_t *resp __rte_unused) {return 0 ;
drivers/net/avf/avf_rxtx.c +5 -5
@@ -1918,7 +1918,7 @@ avf_dev_tx_desc_status(void *tx_queue, uint16_t offset)return RTE_ETH_TX_DESC_FULL ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_recv_pkts_vec(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1926,7 +1926,7 @@ avf_recv_pkts_vec(__rte_unused void *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_recv_scattered_pkts_vec(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1934,7 +1934,7 @@ avf_recv_scattered_pkts_vec(__rte_unused void *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t avf_xmit_fixed_burst_vec(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
@@ -1942,13 +1942,13 @@ avf_xmit_fixed_burst_vec(__rte_unused void *tx_queue,return 0 ; } -int __attribute__((weak)) +__rte_weak int avf_rxq_vec_setup(__rte_unused struct avf_rx_queue *rxq) {return -1 ; } -int __attribute__((weak)) +__rte_weak int avf_txq_vec_setup(__rte_unused struct avf_tx_queue *txq) {return -1 ;
drivers/net/fm10k/fm10k_ethdev.c +8 -8
@@ -129,13 +129,13 @@ fm10k_mbx_unlock(struct fm10k_hw *hw) }/* Stubs needed for linkage when vPMD is disabled */ -int __attribute__((weak)) +__rte_weak int fm10k_rx_vec_condition_check(__rte_unused struct rte_eth_dev *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_recv_pkts_vec( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts,
@@ -144,7 +144,7 @@ fm10k_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_recv_scattered_pkts_vec( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts,
@@ -153,33 +153,33 @@ fm10k_recv_scattered_pkts_vec(return 0 ; } -int __attribute__((weak)) +__rte_weak int fm10k_rxq_vec_setup(__rte_unused struct fm10k_rx_queue *rxq) {return -1 ; } -void __attribute__((weak)) +__rte_weak voidfm10k_rx_queue_release_mbufs_vec ( __rte_unused struct fm10k_rx_queue *rxq) {return ; } -void __attribute__((weak)) +__rte_weak void fm10k_txq_vec_setup(__rte_unused struct fm10k_tx_queue *txq) {return ; } -int __attribute__((weak)) +__rte_weak int fm10k_tx_vec_condition_check(__rte_unused struct fm10k_tx_queue *txq) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t fm10k_xmit_fixed_burst_vec(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts)
drivers/net/i40e/i40e_rxtx.c +10 -10
@@ -3175,13 +3175,13 @@ i40e_set_default_pctype_table(struct rte_eth_dev *dev) }/* Stubs needed for linkage when CONFIG_RTE_I40E_INC_VECTOR is set to 'n' */ -int __attribute__((weak)) +__rte_weak int i40e_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -3190,7 +3190,7 @@ i40e_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -3199,7 +3199,7 @@ i40e_recv_scattered_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3207,7 +3207,7 @@ i40e_recv_pkts_vec_avx2(void __rte_unused *rx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3215,25 +3215,25 @@ i40e_recv_scattered_pkts_vec_avx2(void __rte_unused *rx_queue,return 0 ; } -int __attribute__((weak)) +__rte_weak int i40e_rxq_vec_setup(struct i40e_rx_queue __rte_unused *rxq) {return -1 ; } -int __attribute__((weak)) +__rte_weak int i40e_txq_vec_setup(struct i40e_tx_queue __rte_unused *txq) {return -1 ; } -void __attribute__((weak)) +__rte_weak void i40e_rx_queue_release_mbufs_vec(struct i40e_rx_queue __rte_unused*rxq) {return ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts)
@@ -3241,7 +3241,7 @@ i40e_xmit_fixed_burst_vec(void __rte_unused * tx_queue,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t i40e_xmit_pkts_vec_avx2(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts)
drivers/net/ixgbe/ixgbe_rxtx.c +4 -4
@@ -5716,13 +5716,13 @@ ixgbe_config_rss_filter(struct rte_eth_dev *dev, }/* Stubs needed for linkage when CONFIG_RTE_IXGBE_INC_VECTOR is set to 'n' */ -int __attribute__((weak)) +__rte_weak int ixgbe_rx_vec_dev_conf_condition_check(struct rte_eth_dev __rte_unused *dev) {return -1 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t ixgbe_recv_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5731,7 +5731,7 @@ ixgbe_recv_pkts_vec(return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t ixgbe_recv_scattered_pkts_vec( void __rte_unused *rx_queue, struct rte_mbuf __rte_unused **rx_pkts,
@@ -5740,7 +5740,7 @@ ixgbe_recv_scattered_pkts_vec(return 0 ; } -int __attribute__((weak)) +__rte_weak int ixgbe_rxq_vec_setup(struct ixgbe_rx_queue __rte_unused *rxq) {return -1 ;
drivers/net/mlx5/mlx5_rxtx.c +7 -7
@@ -2324,7 +2324,7 @@ removed_rx_burst(void *dpdk_txq __rte_unused,* (e.g. mlx5_rxtx_vec_sse.c for x86). */ -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_tx_burst_raw_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2332,7 +2332,7 @@ mlx5_tx_burst_raw_vec(void *dpdk_txq __rte_unused,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_tx_burst_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2340,7 +2340,7 @@ mlx5_tx_burst_vec(void *dpdk_txq __rte_unused,return 0 ; } -uint16_t __attribute__((weak)) +__rte_weak uint16_t mlx5_rx_burst_vec(void *dpdk_txq __rte_unused, struct rte_mbuf **pkts __rte_unused, uint16_t pkts_n __rte_unused)
@@ -2348,25 +2348,25 @@ mlx5_rx_burst_vec(void *dpdk_txq __rte_unused,return 0 ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_raw_vec_tx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_vec_tx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq __rte_unused) {return -ENOTSUP ; } -int __attribute__((weak)) +__rte_weak int mlx5_check_vec_rx_support(struct rte_eth_dev *dev __rte_unused) {return -ENOTSUP ;
drivers/net/virtio/virtio_rxtx_simple.c +1 -1
@@ -47,7 +47,7 @@ virtio_rxq_vec_setup(struct virtnet_rx *rxq) }/* Stub for linkage when arch specific implementation is not available */ -uint16_t __attribute__((weak)) +__rte_weak uint16_t virtio_recv_pkts_vec(void *rx_queue __rte_unused, struct rte_mbuf **rx_pkts __rte_unused, uint16_t nb_pkts __rte_unused)
lib/librte_acl/rte_acl.c +4 -4
@@ -16,7 +16,7 @@ EAL_REGISTER_TAILQ(rte_acl_tailq)* If the compiler doesn't support AVX2 instructions, * then the dummy one would be used instead for AVX2 classify method. */ -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -26,7 +26,7 @@ rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -36,7 +36,7 @@ rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
@@ -46,7 +46,7 @@ rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,return -ENOTSUP ; } -int __attribute__ ((weak)) +__rte_weak int rte_acl_classify_altivec(__rte_unused const struct rte_acl_ctx *ctx, __rte_unused const uint8_t **data, __rte_unused uint32_t *results,
lib/librte_bpf/bpf_load.c +1 -1
@@ -131,7 +131,7 @@ rte_bpf_load(const struct rte_bpf_prm *prm)return bpf; } -__rte_experimental __attribute__ ((weak)) struct rte_bpf * +__rte_experimental __rte_weak struct rte_bpf *rte_bpf_elf_load (const struct rte_bpf_prm *prm,const char *fname,const char *sname) {
lib/librte_eal/common/include/rte_common.h +5 -0
@@ -68,6 +68,11 @@ typedef uint16_t unaligned_uint16_t;/******* Macro to mark functions and fields scheduled for removal *****/ #define __rte_deprecated __attribute__((__deprecated__)) +/** +* short definition to mark a function or variable to a weak reference. +*/ +#define __rte_weak __attribute__((__weak__)) +/*********** Macros to eliminate unused variable warnings ********/ /**
Signature · 1 line
2.17.1
Re: [PATCH v2] add shorthand support for __rte_weak macro
05/10/2018 16:48, Keith Wiles:
Quoted 11 lines
eal: add shorthand
__rte_weakmacro
qat: update code to use__rte_weakmacro
avf: update code to use__rte_weakmacro
fm10k: update code to use__rte_weakmacro
i40e: update code to use__rte_weakmacro
ixgbe: update code to use__rte_weakmacro
mlx5: update code to use__rte_weakmacro
virtio: update code to use__rte_weakmacro
acl: update code to use__rte_weakmacro
bpf: update code to use__rte_weakmacro
Quoted 4 lines
Merge all of the patches into one patch
Signed-off-by Keith Wiles <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied with below small change, thanks.
- * short definition to mark a function or variable to a weak reference.
+ * Mark a function or variable to a weak reference.
Quoted 30 lines · Keith
Quoted 27 lines · Ferruh
Quoted 10 lines · keith.wiles at intel.com (Keith Wiles)
Signed-off-by Keith Wiles <keith.wiles at intel.com>---
lib/librte_eal/common/include/rte_common.h| 5 +++++1 file changed, 5 insertions(+)lib/librte_eal/common/include/rte_common.h +0
-0lib/librte_eal/common/include/rte_common.h typedef uint16_t unaligned_uint16_t; · line 74
Quoted 7 lines
lib/librte_eal/common/include/rte_common.h +4
-0@@ -68,6 +68,11 @@ typedef uint16_t unaligned_uint16_t;/******* Macro to mark functions and fields scheduled for removal *****/ #define __rte_deprecated __attribute__((__deprecated__)) +/** +* short definition to mark a function or variable to a weak reference. +*/ +#define __rte_weak __attribute__((__weak__))Looks good to me.
Reviewed-by Ferruh Yigit <[email protected]>
Quoted 4 lines
Quoted 2 lines
Since the change is all mechanical same change in further patches, what do you think merging this patchset into single patch?
I do not have a problem merging this into one, just time to do it is my big problem. The only reason I split this up was to give each owner of the file to review them.
During a meeting I was able to combine the patches, please have look.
Quoted 4 lines
Regards,
Keith
Regards,
Keith