From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18DF4606A31A for ; Tue, 1 Dec 2026 18:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=WexY8G3Z Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E0BA402BD; Tue, 1 Dec 2026 19:23:01 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by mails.dpdk.org (Postfix) with ESMTPS id AC1BC4027A for ; Tue, 1 Dec 2026 19:22:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796149375; x=1827685375; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4MER+1kbkbZyb3EQtQ1XkevwCkK8UBHmU+oqBeOl69M=; b=WexY8G3ZUCLAXvJVtRRvWpD7o5HTtfozT45kRrp5XoPe7C9LTpUb7aME cqvIMEArrWCaN+QdO1J2qXXrtPwt3ZWxPuxOh2d0NMQ/YVxTCMQkJKJRg yEBlVlWMJlLp20mdKSMevyu/b8LqAzKltra7MPy4Boo2d/DgrowtaaDnN oPNnHLT86mlxGdZiIJC7kBYm7BM0drX3gw5KL3TGL5hncoeOo3dMspjTJ xsFbKKPuU5kg3oY0PdX9FnlJyZ9SMmIZSwXD1I46CYaaa1DQ8imbpAn2u 8Qy4Xta72QiB0nMQ97ek2kGD6sp8JEYwDVlFwV5qNac4AqtaYXhNVsJws g==; X-CSE-ConnectionGUID: jvk6OSvATsGSsOvxkFh40w== X-CSE-MsgGUID: +zn7mcofS/KJNiNGqSUBdw== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5041128" X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="5041128" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2026 10:22:53 -0800 X-CSE-ConnectionGUID: Ej4c3PU7T9W48lPSUV6IJQ== X-CSE-MsgGUID: AZ6iQ6bsSXS3hbLloxbZmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,245,1787036400"; d="scan'208";a="13174998" Received: from silpixa00401385.ir.intel.com ([10.20.224.226]) by orviesa003.jf.intel.com with ESMTP; 01 Dec 2026 10:22:51 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 0/6] eliminate unnecessary dynamic allocation Date: Tue, 1 Dec 2026 18:22:43 +0000 Message-ID: <20261201182249.2520829-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261116160932.1006354-1-bruce.richardson@intel.com> References: <20261116160932.1006354-1-bruce.richardson@intel.com> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. v2: * rebased on 26.11 release. 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