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 BD5DE440F2; Tue, 28 May 2024 10:10:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5990640698; Tue, 28 May 2024 10:10:36 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) by mails.dpdk.org (Postfix) with ESMTP id F0F5240698 for ; Tue, 28 May 2024 10:10:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716883835; x=1748419835; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wmna8OBZn1z2YOkGZPmIOprO5l0lCZDRqOcgzzaWmN8=; b=l8Kh1SRlCBipyPkYnn6LUOBYzXE5/uWYr/FXGzdODVhcPeGqrRJ2ts4t MYhyXYe4USJqhgZf4/KIjjbjkU+iayjCPC/e7SxPuuPSDIXI9BqhexsNB HWE9gYsGx5ac5sTnXB0SW+GZa8YTUuCQfcvKwaE2e/PXDgcZLr8yIgyK3 25tiqM+pIKWpGX4RK7zHUSFQy61o2csKPFG5fXkS3WMJrLj7vNa6rYDz5 hV0M7E4DZSqtsUG03/Y6dxDco5XB0WvT8GkMLLukMsll6GlVl/6AqOnqC ZmSO8GrFxtJ+KUQ3cqYIAR9ekrd0SHS7MJZk5eTSfOqh6YGng0NAVLNc6 g==; X-CSE-ConnectionGUID: 9vj/dKmFQnat+C72QNRORg== X-CSE-MsgGUID: tVgsYzBUQvur5ZVxUxcSFg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="16161922" X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="16161922" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 May 2024 01:10:34 -0700 X-CSE-ConnectionGUID: 2Muj+pQ0Qde1wVHQ8Sgfug== X-CSE-MsgGUID: gtbhU+toTMeR8Rlv5pM4sA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,194,1712646000"; d="scan'208";a="66197677" Received: from unknown (HELO npf-hyd-clx-03..) ([10.145.170.182]) by fmviesa001.fm.intel.com with ESMTP; 28 May 2024 01:10:33 -0700 From: Soumyadeep Hore To: yuying.zhang@intel.com, jingjing.wu@intel.com Cc: dev@dpdk.org Subject: [PATCH 03/25] common/idpf: update ADD QUEUE GROUPS offset Date: Tue, 28 May 2024 07:28:33 +0000 Message-ID: <20240528072839.867100-4-soumyadeep.hore@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240528072839.867100-1-soumyadeep.hore@intel.com> References: <20240528072839.867100-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 Some compilers will use 64-bit addressing and compiler will detect such loss of data virtchnl2.h(1890,40): warning C4244: '=': conversion from '__int64' to '__le32', possible loss of data on line 1890 offset = (u8 *)(&groups->groups[0]) - (u8 *)groups; Removed unnecessary zero init Signed-off-by: Soumyadeep Hore --- drivers/common/idpf/base/virtchnl2.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/common/idpf/base/virtchnl2.h b/drivers/common/idpf/base/virtchnl2.h index 3900b784d0..f44c0965b4 100644 --- a/drivers/common/idpf/base/virtchnl2.h +++ b/drivers/common/idpf/base/virtchnl2.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2001-2023 Intel Corporation + * Copyright(c) 2001-2024 Intel Corporation */ #ifndef _VIRTCHNL2_H_ @@ -47,9 +47,9 @@ * that is never used. */ #define VIRTCHNL2_CHECK_STRUCT_LEN(n, X) enum virtchnl2_static_assert_enum_##X \ - { virtchnl2_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } + { virtchnl2_static_assert_##X = (n)/((sizeof(struct X) == (n)) ? 1 : 0) } #define VIRTCHNL2_CHECK_UNION_LEN(n, X) enum virtchnl2_static_asset_enum_##X \ - { virtchnl2_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) } + { virtchnl2_static_assert_##X = (n)/((sizeof(union X) == (n)) ? 1 : 0) } /* New major set of opcodes introduced and so leaving room for * old misc opcodes to be added in future. Also these opcodes may only @@ -471,8 +471,8 @@ * error regardless of version mismatch. */ struct virtchnl2_version_info { - u32 major; - u32 minor; + u32 major; + u32 minor; }; VIRTCHNL2_CHECK_STRUCT_LEN(8, virtchnl2_version_info); @@ -1414,9 +1414,9 @@ VIRTCHNL2_CHECK_STRUCT_LEN(16, virtchnl2_mac_addr_list); * and returns the status. */ struct virtchnl2_promisc_info { - __le32 vport_id; + __le32 vport_id; /* see VIRTCHNL2_PROMISC_FLAGS definitions */ - __le16 flags; + __le16 flags; u8 pad[2]; }; @@ -1733,7 +1733,8 @@ virtchnl2_vc_validate_vf_msg(__rte_unused struct virtchnl2_version_info *ver, u3 case VIRTCHNL2_OP_ADD_QUEUE_GROUPS: valid_len = sizeof(struct virtchnl2_add_queue_groups); if (msglen != valid_len) { - __le32 i = 0, offset = 0; + __le64 offset; + __le32 i; struct virtchnl2_add_queue_groups *add_queue_grp = (struct virtchnl2_add_queue_groups *)msg; struct virtchnl2_queue_groups *groups = &(add_queue_grp->qg_info); @@ -1904,8 +1905,8 @@ virtchnl2_vc_validate_vf_msg(__rte_unused struct virtchnl2_version_info *ver, u3 /* These are always errors coming from the VF. */ case VIRTCHNL2_OP_EVENT: case VIRTCHNL2_OP_UNKNOWN: - default: - return VIRTCHNL2_STATUS_ERR_ESRCH; + default: + return VIRTCHNL2_STATUS_ERR_ESRCH; } /* few more checks */ if (err_msg_format || valid_len != msglen) -- 2.43.0