From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 163C845F26; Tue, 24 Dec 2024 04:06:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F00FF4060C; Tue, 24 Dec 2024 04:06:20 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id BEBD540263 for ; Tue, 24 Dec 2024 04:06:14 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id B1F20206ADDA; Mon, 23 Dec 2024 19:06:13 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com B1F20206ADDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735009573; bh=tLtc0Zoj18wSQ1KOdhk104a6tmQxOCeZ/ncpM+P9jig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W+EFdKuc73uKa5v1rXkt9VP96fLNdavO+6kHhlFZfoYQC/EVftNFa8hKuj+wfq4DG aI+WOypfhlvL5GKsuTiuI8JwF0pTQdEjgysEK/HlOK21zRiCZmKVCOBeZEF+nCzQBt GPDTxaJxNKouLGPsKgZ09g9hu5SOyIz1+ErdkqsM= From: Andre Muezerie To: John Daley , Hyong Youb Kim , Jie Hai , Chaoyong He , Maxime Coquelin , Chenbo Xia Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 5/5] drivers/net: use portable macro for weak linking Date: Mon, 23 Dec 2024 19:05:52 -0800 Message-Id: <1735009552-31906-6-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1735009552-31906-1-git-send-email-andremue@linux.microsoft.com> References: <1735009552-31906-1-git-send-email-andremue@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org MSVC uses pragmas to indicate weak linking, so the old __rte_weak attribute needs to made into a macro so that the same syntax can be used for MSVC and other compilers like gcc. This patch replaces __rte_weak with macro RTE_WEAK. Signed-off-by: Andre Muezerie --- drivers/net/enic/enic_main.c | 4 +-- drivers/net/fm10k/fm10k_ethdev.c | 32 ++++++++++++------------ drivers/net/hns3/hns3_rxtx.c | 28 ++++++++++----------- drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c | 4 +-- drivers/net/nfp/nfp_rxtx_vec_stub.c | 8 +++--- drivers/net/virtio/virtio_rxtx.c | 8 +++--- drivers/net/virtio/virtio_rxtx_simple.c | 4 +-- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index b755b15d92..8bcd620bb8 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -513,8 +513,8 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, uint16_t queue_idx) * The 'strong' version is in enic_rxtx_vec_avx2.c. This weak version is used * used when that file is not compiled. */ -__rte_weak bool -enic_use_vector_rx_handler(__rte_unused struct rte_eth_dev *eth_dev) +bool +RTE_WEAK(enic_use_vector_rx_handler)(__rte_unused struct rte_eth_dev *eth_dev) { return false; } diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 7b490bea17..26385c6bd4 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -130,14 +130,14 @@ fm10k_mbx_unlock(struct fm10k_hw *hw) } /* Stubs needed for linkage when vPMD is disabled */ -__rte_weak int -fm10k_rx_vec_condition_check(__rte_unused struct rte_eth_dev *dev) +int +RTE_WEAK(fm10k_rx_vec_condition_check)(__rte_unused struct rte_eth_dev *dev) { return -1; } -__rte_weak uint16_t -fm10k_recv_pkts_vec( +uint16_t +RTE_WEAK(fm10k_recv_pkts_vec)( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) @@ -145,8 +145,8 @@ fm10k_recv_pkts_vec( return 0; } -__rte_weak uint16_t -fm10k_recv_scattered_pkts_vec( +uint16_t +RTE_WEAK(fm10k_recv_scattered_pkts_vec)( __rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) @@ -154,34 +154,34 @@ fm10k_recv_scattered_pkts_vec( return 0; } -__rte_weak int -fm10k_rxq_vec_setup(__rte_unused struct fm10k_rx_queue *rxq) +int +RTE_WEAK(fm10k_rxq_vec_setup)(__rte_unused struct fm10k_rx_queue *rxq) { return -1; } -__rte_weak void -fm10k_rx_queue_release_mbufs_vec( +void +RTE_WEAK(fm10k_rx_queue_release_mbufs_vec)( __rte_unused struct fm10k_rx_queue *rxq) { return; } -__rte_weak void -fm10k_txq_vec_setup(__rte_unused struct fm10k_tx_queue *txq) +void +RTE_WEAK(fm10k_txq_vec_setup)(__rte_unused struct fm10k_tx_queue *txq) { return; } -__rte_weak int -fm10k_tx_vec_condition_check(__rte_unused struct fm10k_tx_queue *txq) +int +RTE_WEAK(fm10k_tx_vec_condition_check)(__rte_unused struct fm10k_tx_queue *txq) { return -1; } -__rte_weak uint16_t -fm10k_xmit_fixed_burst_vec(__rte_unused void *tx_queue, +uint16_t +RTE_WEAK(fm10k_xmit_fixed_burst_vec)(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts) { diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 03bbbc435f..392e19a6bc 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -2787,27 +2787,27 @@ hns3_recv_scattered_pkts(void *rx_queue, return nb_rx; } -void __rte_weak -hns3_rxq_vec_setup(__rte_unused struct hns3_rx_queue *rxq) +void +RTE_WEAK(hns3_rxq_vec_setup)(__rte_unused struct hns3_rx_queue *rxq) { } -int __rte_weak -hns3_rx_check_vec_support(__rte_unused struct rte_eth_dev *dev) +int +RTE_WEAK(hns3_rx_check_vec_support)(__rte_unused struct rte_eth_dev *dev) { return -ENOTSUP; } -uint16_t __rte_weak -hns3_recv_pkts_vec(__rte_unused void *rx_queue, +uint16_t +RTE_WEAK(hns3_recv_pkts_vec)(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) { return 0; } -uint16_t __rte_weak -hns3_recv_pkts_vec_sve(__rte_unused void *rx_queue, +uint16_t +RTE_WEAK(hns3_recv_pkts_vec_sve)(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) { @@ -4256,22 +4256,22 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) return nb_tx; } -int __rte_weak -hns3_tx_check_vec_support(__rte_unused struct rte_eth_dev *dev) +int +RTE_WEAK(hns3_tx_check_vec_support)(__rte_unused struct rte_eth_dev *dev) { return -ENOTSUP; } -uint16_t __rte_weak -hns3_xmit_pkts_vec(__rte_unused void *tx_queue, +uint16_t +RTE_WEAK(hns3_xmit_pkts_vec)(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts) { return 0; } -uint16_t __rte_weak -hns3_xmit_pkts_vec_sve(void __rte_unused * tx_queue, +uint16_t +RTE_WEAK(hns3_xmit_pkts_vec_sve)(void __rte_unused * tx_queue, struct rte_mbuf __rte_unused **tx_pkts, uint16_t __rte_unused nb_pkts) { diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c b/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c index 146ec21d51..d9959d7549 100644 --- a/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c +++ b/drivers/net/nfp/nfdk/nfp_nfdk_vec_stub.c @@ -5,8 +5,8 @@ #include "nfp_nfdk_vec.h" -uint16_t __rte_weak -nfp_net_nfdk_vec_avx2_xmit_pkts(__rte_unused void *tx_queue, +uint16_t +RTE_WEAK(nfp_net_nfdk_vec_avx2_xmit_pkts)(__rte_unused void *tx_queue, __rte_unused struct rte_mbuf **tx_pkts, __rte_unused uint16_t nb_pkts) { diff --git a/drivers/net/nfp/nfp_rxtx_vec_stub.c b/drivers/net/nfp/nfp_rxtx_vec_stub.c index c480f61ef0..66924212ad 100644 --- a/drivers/net/nfp/nfp_rxtx_vec_stub.c +++ b/drivers/net/nfp/nfp_rxtx_vec_stub.c @@ -10,14 +10,14 @@ #include "nfp_rxtx_vec.h" -bool __rte_weak -nfp_net_get_avx2_supported(void) +bool +RTE_WEAK(nfp_net_get_avx2_supported)(void) { return false; } -uint16_t __rte_weak -nfp_net_vec_avx2_recv_pkts(__rte_unused void *rx_queue, +uint16_t +RTE_WEAK(nfp_net_vec_avx2_recv_pkts)(__rte_unused void *rx_queue, __rte_unused struct rte_mbuf **rx_pkts, __rte_unused uint16_t nb_pkts) { diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index b67f063b31..170bae35c5 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -2045,16 +2045,16 @@ virtio_xmit_pkts_inorder(void *tx_queue, return nb_tx; } -__rte_weak uint16_t -virtio_recv_pkts_packed_vec(void *rx_queue __rte_unused, +uint16_t +RTE_WEAK(virtio_recv_pkts_packed_vec)(void *rx_queue __rte_unused, struct rte_mbuf **rx_pkts __rte_unused, uint16_t nb_pkts __rte_unused) { return 0; } -__rte_weak uint16_t -virtio_xmit_pkts_packed_vec(void *tx_queue __rte_unused, +uint16_t +RTE_WEAK(virtio_xmit_pkts_packed_vec)(void *tx_queue __rte_unused, struct rte_mbuf **tx_pkts __rte_unused, uint16_t nb_pkts __rte_unused) { diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c index 438256970d..9c0a2c77ce 100644 --- a/drivers/net/virtio/virtio_rxtx_simple.c +++ b/drivers/net/virtio/virtio_rxtx_simple.c @@ -48,8 +48,8 @@ virtio_rxq_vec_setup(struct virtnet_rx *rxq) } /* Stub for linkage when arch specific implementation is not available */ -__rte_weak uint16_t -virtio_recv_pkts_vec(void *rx_queue __rte_unused, +uint16_t +RTE_WEAK(virtio_recv_pkts_vec)(void *rx_queue __rte_unused, struct rte_mbuf **rx_pkts __rte_unused, uint16_t nb_pkts __rte_unused) { -- 2.47.0.vfs.0.3