From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
stable@dpdk.org, Kevin Laatz <kevin.laatz@intel.com>,
Radu Nicolau <radu.nicolau@intel.com>
Subject: [PATCH v2 2/4] dma/idxd: fix paths to driver sysfs directory
Date: Tue, 11 Jan 2022 13:41:03 +0000 [thread overview]
Message-ID: <20220111134105.1007191-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20220111134105.1007191-1-bruce.richardson@intel.com>
Recent kernel changes[1][2] mean that we cannot guarantee that the paths
in sysfs used for creating/binding a DSA or workqueue instance will be
as given in the utility script, since they are now "compatibility-mode
only". Update script to support both new paths and compatibility ones.
[1] https://lore.kernel.org/all/162637445139.744545.6008938867943724701.stgit@djiang5-desk3.ch.intel.com/
[2] https://lore.kernel.org/all/162637468705.744545.4399080971745974435.stgit@djiang5-desk3.ch.intel.com/
Fixes: 01863b9d2354 ("raw/ioat: include example configuration script")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/dma/idxd/dpdk_idxd_cfg.py | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/idxd/dpdk_idxd_cfg.py b/drivers/dma/idxd/dpdk_idxd_cfg.py
index fcc27822ef..34537cb980 100755
--- a/drivers/dma/idxd/dpdk_idxd_cfg.py
+++ b/drivers/dma/idxd/dpdk_idxd_cfg.py
@@ -29,9 +29,17 @@ def write_values(self, values):
f.write(str(contents))
+def get_drv_dir(dtype):
+ "Get the sysfs path for the driver, either 'idxd' or 'user'"
+ drv_dir = "/sys/bus/dsa/drivers/" + dtype
+ if not os.path.exists(drv_dir):
+ return "/sys/bus/dsa/drivers/dsa"
+ return drv_dir
+
+
def reset_device(dsa_id):
"Reset the DSA device and all its queues"
- drv_dir = SysfsDir("/sys/bus/dsa/drivers/dsa")
+ drv_dir = SysfsDir(get_drv_dir("idxd"))
drv_dir.write_values({"unbind": f"dsa{dsa_id}"})
@@ -58,7 +66,6 @@ def get_dsa_id(pci):
def configure_dsa(dsa_id, queues, prefix):
"Configure the DSA instance with appropriate number of queues"
dsa_dir = SysfsDir(f"/sys/bus/dsa/devices/dsa{dsa_id}")
- drv_dir = SysfsDir("/sys/bus/dsa/drivers/dsa")
max_groups = dsa_dir.read_int("max_groups")
max_engines = dsa_dir.read_int("max_engines")
@@ -85,9 +92,12 @@ def configure_dsa(dsa_id, queues, prefix):
"size": int(max_work_queues_size / nb_queues)})
# enable device and then queues
- drv_dir.write_values({"bind": f"dsa{dsa_id}"})
+ idxd_dir = SysfsDir(get_drv_dir("idxd"))
+ idxd_dir.write_values({"bind": f"dsa{dsa_id}"})
+
+ user_dir = SysfsDir(get_drv_dir("user"))
for q in range(nb_queues):
- drv_dir.write_values({"bind": f"wq{dsa_id}.{q}"})
+ user_dir.write_values({"bind": f"wq{dsa_id}.{q}"})
def main(args):
--
2.32.0
next prev parent reply other threads:[~2022-01-11 13:41 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-20 17:05 [PATCH] dma/idxd: fix burst capacity calculation Bruce Richardson
2022-01-04 17:16 ` Kevin Laatz
2022-01-05 1:32 ` Hu, Jiayu
2022-01-10 13:09 ` Pai G, Sunil
2022-01-10 13:25 ` Bruce Richardson
2022-01-10 13:44 ` Pai G, Sunil
2022-01-10 16:18 ` Bruce Richardson
2022-01-11 13:41 ` [PATCH v2 0/4] fixes for dma/idxd Bruce Richardson
2022-01-11 13:41 ` [PATCH v2 1/4] dma/idxd: fix burst capacity calculation Bruce Richardson
2022-01-11 13:41 ` Bruce Richardson [this message]
2022-01-11 16:50 ` [PATCH v2 2/4] dma/idxd: fix paths to driver sysfs directory Kevin Laatz
2022-01-11 13:41 ` [PATCH v2 3/4] dma/idxd: fix wrap-around in burst capacity calculation Bruce Richardson
2022-01-11 13:45 ` Pai G, Sunil
2022-01-11 16:50 ` Kevin Laatz
2022-01-11 13:41 ` [PATCH v2 4/4] test_dmadev: increase iterations of capacity test case Bruce Richardson
2022-01-11 16:50 ` Kevin Laatz
2022-01-20 13:06 ` [PATCH v2 0/4] fixes for dma/idxd Thomas Monjalon
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=20220111134105.1007191-3-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=kevin.laatz@intel.com \
--cc=radu.nicolau@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 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.