DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Andre Muezerie" <andremue@linux.microsoft.com>,
	"David Marchand" <david.marchand@redhat.com>,
	<thomas@monjalon.net>
Cc: <dev@dpdk.org>, "Stephen Hemminger" <stephen@networkplumber.org>
Subject: RE: [PATCH v6 1/1] net/intel: define __builtin_add_overflow for MSVC
Date: Thu, 5 Jun 2025 16:57:24 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9FCCB@smartserver.smartshare.dk> (raw)
In-Reply-To: <1749134845-30062-2-git-send-email-andremue@linux.microsoft.com>

+TO: David and Thomas, were part of the discussion
+CC: Stephen

> From: Andre Muezerie [mailto:andremue@linux.microsoft.com]
> Sent: Thursday, 5 June 2025 16.47
> 
> __builtin_add_overflow is gcc specific. A macro needs to be defined
> for code using this to be compiled with MSVC.
> Since only one driver is using this, this patch adds the macro to
> that driver only. It can be moved to some common place if/when
> needed.

This seems to be consensus over adding it to rte_math.h, so:
Acked-by: Morten Brørup <mb@smartsharesystems.com>

> 
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
>  drivers/net/intel/ice/base/ice_osdep.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/net/intel/ice/base/ice_osdep.h
> b/drivers/net/intel/ice/base/ice_osdep.h
> index ad6cde9896..4f635f00a4 100644
> --- a/drivers/net/intel/ice/base/ice_osdep.h
> +++ b/drivers/net/intel/ice/base/ice_osdep.h
> @@ -128,6 +128,15 @@ writeq(uint64_t value, volatile void *addr)
>  #define wr64(a, reg, value) writeq((value), (a)->hw_addr + (reg))
>  #define rd64(a, reg)        readq((a)->hw_addr + (reg))
> 
> +#ifdef RTE_TOOLCHAIN_MSVC
> +#define __builtin_add_overflow(a, b, res) \
> +	_Generic((a), \
> +		uint8_t : _addcarry_u8, \
> +		uint16_t : _addcarry_u16, \
> +		uint32_t : _addcarry_u32, \
> +		uint64_t : _addcarry_u64)(0, a, b, res)
> +#endif
> +
>  #endif /* __INTEL_NET_BASE_OSDEP__ */
> 
>  #ifndef __always_unused
> --
> 2.49.0.vfs.0.3


      reply	other threads:[~2025-06-05 14:57 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02 22:32 [PATCH 0/5] add portable version of __builtin_add_overflow Andre Muezerie
2025-01-02 22:32 ` [PATCH 1/5] maintainers: " Andre Muezerie
2025-01-02 22:32 ` [PATCH 2/5] lib/eal: " Andre Muezerie
2025-01-03  8:19   ` Morten Brørup
2025-01-03 20:38     ` Andre Muezerie
2025-01-02 22:32 ` [PATCH 3/5] doc/api: " Andre Muezerie
2025-01-02 22:32 ` [PATCH 4/5] drivers/net: use " Andre Muezerie
2025-01-02 22:32 ` [PATCH 5/5] app/test: add tests for portable versions " Andre Muezerie
2025-01-02 23:51 ` [PATCH 0/5] add portable version " Stephen Hemminger
2025-01-03  0:15   ` Andre Muezerie
2025-01-03  0:41     ` Andre Muezerie
2025-01-03 20:39 ` [PATCH v2 " Andre Muezerie
2025-01-03 20:39   ` [PATCH v2 1/5] maintainers: " Andre Muezerie
2025-01-03 20:39   ` [PATCH v2 2/5] lib/eal: " Andre Muezerie
2025-01-06 11:07     ` Bruce Richardson
2025-01-06 11:21       ` Morten Brørup
2025-01-06 11:34         ` Bruce Richardson
2025-01-06 11:58           ` Morten Brørup
2025-03-05 15:46             ` Andre Muezerie
2025-01-03 20:39   ` [PATCH v2 3/5] doc/api: " Andre Muezerie
2025-01-03 20:39   ` [PATCH v2 4/5] drivers/net: use " Andre Muezerie
2025-01-03 20:39   ` [PATCH v2 5/5] app/test: add tests for " Andre Muezerie
2025-03-05 16:38 ` [PATCH v3 0/5] add " Andre Muezerie
2025-03-05 16:38   ` [PATCH v3 1/5] maintainers: " Andre Muezerie
2025-03-05 16:38   ` [PATCH v3 2/5] eal: " Andre Muezerie
2025-03-05 16:38   ` [PATCH v3 3/5] doc/api: " Andre Muezerie
2025-03-05 16:38   ` [PATCH v3 4/5] net/intel: use " Andre Muezerie
2025-03-05 16:52     ` Bruce Richardson
2025-03-11 18:39       ` Andre Muezerie
2025-03-05 16:38   ` [PATCH v3 5/5] app/test: add tests for " Andre Muezerie
2025-03-06  3:00     ` Patrick Robb
2025-03-13 20:00 ` [PATCH v4 0/5] add " Andre Muezerie
2025-03-13 20:00   ` [PATCH v4 1/5] maintainers: " Andre Muezerie
2025-03-14  8:39     ` Bruce Richardson
2025-03-13 20:00   ` [PATCH v4 2/5] eal: " Andre Muezerie
2025-03-13 20:00   ` [PATCH v4 3/5] doc/api: " Andre Muezerie
2025-03-14  8:40     ` Bruce Richardson
2025-03-13 20:00   ` [PATCH v4 4/5] net/intel: use " Andre Muezerie
2025-03-13 20:00   ` [PATCH v4 5/5] app/test: add tests for " Andre Muezerie
2025-03-14 14:33 ` [PATCH v5 0/3] add " Andre Muezerie
2025-03-14 14:33   ` [PATCH v5 1/3] eal: " Andre Muezerie
2025-03-14 14:33   ` [PATCH v5 2/3] net/intel: use " Andre Muezerie
2025-03-14 14:46     ` Bruce Richardson
2025-03-14 14:33   ` [PATCH v5 3/3] app/test: add tests for " Andre Muezerie
2025-06-04 10:08   ` [PATCH v5 0/3] add " David Marchand
2025-06-04 10:29     ` Morten Brørup
2025-06-04 10:41       ` David Marchand
2025-06-04 11:04         ` Morten Brørup
2025-06-04 11:39           ` Thomas Monjalon
2025-06-05 14:47 ` [PATCH v6 0/1] define __builtin_add_overflow for MSVC Andre Muezerie
2025-06-05 14:47   ` [PATCH v6 1/1] net/intel: " Andre Muezerie
2025-06-05 14:57     ` Morten Brørup [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=98CBD80474FA8B44BF855DF32C47DC35E9FCCB@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=andremue@linux.microsoft.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).