DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 27.03 0/6] eliminate unnecessary dynamic allocation
Date: Mon, 16 Nov 2026 16:09:26 +0000	[thread overview]
Message-ID: <20261116160932.1006354-1-bruce.richardson@intel.com> (raw)

To reduce the possibility of bugs due to missing memory freeing on error
paths (or even the success path) in functions, we can switch memory use
from dynamic heap memory to stack memory in functions where both
allocation and free occur within the one function, and where the total
memory size is not very large (~4K max).

To facilitate this, the first patch of the series defines a new macro to
simplify the creation of stack objects which are of the format
struct+extra buffer, where the extra buffer space is sized to hold N
objects from a flex array member at the end of the primary structure.
That macro is then used throughout the drivers to define most of the new
stack variables used for e.g. admin queue messages.

Bruce Richardson (6):
  eal: add macros for local variable-length structure buffers
  net/iavf: use stack storage for virtchnl messages
  net/ice: use stack storage for function-local buffers
  net/idpf: use stack storage for virtchnl messages
  net/cpfl: use stack storage for function-local buffers
  net/i40e: use stack storage for function-local buffers

 app/test/test_common.c                        |  54 ++++
 drivers/net/intel/cpfl/cpfl_fxp_rule.c        |  20 +-
 drivers/net/intel/cpfl/cpfl_representor.c     |  15 +-
 drivers/net/intel/cpfl/cpfl_vchnl.c           |  41 ++-
 drivers/net/intel/i40e/i40e_ethdev.c          |  27 +-
 drivers/net/intel/i40e/i40e_testpmd.c         |  10 +-
 drivers/net/intel/iavf/iavf_ipsec_crypto.c    | 270 +++++-------------
 drivers/net/intel/iavf/iavf_tm.c              |  26 +-
 drivers/net/intel/ice/ice_dcf.c               |  21 +-
 drivers/net/intel/ice/ice_dcf_parent.c        |  12 +-
 drivers/net/intel/ice/ice_dcf_sched.c         |  25 +-
 drivers/net/intel/ice/ice_diagnose.c          |  12 +-
 drivers/net/intel/ice/ice_ethdev.c            | 104 ++-----
 drivers/net/intel/ice/ice_rxtx.c              |  26 +-
 drivers/net/intel/ice/ice_tm.c                |   7 +-
 drivers/net/intel/idpf/idpf_common_device.c   |  27 +-
 drivers/net/intel/idpf/idpf_common_virtchnl.c |  77 ++---
 lib/eal/include/rte_common.h                  |  46 +++
 18 files changed, 306 insertions(+), 514 deletions(-)

--
2.55.0


             reply	other threads:[~2026-11-16 16:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 16:09 Bruce Richardson [this message]
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

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=20261116160932.1006354-1-bruce.richardson@intel.com \
    --to=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