All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0
@ 2022-12-09 17:21 Fenghua Yu
  2022-12-28  7:00 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Fenghua Yu @ 2022-12-09 17:21 UTC (permalink / raw)
  To: Vinod Koul, Dave Jiang; +Cc: linux-kernel, dmaengine, Fenghua Yu

On DSA/IAX 1.0, TC-A and TC-B in GRPCFG are set as 1 to have best
performance and cannot be changed through sysfs knobs unless override
option is given.

The same values should be set on DSA 2.0 as well.

Fixes: ea7c8f598c32 ("dmaengine: idxd: restore traffic class defaults after wq reset")
Fixes: ade8a86b512c ("dmaengine: idxd: Set defaults for GRPCFG traffic class")
Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/dma/idxd/device.c | 2 +-
 drivers/dma/idxd/init.c   | 2 +-
 drivers/dma/idxd/sysfs.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
index b55405efd4ab..901257081524 100644
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@ -834,7 +834,7 @@ static void idxd_groups_clear_state(struct idxd_device *idxd)
 		group->use_rdbuf_limit = false;
 		group->rdbufs_allowed = 0;
 		group->rdbufs_reserved = 0;
-		if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override) {
+		if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override) {
 			group->tc_a = 1;
 			group->tc_b = 1;
 		} else {
diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 1053e2bb4e9f..4ecd34200998 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -314,7 +314,7 @@ static int idxd_setup_groups(struct idxd_device *idxd)
 		}
 
 		idxd->groups[i] = group;
-		if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override) {
+		if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override) {
 			group->tc_a = 1;
 			group->tc_b = 1;
 		} else {
diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
index 632166538458..9db35011037f 100644
--- a/drivers/dma/idxd/sysfs.c
+++ b/drivers/dma/idxd/sysfs.c
@@ -388,7 +388,7 @@ static ssize_t group_traffic_class_a_store(struct device *dev,
 	if (idxd->state == IDXD_DEV_ENABLED)
 		return -EPERM;
 
-	if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override)
+	if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override)
 		return -EPERM;
 
 	if (val < 0 || val > 7)
@@ -430,7 +430,7 @@ static ssize_t group_traffic_class_b_store(struct device *dev,
 	if (idxd->state == IDXD_DEV_ENABLED)
 		return -EPERM;
 
-	if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override)
+	if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override)
 		return -EPERM;
 
 	if (val < 0 || val > 7)
-- 
2.32.0


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

* Re: [PATCH] dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0
  2022-12-09 17:21 [PATCH] dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0 Fenghua Yu
@ 2022-12-28  7:00 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-12-28  7:00 UTC (permalink / raw)
  To: Fenghua Yu; +Cc: Dave Jiang, linux-kernel, dmaengine

On 09-12-22, 09:21, Fenghua Yu wrote:
> On DSA/IAX 1.0, TC-A and TC-B in GRPCFG are set as 1 to have best
> performance and cannot be changed through sysfs knobs unless override
> option is given.
> 
> The same values should be set on DSA 2.0 as well.

Applied, thanks

> 
> Fixes: ea7c8f598c32 ("dmaengine: idxd: restore traffic class defaults after wq reset")
> Fixes: ade8a86b512c ("dmaengine: idxd: Set defaults for GRPCFG traffic class")
> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com>
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/dma/idxd/device.c | 2 +-
>  drivers/dma/idxd/init.c   | 2 +-
>  drivers/dma/idxd/sysfs.c  | 4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/dma/idxd/device.c b/drivers/dma/idxd/device.c
> index b55405efd4ab..901257081524 100644
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@ -834,7 +834,7 @@ static void idxd_groups_clear_state(struct idxd_device *idxd)
>  		group->use_rdbuf_limit = false;
>  		group->rdbufs_allowed = 0;
>  		group->rdbufs_reserved = 0;
> -		if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override) {
> +		if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override) {
>  			group->tc_a = 1;
>  			group->tc_b = 1;
>  		} else {
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index 1053e2bb4e9f..4ecd34200998 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -314,7 +314,7 @@ static int idxd_setup_groups(struct idxd_device *idxd)
>  		}
>  
>  		idxd->groups[i] = group;
> -		if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override) {
> +		if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override) {
>  			group->tc_a = 1;
>  			group->tc_b = 1;
>  		} else {
> diff --git a/drivers/dma/idxd/sysfs.c b/drivers/dma/idxd/sysfs.c
> index 632166538458..9db35011037f 100644
> --- a/drivers/dma/idxd/sysfs.c
> +++ b/drivers/dma/idxd/sysfs.c
> @@ -388,7 +388,7 @@ static ssize_t group_traffic_class_a_store(struct device *dev,
>  	if (idxd->state == IDXD_DEV_ENABLED)
>  		return -EPERM;
>  
> -	if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override)
> +	if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override)
>  		return -EPERM;
>  
>  	if (val < 0 || val > 7)
> @@ -430,7 +430,7 @@ static ssize_t group_traffic_class_b_store(struct device *dev,
>  	if (idxd->state == IDXD_DEV_ENABLED)
>  		return -EPERM;
>  
> -	if (idxd->hw.version < DEVICE_VERSION_2 && !tc_override)
> +	if (idxd->hw.version <= DEVICE_VERSION_2 && !tc_override)
>  		return -EPERM;
>  
>  	if (val < 0 || val > 7)
> -- 
> 2.32.0

-- 
~Vinod

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

end of thread, other threads:[~2022-12-28  7:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 17:21 [PATCH] dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0 Fenghua Yu
2022-12-28  7:00 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.