On Tue, 15 Apr 2025 14:43:41 +0700 Bui Quang Minh wrote:
> +def setup_xsk(cfg, xdp_queue_id = 0) -> bkg:
> +    # Probe for support
> +    xdp = cmd(f'{cfg.net_lib_dir / "xdp_helper"} - -', fail=False)
> +    if xdp.ret == 255:
> +        raise KsftSkipEx('AF_XDP unsupported')
> +    elif xdp.ret > 0:
> +        raise KsftFailEx('unable to create AF_XDP socket')
> +
> +    return bkg(f'{cfg.net_lib_dir / "xdp_helper"} {cfg.ifindex} 
> {xdp_queue_id}',
> +               ksft_wait=3)
> +
> +def check_xdp_bind(cfg):
> +    ip(f"link set dev %s xdp obj %s sec xdp" %
> +       (cfg.ifname, cfg.net_lib_dir / "xdp_dummy.bpf.o"))
> +    ip(f"link set dev %s xdp off" % cfg.ifname)
> +
> +def check_rx_resize(cfg, queue_size = 128):
> +    rx_ring = _get_rx_ring_entries(cfg)
> +    ethtool(f"-G %s rx %d" % (cfg.ifname, queue_size))
> +    ethtool(f"-G %s rx %d" % (cfg.ifname, rx_ring))

Unfortunately this doesn't work on a basic QEMU setup:

# ethtool -G eth0 rx 128
[   15.680655][  T287] virtio_net virtio2 eth0: resize rx fail: rx queue index: 
0 err: -2
netlink error: No such file or directory

Is there a way to enable more capable virtio_net with QEMU?

Reply via email to