DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 1/6] eal: add macros for local variable-length structure buffers
Date: Tue, 1 Dec 2026 11:37:56 -0800	[thread overview]
Message-ID: <20261201113756.7b6d2613@phoenix.local> (raw)
In-Reply-To: <20261201182249.2520829-2-bruce.richardson@intel.com>

On Tue,  1 Dec 2026 18:22:44 +0000
Bruce Richardson <bruce.richardson@intel.com> wrote:

> + */
> +#define RTE_DEFINE_FLEX_BYTES(type, name, size) \
> +	static_assert((size) >= sizeof(type), "buffer smaller than " RTE_STR(type)); \
> +	union { \
> +		uint8_t raw[size]; /* first member, so "{0}" zeroes the whole buffer */ \
> +		type obj; \
> +	} name ## _u = {0}; \
> +	type * const name = &name ## _u.obj
> +

Agree with Martin no VLA.

  parent reply	other threads:[~2026-12-01 19:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:09 [PATCH 27.03 0/6] eliminate unnecessary dynamic allocation Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 1/6] eal: add macros for local variable-length structure buffers Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 2/6] net/iavf: use stack storage for virtchnl messages Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 3/6] net/ice: use stack storage for function-local buffers Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 4/6] net/idpf: use stack storage for virtchnl messages Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 5/6] net/cpfl: use stack storage for function-local buffers Bruce Richardson
2026-11-16 16:09 ` [PATCH 27.03 6/6] net/i40e: " Bruce Richardson
2026-12-01 18:22 ` [PATCH v2 0/6] eliminate unnecessary dynamic allocation Bruce Richardson
2026-12-01 18:22   ` [PATCH v2 1/6] eal: add macros for local variable-length structure buffers Bruce Richardson
2026-12-01 19:29     ` Morten Brørup
2026-12-01 19:36       ` Stephen Hemminger
2026-12-01 19:37     ` Stephen Hemminger [this message]
2026-12-01 18:22   ` [PATCH v2 2/6] net/iavf: use stack storage for virtchnl messages Bruce Richardson
2026-12-01 18:22   ` [PATCH v2 3/6] net/ice: use stack storage for function-local buffers Bruce Richardson
2026-12-01 18:22   ` [PATCH v2 4/6] net/idpf: use stack storage for virtchnl messages Bruce Richardson
2026-12-01 18:22   ` [PATCH v2 5/6] net/cpfl: use stack storage for function-local buffers Bruce Richardson
2026-12-01 18:22   ` [PATCH v2 6/6] net/i40e: " Bruce Richardson

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=20261201113756.7b6d2613@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    /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