dmaengine: idxd: Set traffic class values in GRPCFG on DSA 2.0
authorFenghua Yu <fenghua.yu@intel.com>
Fri, 9 Dec 2022 17:21:41 +0000 (09:21 -0800)
committerVinod Koul <vkoul@kernel.org>
Wed, 28 Dec 2022 07:00:50 +0000 (12:30 +0530)
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>
Link: https://lore.kernel.org/r/20221209172141.562648-1-fenghua.yu@intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/idxd/device.c
drivers/dma/idxd/init.c
drivers/dma/idxd/sysfs.c

index 06f5d37..19ab3e5 100644 (file)
@@ -701,7 +701,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 {
index 529ea09..e63b0c6 100644 (file)
@@ -295,7 +295,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 {
index 3229dfc..18cd815 100644 (file)
@@ -387,7 +387,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)
@@ -429,7 +429,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)