From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43025440F2; Tue, 28 May 2024 10:17:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD73240A8B; Tue, 28 May 2024 10:17:30 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by mails.dpdk.org (Postfix) with ESMTP id 7B09E406A2 for ; Tue, 28 May 2024 10:17:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716884248; x=1748420248; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WJPvdCTRvRa4kQA3QuVNRFY6GY2E7hlcu7PFiRVWYes=; b=IRV8tFK33aVat8rh8slQ6lm2vXdOg6TXu2UTpdcTJoOA/s6bBRexxzkC hGvaTa4p8VpkngyrdZorUwH2dC8dImm2qydAMJPR/QN/yE3bjwAwRchdz c2Lo9r8nkbXWLV7p5zcmHie9bzuOalMC1nbKOwmnqyRSAia/zYZNZJrKq SAfeXQA9bOpHmbRwccZdmUTnwYxzoEknqINNWFaxSCdi37wscovTKQtna krcpay3FMcf4iaTQgqJrM/hrMHAbTm/qwo4QjAkEaMx4sADNsj4MgRlYT zZoUZU04JsXCPzCwU4rxfTNw0uAvb49Otv3AjG/B+u8AwLQBqXxJyAAUm Q==; X-CSE-ConnectionGUID: 6HH1AV8NRLmKDOXQVADMsg== X-CSE-MsgGUID: GICpBQrHRg63ELXDLY5r/g== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="35728408" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="35728408" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 01:17:28 -0700 X-CSE-ConnectionGUID: /1vbx2KjRhGf+aYewXVNPw== X-CSE-MsgGUID: MiYuf9JrRQmoqr7oIcT/Ug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="34976571" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa008.fm.intel.com with ESMTP; 28 May 2024 01:17:26 -0700 From: Soumyadeep Hore To: jingjing.wu@intel.com Cc: dev@dpdk.org Subject: [PATCH 14/25] common/idpf: avoid compiler padding Date: Tue, 28 May 2024 07:35:54 +0000 Message-ID: <20240528073559.867121-5-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528073559.867121-1-soumyadeep.hore@intel.com> References: <20240528073559.867121-1-soumyadeep.hore@intel.com> 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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org In the arm random config file, kconfig option 'CONFIG_AEABI' is disabled which results in adding the compiler flag '-mabi=apcs-gnu'. This causes the compiler to add padding in virtchnl2_ptype structure to align it to 8 bytes, resulting in size check failure. Avoid the compiler padding by using "__packed" structure attribute for the virtchnl2_ptype struct. Also align the structure by using "__aligned(2)" for better code optimization. Signed-off-by: Soumyadeep Hore --- drivers/common/idpf/base/virtchnl2.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/common/idpf/base/virtchnl2.h b/drivers/common/idpf/base/virtchnl2.h index 95fca647b1..aadb2aafff 100644 --- a/drivers/common/idpf/base/virtchnl2.h +++ b/drivers/common/idpf/base/virtchnl2.h @@ -1454,7 +1454,11 @@ struct virtchnl2_ptype { u8 proto_id_count; __le16 pad; __le16 proto_id[STRUCT_VAR_LEN]; +#ifdef FLEX_ARRAY_SUPPORT +} __packed __aligned(2); +#else }; +#endif /* FLEX_ARRAY_SUPPORT */ VIRTCHNL2_CHECK_STRUCT_VAR_LEN(8, virtchnl2_ptype, proto_id); /** -- 2.43.0