DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 27.03 0/6] eliminate unnecessary dynamic allocation
@ 2026-11-16 16:09 Bruce Richardson
  2026-11-16 16:09 ` [PATCH 27.03 1/6] eal: add macros for local variable-length structure buffers Bruce Richardson
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bruce Richardson @ 2026-11-16 16:09 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-16 16:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox