From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 4BB9DC55A for ; Mon, 27 Jul 2015 10:43:15 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 27 Jul 2015 01:43:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,552,1432623600"; d="scan'208";a="770335393" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 27 Jul 2015 01:43:14 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t6R8hCxo023360; Mon, 27 Jul 2015 16:43:12 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t6R8h8aX031129; Mon, 27 Jul 2015 16:43:10 +0800 Received: (from xiaowan1@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t6R8h8we031125; Mon, 27 Jul 2015 16:43:08 +0800 From: Wang Xiao W To: dev@dpdk.org Date: Mon, 27 Jul 2015 16:42:35 +0800 Message-Id: <1437986559-31016-12-git-send-email-xiao.w.wang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1437986559-31016-1-git-send-email-xiao.w.wang@intel.com> References: <1437986559-31016-1-git-send-email-xiao.w.wang@intel.com> Cc: Wang Xiao W Subject: [dpdk-dev] [PATCH 12/16] fm10k: pack TLV overlay structures correctly X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2015 08:43:15 -0000 This patch adds #pragma pack(push, 1) around some structures which are passed via TLV messages. These structures must not be left unpacked as GCC and other compilers are wont to do. Otherwise, we get invalid message responses from the Switch Manager software since it sends 20 bytes and we expect 24. Signed-off-by: Wang Xiao W --- drivers/net/fm10k/base/fm10k_pf.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/fm10k/base/fm10k_pf.h b/drivers/net/fm10k/base/fm10k_pf.h index 5a40d5b..b7a1758 100644 --- a/drivers/net/fm10k/base/fm10k_pf.h +++ b/drivers/net/fm10k/base/fm10k_pf.h @@ -90,6 +90,12 @@ enum fm10k_pf_tlv_attr_id_v1 { #define FM10K_MSG_UPDATE_PVID_PVID_SHIFT 16 #define FM10K_MSG_UPDATE_PVID_PVID_SIZE 16 +/* The following data structures are overlayed specifically to TLV mailbox + * messages, and must not have gaps between their values. They must line up + * correctly to the TLV definition. + */ +#pragma pack(push, 1) + struct fm10k_mac_update { __le32 mac_lower; __le16 mac_upper; @@ -124,6 +130,8 @@ struct fm10k_swapi_tx_timestamp_mode { __le32 status; }; +#pragma pack(pop) + #define FM10K_PF_MSG_LPORT_CREATE_HANDLER(func) \ FM10K_MSG_HANDLER(FM10K_PF_MSG_ID_LPORT_CREATE, NULL, func) #define FM10K_PF_MSG_LPORT_DELETE_HANDLER(func) \ -- 1.9.3