DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
@ 2019-03-07 11:28 Tomasz Cel
  2019-03-27 14:05 ` Akhil Goyal
  0 siblings, 1 reply; 9+ 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] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-07 11:28 [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU Tomasz Cel
@ 2019-03-27 14:05 ` Akhil Goyal
  2019-03-27 14:05   ` Akhil Goyal
  2019-03-27 15:01   ` Daly, Lee
  0 siblings, 2 replies; 9+ messages in thread
From: Akhil Goyal @ 2019-03-27 14:05 UTC (permalink / raw)
  To: Tomasz Cel, dev; +Cc: stable, fiona.trahe, lee.daly

Hi Fiona/Lee,

Could you please review this patch.

Thanks,
Akhil

On 3/7/2019 4:58 PM, Tomasz Cel wrote:
> 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;
>   	}
>   }
>   


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-27 14:05 ` Akhil Goyal
@ 2019-03-27 14:05   ` Akhil Goyal
  2019-03-27 15:01   ` Daly, Lee
  1 sibling, 0 replies; 9+ messages in thread
From: Akhil Goyal @ 2019-03-27 14:05 UTC (permalink / raw)
  To: Tomasz Cel, dev; +Cc: stable, fiona.trahe, lee.daly

Hi Fiona/Lee,

Could you please review this patch.

Thanks,
Akhil

On 3/7/2019 4:58 PM, Tomasz Cel wrote:
> 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;
>   	}
>   }
>   


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-27 14:05 ` Akhil Goyal
  2019-03-27 14:05   ` Akhil Goyal
@ 2019-03-27 15:01   ` Daly, Lee
  2019-03-27 15:01     ` Daly, Lee
  2019-03-29 15:28     ` Daly, Lee
  1 sibling, 2 replies; 9+ messages in thread
From: Daly, Lee @ 2019-03-27 15:01 UTC (permalink / raw)
  To: Akhil Goyal, Cel, TomaszX, dev; +Cc: stable, Trahe, Fiona

Hi Tomasz,

	This patch makes sense to check does the CPU have the capability of certain instructions before
Adding it to the dev_info flags. I think one more addition should be made in isal_compress_pmd.c 
When checking what compression level should be used , decided by the AVX instructions available, it previously used the 
Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed any more since it will now be checked beforehand, it would be doing twice the work.
When the driver now needs to decide the compression level it should now just check the feature_flags set below. Perhaps a V2 could be sent with this addition.
Regards,
Lee.

> > 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;
> >   	}
> >   }
> >


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-27 15:01   ` Daly, Lee
@ 2019-03-27 15:01     ` Daly, Lee
  2019-03-29 15:28     ` Daly, Lee
  1 sibling, 0 replies; 9+ messages in thread
From: Daly, Lee @ 2019-03-27 15:01 UTC (permalink / raw)
  To: Akhil Goyal, Cel, TomaszX, dev; +Cc: stable, Trahe, Fiona

Hi Tomasz,

	This patch makes sense to check does the CPU have the capability of certain instructions before
Adding it to the dev_info flags. I think one more addition should be made in isal_compress_pmd.c 
When checking what compression level should be used , decided by the AVX instructions available, it previously used the 
Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed any more since it will now be checked beforehand, it would be doing twice the work.
When the driver now needs to decide the compression level it should now just check the feature_flags set below. Perhaps a V2 could be sent with this addition.
Regards,
Lee.

> > 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;
> >   	}
> >   }
> >


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-27 15:01   ` Daly, Lee
  2019-03-27 15:01     ` Daly, Lee
@ 2019-03-29 15:28     ` Daly, Lee
  2019-03-29 15:28       ` Daly, Lee
  2019-03-29 15:37       ` Akhil Goyal
  1 sibling, 2 replies; 9+ messages in thread
From: Daly, Lee @ 2019-03-29 15:28 UTC (permalink / raw)
  To: 'Akhil Goyal', Cel, TomaszX, 'dev@dpdk.org'
  Cc: 'stable@dpdk.org', Trahe, Fiona

Hi Tomasz,
	After some testing I can now see the approach in your patch in the best method for getting the CPU info.
Rgds,
Lee.
> -----Original Message-----
> From: Daly, Lee
> Sent: Wednesday, March 27, 2019 3:01 PM
> To: Akhil Goyal <akhil.goyal@nxp.com>; Cel, TomaszX
> <tomaszx.cel@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] compress/isal: fix getting information about
> CPU
> 
> Hi Tomasz,
> 
> 	This patch makes sense to check does the CPU have the capability of
> certain instructions before Adding it to the dev_info flags. I think one more
> addition should be made in isal_compress_pmd.c When checking what
> compression level should be used , decided by the AVX instructions available,
> it previously used the
> Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed
> any more since it will now be checked beforehand, it would be doing twice
> the work.
> When the driver now needs to decide the compression level it should now
> just check the feature_flags set below. Perhaps a V2 could be sent with this
> addition.
> Regards,
> Lee.
> 
> > > 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>
> > > ---
Acked-by: Lee Daly <lee.daly@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-29 15:28     ` Daly, Lee
@ 2019-03-29 15:28       ` Daly, Lee
  2019-03-29 15:37       ` Akhil Goyal
  1 sibling, 0 replies; 9+ messages in thread
From: Daly, Lee @ 2019-03-29 15:28 UTC (permalink / raw)
  To: 'Akhil Goyal', Cel, TomaszX, 'dev@dpdk.org'
  Cc: 'stable@dpdk.org', Trahe, Fiona

Hi Tomasz,
	After some testing I can now see the approach in your patch in the best method for getting the CPU info.
Rgds,
Lee.
> -----Original Message-----
> From: Daly, Lee
> Sent: Wednesday, March 27, 2019 3:01 PM
> To: Akhil Goyal <akhil.goyal@nxp.com>; Cel, TomaszX
> <tomaszx.cel@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] compress/isal: fix getting information about
> CPU
> 
> Hi Tomasz,
> 
> 	This patch makes sense to check does the CPU have the capability of
> certain instructions before Adding it to the dev_info flags. I think one more
> addition should be made in isal_compress_pmd.c When checking what
> compression level should be used , decided by the AVX instructions available,
> it previously used the
> Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed
> any more since it will now be checked beforehand, it would be doing twice
> the work.
> When the driver now needs to decide the compression level it should now
> just check the feature_flags set below. Perhaps a V2 could be sent with this
> addition.
> Regards,
> Lee.
> 
> > > 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>
> > > ---
Acked-by: Lee Daly <lee.daly@intel.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-29 15:28     ` Daly, Lee
  2019-03-29 15:28       ` Daly, Lee
@ 2019-03-29 15:37       ` Akhil Goyal
  2019-03-29 15:37         ` Akhil Goyal
  1 sibling, 1 reply; 9+ messages in thread
From: Akhil Goyal @ 2019-03-29 15:37 UTC (permalink / raw)
  To: Daly, Lee, Cel, TomaszX, 'dev@dpdk.org'
  Cc: 'stable@dpdk.org', Trahe, Fiona



On 3/29/2019 8:58 PM, Daly, Lee wrote:
> Hi Tomasz,
> 	After some testing I can now see the approach in your patch in the best method for getting the CPU info.
> Rgds,
> Lee.
>> -----Original Message-----
>> From: Daly, Lee
>> Sent: Wednesday, March 27, 2019 3:01 PM
>> To: Akhil Goyal <akhil.goyal@nxp.com>; Cel, TomaszX
>> <tomaszx.cel@intel.com>; dev@dpdk.org
>> Cc: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
>> Subject: RE: [dpdk-dev] [PATCH] compress/isal: fix getting information about
>> CPU
>>
>> Hi Tomasz,
>>
>> 	This patch makes sense to check does the CPU have the capability of
>> certain instructions before Adding it to the dev_info flags. I think one more
>> addition should be made in isal_compress_pmd.c When checking what
>> compression level should be used , decided by the AVX instructions available,
>> it previously used the
>> Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed
>> any more since it will now be checked beforehand, it would be doing twice
>> the work.
>> When the driver now needs to decide the compression level it should now
>> just check the feature_flags set below. Perhaps a V2 could be sent with this
>> addition.
>> Regards,
>> Lee.
>>
>>>> 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>
>>>> ---
> Acked-by: Lee Daly <lee.daly@intel.com>
Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU
  2019-03-29 15:37       ` Akhil Goyal
@ 2019-03-29 15:37         ` Akhil Goyal
  0 siblings, 0 replies; 9+ messages in thread
From: Akhil Goyal @ 2019-03-29 15:37 UTC (permalink / raw)
  To: Daly, Lee, Cel, TomaszX, 'dev@dpdk.org'
  Cc: 'stable@dpdk.org', Trahe, Fiona



On 3/29/2019 8:58 PM, Daly, Lee wrote:
> Hi Tomasz,
> 	After some testing I can now see the approach in your patch in the best method for getting the CPU info.
> Rgds,
> Lee.
>> -----Original Message-----
>> From: Daly, Lee
>> Sent: Wednesday, March 27, 2019 3:01 PM
>> To: Akhil Goyal <akhil.goyal@nxp.com>; Cel, TomaszX
>> <tomaszx.cel@intel.com>; dev@dpdk.org
>> Cc: stable@dpdk.org; Trahe, Fiona <fiona.trahe@intel.com>
>> Subject: RE: [dpdk-dev] [PATCH] compress/isal: fix getting information about
>> CPU
>>
>> Hi Tomasz,
>>
>> 	This patch makes sense to check does the CPU have the capability of
>> certain instructions before Adding it to the dev_info flags. I think one more
>> addition should be made in isal_compress_pmd.c When checking what
>> compression level should be used , decided by the AVX instructions available,
>> it previously used the
>> Rte_cpu_get_flag_enabled() function, however, I don’t believe that is needed
>> any more since it will now be checked beforehand, it would be doing twice
>> the work.
>> When the driver now needs to decide the compression level it should now
>> just check the feature_flags set below. Perhaps a V2 could be sent with this
>> addition.
>> Regards,
>> Lee.
>>
>>>> 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>
>>>> ---
> Acked-by: Lee Daly <lee.daly@intel.com>
Applied to dpdk-next-crypto

Thanks.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-03-29 15:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-07 11:28 [dpdk-dev] [PATCH] compress/isal: fix getting information about CPU Tomasz Cel
2019-03-27 14:05 ` Akhil Goyal
2019-03-27 14:05   ` Akhil Goyal
2019-03-27 15:01   ` Daly, Lee
2019-03-27 15:01     ` Daly, Lee
2019-03-29 15:28     ` Daly, Lee
2019-03-29 15:28       ` Daly, Lee
2019-03-29 15:37       ` Akhil Goyal
2019-03-29 15:37         ` Akhil Goyal

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).