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 11DF042B7D; Tue, 23 May 2023 11:07:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 951DC40EE5; Tue, 23 May 2023 11:07:07 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 50C6740A80 for ; Tue, 23 May 2023 11:07:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684832825; x=1716368825; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=fy1ZRCn+TWIknUJXqKXD6kgqQkKoZz7aup3fWDQWtls=; b=hMhPhoZ6ecsBAB8sRtCXWn5QXw+6H7ML3M+3inFrZ6oW0oz8eyWROWcq Z/8rYKein/LgzdtcsLt5OT5wjT/SHm+V4H/3SUvKeEkqHJTx8/INrbPqb /oqGt9tHbqayyC9riBQvGultlY1Do+h4D3gnWIQMivBpTE6pqsC8iNhkw de2C2SDJIucdr38M33pBfn1snBj0e9tMIcWSxJvgWYgwa2Rf310GT90Cv I50Q7h4QLZAvBV+gUYUMihFd9x93J9Dv7FFWzaighm5x2N+EMMIM1oUjr D8U/o0/TPsaIHlztZ/4nU0v59t2TXmuDd2lC5tUioTy0zjcFTGaZsg4/Q Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="439536505" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="439536505" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2023 02:07:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10718"; a="697982412" X-IronPort-AV: E=Sophos;i="6.00,185,1681196400"; d="scan'208";a="697982412" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com.) ([10.237.222.80]) by orsmga007.jf.intel.com with ESMTP; 23 May 2023 02:06:59 -0700 From: Vikash Poddar To: Kai Ji Cc: dev@dpdk.org, Vikash Poddar , arkadiuszx.kusztal@intel.com Subject: [PATCH v1] common/qat: fix qat_dev_cmd_param corruption Date: Tue, 23 May 2023 09:06:41 +0000 Message-Id: <20230523090641.1659274-1-vikash.chandrax.poddar@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 Adding fix to address the memory corruption issue for qat_dev_cmd_param structure on QAT GEN3. This fix aligns the storage where it stores the value on 4 byte unsigned integer data type after reading slice configuration of QAT capabilities. Fixes: b3cbbcdffa4f ("common/qat: read HW slice configuration") Cc: arkadiuszx.kusztal@intel.com Signed-off-by: Vikash Poddar --- drivers/common/qat/dev/qat_dev_gen1.c | 2 +- drivers/common/qat/dev/qat_dev_gen2.c | 2 +- drivers/common/qat/dev/qat_dev_gen3.c | 2 +- drivers/common/qat/dev/qat_dev_gen4.c | 2 +- drivers/common/qat/qat_device.c | 2 +- drivers/common/qat/qat_device.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/common/qat/dev/qat_dev_gen1.c b/drivers/common/qat/dev/qat_dev_gen1.c index cf480dcba8..dd2e878e90 100644 --- a/drivers/common/qat/dev/qat_dev_gen1.c +++ b/drivers/common/qat/dev/qat_dev_gen1.c @@ -242,7 +242,7 @@ qat_dev_get_extra_size_gen1(void) } static int -qat_get_dev_slice_map_gen1(uint16_t *map __rte_unused, +qat_get_dev_slice_map_gen1(uint32_t *map __rte_unused, const struct rte_pci_device *pci_dev __rte_unused) { return 0; diff --git a/drivers/common/qat/dev/qat_dev_gen2.c b/drivers/common/qat/dev/qat_dev_gen2.c index f51be46eb0..061dfdb698 100644 --- a/drivers/common/qat/dev/qat_dev_gen2.c +++ b/drivers/common/qat/dev/qat_dev_gen2.c @@ -22,7 +22,7 @@ static struct qat_qp_hw_spec_funcs qat_qp_hw_spec_gen2 = { }; static int -qat_dev_get_slice_map_gen2(uint16_t *map __rte_unused, +qat_dev_get_slice_map_gen2(uint32_t *map __rte_unused, const struct rte_pci_device *pci_dev __rte_unused) { return 0; diff --git a/drivers/common/qat/dev/qat_dev_gen3.c b/drivers/common/qat/dev/qat_dev_gen3.c index e4197f3c0f..f01b98ff86 100644 --- a/drivers/common/qat/dev/qat_dev_gen3.c +++ b/drivers/common/qat/dev/qat_dev_gen3.c @@ -68,7 +68,7 @@ static struct qat_qp_hw_spec_funcs qat_qp_hw_spec_gen3 = { }; static int -qat_dev_get_slice_map_gen3(uint16_t *map, +qat_dev_get_slice_map_gen3(uint32_t *map, const struct rte_pci_device *pci_dev) { if (rte_pci_read_config(pci_dev, map, diff --git a/drivers/common/qat/dev/qat_dev_gen4.c b/drivers/common/qat/dev/qat_dev_gen4.c index 1b3a5deabf..1ce262f715 100644 --- a/drivers/common/qat/dev/qat_dev_gen4.c +++ b/drivers/common/qat/dev/qat_dev_gen4.c @@ -283,7 +283,7 @@ qat_dev_get_misc_bar_gen4(struct rte_mem_resource **mem_resource, } static int -qat_dev_get_slice_map_gen4(uint16_t *map __rte_unused, +qat_dev_get_slice_map_gen4(uint32_t *map __rte_unused, const struct rte_pci_device *pci_dev __rte_unused) { return 0; diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index 8bce2ac073..ed75b66041 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -361,7 +361,7 @@ static int qat_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, { int sym_ret = 0, asym_ret = 0, comp_ret = 0; int num_pmds_created = 0; - uint16_t capa = 0; + uint32_t capa = 0; struct qat_pci_device *qat_pci_dev; struct qat_dev_hw_spec_funcs *ops_hw; struct qat_dev_cmd_param qat_dev_cmd_param[] = { diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h index bc3da04238..4a79cdded3 100644 --- a/drivers/common/qat/qat_device.h +++ b/drivers/common/qat/qat_device.h @@ -37,7 +37,7 @@ typedef int (*qat_dev_get_misc_bar_t) typedef int (*qat_dev_read_config_t) (struct qat_pci_device *); typedef int (*qat_dev_get_extra_size_t)(void); -typedef int (*qat_dev_get_slice_map_t)(uint16_t *map, +typedef int (*qat_dev_get_slice_map_t)(uint32_t *map, const struct rte_pci_device *pci_dev); struct qat_dev_hw_spec_funcs { -- 2.25.1 -------------------------------------------------------------- Intel Research and Development Ireland Limited Registered in Ireland Registered Office: Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.