Skip to contentSkip to conversation

accel-config: Fix idxd_mdev modprobe on specific silicon stepping

PATCH In review Tony Zhu 3 participants 6 messages Apr 2, 2021 – Apr 6, 2021

lore
Share & tools
lore

Tony Zhu

author
#0 lore raw

PATCH 1/1 accel-config: Fix idxd_mdev modprobe on specific silicon stepping

When reset the module, on specific silicon steppings, need the delay to make sure devices and wqs are ready. Otherwise, it will fail to get the available wqs.

Signed-off-by Tony Zhu <tony.zhu(a)intel.com>
---
 test/common | 1 +
 1 file changed, 1 insertion(+)
test/common +1 -0
index 4bd4ed3..625d347 100644
@@ -108,6 +108,7 @@ _cleanup()
 		sleep 1
 	}
 	modprobe idxd
+	sleep 1
 }
 
 # json2var
Signature · 1 line
2.17.1
#1 lore raw

test/common _cleanup() · line 111

Quoted 2 lines

modprobe idxd

test/common +1 -0
+	sleep 1

Dave - this seems weird. Does the idxd start up some async work during module initialization? I'd normally expect "modprobe" to complete synchronously.

"sleep 1" seems a fragile fix. If the system is heavily loaded would you need a longer sleep?

-Tony

#2 lore raw
Quoted 8 lines · Tony Luck

test/common _cleanup() · line 111

Quoted 2 lines

modprobe idxd

test/common +1 -0
+	sleep 1

Dave - this seems weird. Does the idxd start up some async work during module initialization? I'd normally expect "modprobe" to complete synchronously.

"sleep 1" seems a fragile fix. If the system is heavily loaded would you need a longer sleep?

Tony Zhu mentioned he saw different behavior across hw steppings so the timing may be an issue.

Quoted 5 lines

-Tony
_______________________________________________
Accel-config mailing list -- accel-config(a)lists.01.org To unsubscribe send an email to accel-config-leave(a)lists.01.org

#3 lore raw
In reply to Luck
Quoted 9 lines · Tony

test/common _cleanup() · line 111

Quoted 2 lines

modprobe idxd

test/common +1 -0
+	sleep 1

Dave - this seems weird. Does the idxd start up some async work during module initialization? I'd normally expect "modprobe" to complete synchronously.

"sleep 1" seems a fragile fix. If the system is heavily loaded would you need a longer sleep?

-Tony

I don't think so. Although it does do a bunch of 'struct device' registration and attempt to probe all of them with registered drivers on the dsa_bus. I'm not sure if those are done in async manner.

#4 lore raw
In reply to Tony Zhu

This will not work because now idxd_uacce also depends on idxd module. Also I find the module dependency order between idxd_uacce and idxd_mdev is not fixed. You may need to do something like -

1. Check and unload idxd_mdev. (This can fail depending on module order)
2. Check and unload idxd_uacce.
3. Check and unload idxd_mdev again. (Will succeed for any module order)
4. Check and unload idxd
5. Load idxd

sleep 1 may be required between steps

-Ramesh

Quoted 23 lines · Tony Zhu

When reset the module, on specific silicon steppings, need the delay to make sure devices and wqs are ready. Otherwise, it will fail to get the available wqs.

Signed-off-by Tony Zhu <tony.zhu(a)intel.com>
---
 test/common | 1 +
 1 file changed, 1 insertion(+)
test/common +1 -0
index 4bd4ed3..625d347 100644
@@ -108,6 +108,7 @@ _cleanup()
 		sleep 1
 	}
 	modprobe idxd
+	sleep 1
 }
 
 # json2var
Signature · 1 line
2.17.1
#5 lore raw

I have reworked this patch and sent for review
https://lists.01.org/hyperkitty/list/accel-config(a)lists.01.org/thread/MEIPOQZLTTV4PCBVRLFFMYL3G3CIIASH/

Quoted 39 lines · Ramesh Thomas

This will not work because now idxd_uacce also depends on idxd module. Also I find the module dependency order between idxd_uacce and idxd_mdev is not fixed. You may need to do something like -

1. Check and unload idxd_mdev. (This can fail depending on module order)
2. Check and unload idxd_uacce.
3. Check and unload idxd_mdev again. (Will succeed for any module order)
4. Check and unload idxd
5. Load idxd

sleep 1 may be required between steps

-Ramesh

Quoted 23 lines · Tony Zhu

When reset the module, on specific silicon steppings, need the delay to make sure devices and wqs are ready. Otherwise, it will fail to get the available wqs.

Signed-off-by Tony Zhu <tony.zhu(a)intel.com>
---
 test/common | 1 +
 1 file changed, 1 insertion(+)
test/common +1 -1
index 4bd4ed3..625d347 100644
@@ -108,6 +108,7 @@ _cleanup()
 		sleep 1
 	}
 	modprobe idxd
+	sleep 1
 }
 
 # json2var
--

2.17.1