From: Andre Muezerie <andremue@linux.microsoft.com>
To: John Daley <johndale@cisco.com>,
Hyong Youb Kim <hyonkim@cisco.com>, Jie Hai <haijie1@huawei.com>,
Chaoyong He <chaoyong.he@corigine.com>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbox@nvidia.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 5/5] drivers/net: use portable macro for weak linking
Date: Mon, 23 Dec 2024 19:05:52 -0800 [thread overview]
Message-ID: <1735009552-31906-6-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1735009552-31906-1-git-send-email-andremue@linux.microsoft.com>
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 <andremue@linux.microsoft.com>
---
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
prev parent reply other threads:[~2024-12-24 3:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-24 3:05 [PATCH 0/5] " Andre Muezerie
2024-12-24 3:05 ` [PATCH 1/5] lib/eal: add " Andre Muezerie
2024-12-24 3:05 ` [PATCH 2/5] app/test-compress-perf: use " Andre Muezerie
2024-12-24 3:05 ` [PATCH 3/5] drivers/bus: " Andre Muezerie
2024-12-24 3:05 ` [PATCH 4/5] drivers/common: " Andre Muezerie
2024-12-24 3:05 ` Andre Muezerie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1735009552-31906-6-git-send-email-andremue@linux.microsoft.com \
--to=andremue@linux.microsoft.com \
--cc=chaoyong.he@corigine.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=haijie1@huawei.com \
--cc=hyonkim@cisco.com \
--cc=johndale@cisco.com \
--cc=maxime.coquelin@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).