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 85C3B606A31A for ; Wed, 2 Dec 2026 10:18:42 +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=M9Rbd+fq Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9045A402E1; Wed, 2 Dec 2026 11:18:40 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mails.dpdk.org (Postfix) with ESMTPS id 92F09402D5 for ; Wed, 2 Dec 2026 11:18:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796206719; x=1827742719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UQZjQUG+S5SgrtjzSs20KN4eWAnCXmDU+prDm6pGIsA=; b=M9Rbd+fqM6TA6hUyfjrJKJ8WOugQDS1a0nKV/Jy7q4Kq8OgdXAzo3lwr tkraKuwcKC0/e3VYs59c+MqwXzYcC/8e4QupQAdQ8aKIg8c5p1JmHdEEL HWru4M9VHNLrsXolhfJIhoERWgMleqD/axAP+ZNpsk6Pu5U0dhOCONDAm EZB0PfOxNdp+4gW+pP/oGa9FWiJB30Biw8la5SeY4/FEmZlhqX//UjvGR i1go8+TmBMESj6p1lrrXbE3FOghOwXglFLyE3u85UxmNPvzHFf8Qy+p7w 6ZvqpBooVuF2hJb3RQTn2BQ/Zw/zVCvDhOd7FnbQN5HN3IqkaFIZqbidI w==; X-CSE-ConnectionGUID: 4cidwwZoRT2CBQ28Rx5cGA== X-CSE-MsgGUID: CEBOe4XXTi+0iCsXFEBYZg== X-IronPort-AV: E=McAfee;i="6800,10657,11983"; a="5127299" X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="5127299" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Dec 2026 02:18:37 -0800 X-CSE-ConnectionGUID: JW9GDundR6KEdZSoU1vvSA== X-CSE-MsgGUID: l0TXEOdrRdeWyWM/THdDEA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,246,1787036400"; d="scan'208";a="13853506" Received: from silpixa00401385.ir.intel.com ([10.20.224.226]) by orviesa009.jf.intel.com with ESMTP; 02 Dec 2026 02:18:36 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v3 0/6] net/intel: eliminate unnecessary dynamic allocation Date: Wed, 2 Dec 2026 10:18:27 +0000 Message-ID: <20261202101833.2882373-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. v3: ensure no VLAs, by enforcing the size/count parameters to macros are compile-time constants. 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 | 50 ++++ 18 files changed, 310 insertions(+), 514 deletions(-) -- 2.55.0