> -----Original Message----- > From: Andre Muezerie <andremue@ linux. microsoft. com> > Sent: Friday, April 4, 2025 7: 18 AM > To: Nithin Kumar Dabilpuram <ndabilpuram@ marvell. com>; Kiran Kumar > Kokkilagadda <kirankumark@ marvell. com>;
ZjQcmQRYFpfptBannerStart
Prioritize security for external emails:
Confirm sender and content safety before clicking links or opening attachments
ZjQcmQRYFpfptBannerEnd
> -----Original Message-----
> From: Andre Muezerie <andremue@linux.microsoft.com>
> Sent: Friday, April 4, 2025 7:18 AM
> To: Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>; Kiran Kumar
> Kokkilagadda <kirankumark@marvell.com>; Sunil Kumar Kori
> <skori@marvell.com>; Satha Koteswara Rao Kottidi
> <skoteshwar@marvell.com>; Harman Kalra <hkalra@marvell.com>
> Cc: dev@dpdk.org; Andre Muezerie <andremue@linux.microsoft.com>
> Subject: [EXTERNAL] [PATCH] drivers: remove __rte_used from functions for
> compatibility with MSVC
>
> With gcc, the macro __rte_used translates to __attribute__((used)). MSVC has
> something to the same effect, but harder to use and with some limitations (one
> being that it cannot be used with "static"). Therefore, it makes sense to avoid
> __rte_used ZjQcmQRYFpfptBannerStart Prioritize security for external emails:
> Confirm sender and content safety before clicking links or opening attachments
> <https://us-phishalarm-
> ewt.proofpoint.com/EWT/v1/CRVmXkqW!t83ZtR_UwpW61E99mn37ThGThaB6
> gt7spCdfZvP9Yz5DLa-AKWhfbPLLmgyDnTM_FczAEE3KDso8-
> QC5MEstA0f8Xb8gLd9dJN3BVWrFMpv9DT2-yl2l$>
> Report Suspicious
>
> ZjQcmQRYFpfptBannerEnd
> With gcc, the macro __rte_used translates to __attribute__((used)).
> MSVC has something to the same effect, but harder to use and with some
> limitations (one being that it cannot be used with "static"). Therefore, it makes
> sense to avoid __rte_used in some cases.
>
> The functions modified in this patch don't really need to use __rte_used.
> Instead, these functions can be involved in same ifdefs used in the callers. That
> way, they are only defined when needed (when someone is actually calling the
> function). Doing so makes the code compatible with MSVC and avoids compiler
> warnings about functions being defined but not used.
>
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
> drivers/net/cnxk/cn10k_rx_select.c | 6 +++++-
> drivers/net/cnxk/cn10k_tx_select.c | 6 ++++--
> drivers/net/cnxk/cn20k_rx_select.c | 6 +++++-
> drivers/net/cnxk/cn20k_tx_select.c | 6 ++++--
> drivers/net/cnxk/cn9k_rx_select.c | 6 ++++--
> drivers/net/cnxk/cn9k_tx_select.c | 6 ++++--
> 6 files changed, 26 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/cnxk/cn10k_rx_select.c
> b/drivers/net/cnxk/cn10k_rx_select.c
> index fe1f0dda73..658a434d75 100644
> --- a/drivers/net/cnxk/cn10k_rx_select.c
> +++ b/drivers/net/cnxk/cn10k_rx_select.c
> @@ -5,7 +5,9 @@
> #include "cn10k_ethdev.h"
> #include "cn10k_rx.h"
>
> -static __rte_used void
> +#if defined(RTE_ARCH_ARM64)
> +#if !defined(CNXK_DIS_TMPLT_FUNC)
Please change to #if defined(RTE_ARCH_ARM64) && !defined(CNXK_DIS_TMPLT_FUNC)