Closed bartlomiejcieszkowski closed 4 years ago
in the meantime ill cleanup the USING_CSQ(...) define as this is some leftover
Thanks for the PR :)
The technical side must be review by @cezanne.
I will/can test branch with
I will do it thru this weekend.
The problem with SleepEx is solved in forwarder branch which deprecates #119
@bartlomiejcieszkowski :
Also the irps for device ioctl were coming at dpc which caused a lot of pain in handling - changed to process these in a thread
Please, can you explain DPC pain ❓ In a usual case, thread will be more painful than DPC. In my opinion, if a DPC routine is called with an unnecessary lock or something, the DPC routine itself should be fixed.
@cezanne nevermind that comment, i've rechecked the patch with different paths taken - and removed CSQ altogether, as it deemed unnecessary :)
I've explored some paths like 1) CSQ 2) CSQ with passive level lock for urbrs (GuardedMutex) - oh that was fun :D .. but was killed by DPC latency introduced by network adapter :( 3) No CSQ
Yeah and the no csq version works, so i'm dropping it as it is unnecessary, i've simplified the pull request.
@bartlomiejcieszkowski Is the branch prepared for testing?
@koudis and now it is, sorry for delay, had a busy week :)
@bartlomiejcieszkowski I just test the branch. It works really nice! No lags, no BSOD. 3 devices connected at once and no problem.
I will continue tomorrow because i forgot my USB Hub at work - with 7 SSD USB 3.1 Disks (i've got BSOD with 50% probablity with old USBIP vhci driver)
@bartlomiejcieszkowski : Please apply this patch for beautify.
@cezanne applied, squash and merge?
@bartlomiejcieszkowski please wait a minute :). I will test new changes and then we can merge.
@koudis sure :)
@cezanne @bartlomiejcieszkowski I test the branch after rebase. It seems to work without problems.
I test simultaneously 3x USB 3.1 SSD drives, 1x USB 2.0 flash disk and 2x Logitech unyfing receiver. I copy file from each device to computer (simultaneously) and during "copy" I detach usb devices by usbip.exe detach -p 0
- no problem occurred.
I repeated this test five times.
@bartlomiejcieszkowski :
@cezanne applied, squash and merge?
Please squash, rebase, fast-forward merge. 😃 Great thanks to @bartlomiejcieszkowski and @koudis .
This cleans up the locking and handling of irps in usbip_vhci
Also the irps for device ioctl were coming at dpc which caused a lot of pain in handling - changed to process these in a thread - see threaded_csq.[c|h] - a nice wrapper
Tested this with an xbox one controller - as per #122 Did the whole attach / detach scenario, everything works great
Also did some stress testing with following scenario:
Attached 3 devices:
Pressed buttons, copied 2 gigabyte iso from pendrive
Detached with
usbip detach -p 0
Result: no BSOD
Also it is worth noting that it's safe to reduce SleepEx in usbip_forward.c to 100ms from 500ms