On Fri, Jun 28, 2019 at 1:57 AM matthew green <m...@netbsd.org> wrote: > > Module Name: src > Committed By: mrg > Date: Fri Jun 28 01:57:43 UTC 2019 > > Modified Files: > src/sys/dev/usb: if_axen.c if_cdce.c if_ure.c > > Log Message: > more smp cleanup for ure(4)/axen(4)/cdce(4):
Thank you for working! > - convert IFF_ALLMULTI to ETHER_F_ALLMULTI, using ETHER_LOCK() > - remove IFF_OACTIVE use, and simply check the ring count in start cdce_start_locked() has the last one. > - assert/take more locks > - XXX: IFF_RUNNING is not properly protected (all driver problem) > - fix axen_timer setting so it actually runs > - document a locking issue in stop callback: > stop is called with the softc lock held, but the lock order > in all other places is ifnet -> softc -> rx -> tx, so taking > ifnet lock when softc lock is held would be problematic ure_init_locked() calls ure_stop() with sc->ure_lock held, so it would cause 'locking against myself' perhaps when ifconfig such as IFF_DEBUG while the interface is up. > - in rxeof check for stopping/dying more often. i managed to > trigger a pagefault in cdce_rxeof() when yanking an active > device as it attempted to usbd_setup_xfer() on closed pipes. > - add missing USBD_MPSAFE and cdce_stopping resetting for cdce(4) > > between this and other recent clean ups increase performance of > these drivers mostly. some numbers (in mbit/sec): > > old: new: > driver in out in+out in out in+out > ---- -- --- ------ -- --- ------ > cdce 39 32 44 38 33 54 > axen 44 34 45 48 37 42 > ure 36 34 35 36 38 38 > > i'm not sure why axen drops a little with in+out. cdce is > helped quite a lot, and ure a little. it is disappointing that > ure does not outperform cdce -- it's the same actual hardware, > and the device-specific (ure) should outperform the generic > cdce driver... > > > To generate a diff of this commit: > cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_axen.c > cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/if_cdce.c > cvs rdiff -u -r1.12 -r1.13 src/sys/dev/usb/if_ure.c > > Please note that diffs are not public domain; they are subject to the > copyright notices on the relevant files. >