Subject: Re: [PATCH net-next] selftests: drv-net: test drivers sleeping in ndo_get_stats64

From: Jakub Kicinski <[email-masked]>
Date: Mon, 6 Jan 2025 07:41:04 -0800

On Sun, 05 Jan 2025 10:55:50 -0500 Willem de Bruijn wrote:
> Two tiny comments, neither cause for respin.

Let me respin, not much work since comment changes shouldn't need 
a re-test..

> > +@ksft_disruptive
> > +def procfs_downup_hammer(cfg) -> None:
> > +    """
> > +    Reading stats via procfs only holds the RCU lock, drivers often try
> > +    to sleep when reading the stats, or don't protect against races.
> > +    """
> > +    # Max out the queues, we'll flip between max an 1  
> 
> s/an/and/
> 
> > +    channels = ethnl.channels_get({'header': {'dev-index': cfg.ifindex}})
> > +    if channels['combined-count'] == 0:
> > +        rx_type = 'rx'
> > +    else:
> > +        rx_type = 'combined'
> > +    cur_queue_cnt = channels[f'{rx_type}-count']
> > +    max_queue_cnt = channels[f'{rx_type}-max']
> > +
> > +    cmd(f"ethtool -L {cfg.ifname} {rx_type} {max_queue_cnt}")
> > +    defer(cmd, f"ethtool -L {cfg.ifname} {rx_type} {cur_queue_cnt}")
> > +
> > +    # Real test stats
> > +    stats = __run_inf_loop("cat /proc/net/dev")
> > +    defer(stats.kill)
> > +
> > +    ipset = f"ip link set dev {cfg.ifname}"
> > +    defer(ip, f"link set dev {cfg.ifname} up")  
> 
> unimportant: could reference ipset here too, as in below.

Ha, that's what I did initially, but then running it I discovered
that ip() adds the initial "ip", so we end up executing:

 ip ip link set...
-- 
pw-bot: cr