DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Andre Muezerie <andremue@linux.microsoft.com>
Cc: dev@dpdk.org, hkalra@marvell.com, kirankumark@marvell.com,
	 ndabilpuram@marvell.com, skori@marvell.com,
	skoteshwar@marvell.com
Subject: Re: [PATCH v3] drivers: remove __rte_used from functions for compatibility with MSVC
Date: Thu, 29 May 2025 11:23:51 +0530	[thread overview]
Message-ID: <CALBAE1N2ViBw0-3qc2Cga2owLFCZbYssT0khuVfKxfRCnwVRxw@mail.gmail.com> (raw)
In-Reply-To: <1748438571-20477-1-git-send-email-andremue@linux.microsoft.com>

On Thu, May 29, 2025 at 5:42 AM Andre Muezerie
<andremue@linux.microsoft.com> wrote:
>
> 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>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Updated the git commit as follows and applied to
dpdk-next-net-mrvl/for-main. Thanks


    net/cnxk: improve MSVC compatibility

    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>
    Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

      reply	other threads:[~2025-05-29  5:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04  1:47 [PATCH] " Andre Muezerie
2025-05-27  5:02 ` [EXTERNAL] " Jerin Jacob
2025-05-27  7:02   ` Pavan Nikhilesh Bhagavatula
2025-05-27 19:49 ` [PATCH v2] " Andre Muezerie
2025-05-28  6:27   ` Jerin Jacob
2025-05-28 13:22 ` [PATCH v3] " Andre Muezerie
2025-05-29  5:53   ` Jerin Jacob [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=CALBAE1N2ViBw0-3qc2Cga2owLFCZbYssT0khuVfKxfRCnwVRxw@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=andremue@linux.microsoft.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.com \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.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).