From: Vikash Poddar <vikash.chandrax.poddar@intel.com>
To: Kai Ji <kai.ji@intel.com>
Cc: dev@dpdk.org, Vikash Poddar <vikash.chandrax.poddar@intel.com>,
stable@dpdk.org, arkadiuszx.kusztal@intel.com,
Ciara Power <ciara.power@intel.com>
Subject: [PATCH v7 1/3] common/qat: fix qat_dev_cmd_param corruption
Date: Fri, 16 Jun 2023 14:00:51 +0000 [thread overview]
Message-ID: <20230616140054.405194-1-vikash.chandrax.poddar@intel.com> (raw)
In-Reply-To: <20230529104529.2055773-1-vikash.chandrax.poddar@intel.com>
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: stable@dpdk.org
Cc: arkadiuszx.kusztal@intel.com
Signed-off-by: Vikash Poddar <vikash.chandrax.poddar@intel.com>
Acked-by: Ciara Power <ciara.power@intel.com>
---
v7:
"support to enable insecure algorithms" commit is dependent on
this patch
---
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 0479175b65..ac705e385e 100644
--- a/drivers/common/qat/qat_device.c
+++ b/drivers/common/qat/qat_device.c
@@ -367,7 +367,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 4188474dde..5691320040 100644
--- a/drivers/common/qat/qat_device.h
+++ b/drivers/common/qat/qat_device.h
@@ -38,7 +38,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.
next prev parent reply other threads:[~2023-06-16 14:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 9:58 [PATCH] crypto/qat: support to enable insecure algorithms Vikash Poddar
2023-05-23 9:14 ` [PATCH v2] " Vikash Poddar
2023-05-23 14:35 ` Ji, Kai
2023-05-25 7:56 ` [EXT] " Akhil Goyal
2023-05-25 16:10 ` [PATCH v3] " Vikash Poddar
2023-05-26 6:48 ` [PATCH v4] " Vikash Poddar
2023-05-29 6:32 ` [PATCH v5] " Vikash Poddar
2023-05-29 10:45 ` [PATCH v6] " Vikash Poddar
2023-06-08 13:14 ` Power, Ciara
2023-06-14 18:30 ` [EXT] " Akhil Goyal
2023-06-16 14:00 ` Vikash Poddar [this message]
2023-06-16 14:00 ` [PATCH v7 2/3] " Vikash Poddar
2023-06-16 14:00 ` [PATCH v7 3/3] test/crypto: skip asym test for " Vikash Poddar
2023-06-20 7:33 ` [EXT] [PATCH v7 1/3] common/qat: fix qat_dev_cmd_param corruption Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230616140054.405194-1-vikash.chandrax.poddar@intel.com \
--to=vikash.chandrax.poddar@intel.com \
--cc=arkadiuszx.kusztal@intel.com \
--cc=ciara.power@intel.com \
--cc=dev@dpdk.org \
--cc=kai.ji@intel.com \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).