i've upgraded the Ethernet controller applet for

this is the main loop of the applet working in bridge mode (acting as a network card for your PC). no weird optimizations, no hacks, just a loop that forwards packets in normal boring Python

on a 100BASE-T link, i get ~95.5 Mbps [saturated link] of upload bandwidth and ~70 Mbps of download bandwidth before packet loss starts

how cool is this?

    async def run(self, args):
        if args.operation == "bridge":
            os_iface = OSNetworkInterface(args.interface)

            async def forward_rx():
                async for packet in self.eth_iface.iter_recv():
                    if len(packet) >= 14: # must be at least ETH_HLEN, or we'll get EINVAL on Linux
                        await os_iface.send([packet])

            async def forward_tx():
                while True:
                    for packet in await os_iface.recv():
                        if not await self.eth_iface.send(packet):
                            break

            async with asyncio.TaskGroup() as group:
                group.create_task(forward_rx())
                group.create_task(forward_tx())
0
0
0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/whitequark/statuses/114640315300117376 on your instance and quote it. (Note that quoting is not supported in Mastodon.)