whitequark,
@whitequark@mastodon.social avatar

holy shit, i... solved bufferbloat (in one direction) in my userspace Python Linux network interface card driver in Glasgow?

i'm sending 200 Mbps of spam to Wanda's laptop right now (most of which doesn't fit into the 100M link) and pings never go above 25ms

also she gets acceptable realtime performance (ssh, etc)

I: g.applet.interface.ethernet_rgmii: usb->os pps= 16 Mbps= 0.03
I: g.applet.interface.ethernet_rgmii: os->usb pps=17862 Mbps=215.87

whitequark, (edited )
@whitequark@mastodon.social avatar

i got the latency under heavy load down to under 3 ms :D :D

whitequark,
@whitequark@mastodon.social avatar

"python isn't a programming language for real men", they say. "you can't write high-quality device drivers in python", they say. "garbage collection is a problem", they say. "drivers in userspace won't be as performant as kernel ones", they say

fuck you i will use asyncio python and crimes to develop every driver in userspace and get the performance profile of a kernel driver anyway

for no reason other than i like it

whitequark,
@whitequark@mastodon.social avatar

i wonder how much UDP spam can my driver actually take. obviously most of it will never reach the NIC, but i wonder at what point will the python process break

for some reason it pegs a core basically regardless of the actual pps value, so that's not representative, and i shall test it with higher values until it breaks

whitequark,
@whitequark@mastodon.social avatar

the most my Python NIC could take in the transmit queue is 5.5 Gbps. it promptly drops most of it because at that point, the USB OUT tasks are rather starved and the NIC doesn't get properly serviced, but it does get all of those packets into the Python process and queues them

that's 454000 pps; about half a million syscalls in a single ordinary CPython process

whitequark,
@whitequark@mastodon.social avatar

anyway i should definitely implement the 1GBASE-T mode in the RGMII driver and see if I can push 300 Mbps of actual traffic through the PHY

niconiconi,

@whitequark PHYthon

whitequark,
@whitequark@mastodon.social avatar

i actually consider these results rather insufficient. yes, i can get CPython to accept 0.5Mpps, but it really struggles, and if I want it to concurrently handle complex USB flow control it doesn't exactly shine

I want it to be much, much better. I want it to be better than the worse USB NICs on market with their own kernel driver. it should be at least on par with CDC EEM

whitequark,
@whitequark@mastodon.social avatar

the USB handling is a particular source of pain right now, because realistically you want to have a zero-copy (within Python. Linux will do copy_from_user and copy_to_user, unavoidably without io_uring) implementation which takes buffers from the tap interface and puts them directly to USB

i'm doing something close to it, but not close enough

danderson,
@danderson@hachyderm.io avatar

@whitequark Wow I missed the context for the other thing, and wow what a journey from the cable to ping, that's amazing. I didn't think an ice40 was big enough to have fun, clearly I need to work on my imagination!

whitequark,
@whitequark@mastodon.social avatar

@manawyrm look

manawyrm,
@manawyrm@chaos.social avatar

@whitequark haaa 😻💜💜💜💜

awesome!

whitequark,
@whitequark@mastodon.social avatar

@manawyrm the other direction still has a bug that causes iperf -R to instantly break the driver but it's fixable

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • mdbf
  • osvaldo12
  • ethstaker
  • tacticalgear
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • modclub
  • Youngstown
  • everett
  • slotface
  • rosin
  • GTA5RPClips
  • provamag3
  • khanakhh
  • cisconetworking
  • tester
  • ngwrru68w68
  • normalnudes
  • Durango
  • InstantRegret
  • cubers
  • megavids
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines