* [dpdk-stable] [PATCH] compress/isal: fix getting information about CPU
@ 2019-03-07 11:07 Tomasz Cel
2019-03-28 12:24 ` Trahe, Fiona
0 siblings, 1 reply; 3+ messages in thread
From: Tomasz Cel @ 2019-03-07 11:07 UTC (permalink / raw)
To: stable, fiona.trahe, lee.daly
This patch adds query about CPU features
Fixes: 53a9baa98c36 ("compress/isal: add basic PMD ops")
Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
---
drivers/compress/isal/isal_compress_pmd_ops.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c
index 7b91849..fe99959 100644
--- a/drivers/compress/isal/isal_compress_pmd_ops.c
+++ b/drivers/compress/isal/isal_compress_pmd_ops.c
@@ -135,10 +135,18 @@ isal_comp_pmd_info_get(struct rte_compressdev *dev __rte_unused,
{
if (dev_info != NULL) {
dev_info->capabilities = isal_pmd_capabilities;
- dev_info->feature_flags = RTE_COMPDEV_FF_CPU_AVX512 |
- RTE_COMPDEV_FF_CPU_AVX2 |
- RTE_COMPDEV_FF_CPU_AVX |
- RTE_COMPDEV_FF_CPU_SSE;
+
+ /* Check CPU for supported vector instruction and set
+ * feature_flags
+ */
+ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX512;
+ else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX2;
+ else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX;
+ else
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_SSE;
}
}
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-stable] [PATCH] compress/isal: fix getting information about CPU
2019-03-07 11:07 [dpdk-stable] [PATCH] compress/isal: fix getting information about CPU Tomasz Cel
@ 2019-03-28 12:24 ` Trahe, Fiona
0 siblings, 0 replies; 3+ messages in thread
From: Trahe, Fiona @ 2019-03-28 12:24 UTC (permalink / raw)
To: Cel, TomaszX, stable, Daly, Lee; +Cc: Trahe, Fiona
> -----Original Message-----
> From: Cel, TomaszX
> Sent: Thursday, March 7, 2019 11:07 AM
> To: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>; Daly, Lee <lee.daly@intel.com>
> Subject: [PATCH] compress/isal: fix getting information about CPU
>
> This patch adds query about CPU features
>
> Fixes: 53a9baa98c36 ("compress/isal: add basic PMD ops")
>
> Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-stable] [PATCH] compress/isal: fix getting information about CPU
@ 2019-03-07 11:28 Tomasz Cel
0 siblings, 0 replies; 3+ messages in thread
From: Tomasz Cel @ 2019-03-07 11:28 UTC (permalink / raw)
To: dev; +Cc: stable, fiona.trahe, lee.daly
This patch adds query about CPU features
Fixes: 53a9baa98c36 ("compress/isal: add basic PMD ops")
Cc: stable@dpdk.org
Signed-off-by: Tomasz Cel <tomaszx.cel@intel.com>
---
drivers/compress/isal/isal_compress_pmd_ops.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c b/drivers/compress/isal/isal_compress_pmd_ops.c
index 7b91849..fe99959 100644
--- a/drivers/compress/isal/isal_compress_pmd_ops.c
+++ b/drivers/compress/isal/isal_compress_pmd_ops.c
@@ -135,10 +135,18 @@ isal_comp_pmd_info_get(struct rte_compressdev *dev __rte_unused,
{
if (dev_info != NULL) {
dev_info->capabilities = isal_pmd_capabilities;
- dev_info->feature_flags = RTE_COMPDEV_FF_CPU_AVX512 |
- RTE_COMPDEV_FF_CPU_AVX2 |
- RTE_COMPDEV_FF_CPU_AVX |
- RTE_COMPDEV_FF_CPU_SSE;
+
+ /* Check CPU for supported vector instruction and set
+ * feature_flags
+ */
+ if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX512;
+ else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX2;
+ else if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX))
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_AVX;
+ else
+ dev_info->feature_flags |= RTE_COMPDEV_FF_CPU_SSE;
}
}
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-28 12:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 11:07 [dpdk-stable] [PATCH] compress/isal: fix getting information about CPU Tomasz Cel
2019-03-28 12:24 ` Trahe, Fiona
2019-03-07 11:28 Tomasz Cel
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).