Subject: Re: [PATCH net v2 4/4] selftests: drv-net: rss_ctx: test RSS contexts persist after ifdown/up

From: Jakub Kicinski <[email-masked]>
Date: Tue, 10 Feb 2026 17:46:27 -0800

On Sun, 8 Feb 2026 21:56:39 +0530 Pavan Chebbi wrote:
> > > +
> > > +    import subprocess
> > > +    max_wait = 10
> > > +    ping_success = False
> > > +    remote_addr = cfg.remote_addr_v[cfg.addr_ipver]
> > > +    for attempt in range(max_wait):
> > > +        try:
> > > +            result = subprocess.run(['ping', '-c', '1', '-W', '1', remote_addr],
> > > +                                  capture_output=True, timeout=2)
> > > +            if result.returncode == 0:
> > > +                ping_success = True
> > > +                break  
> >
> > This might be wanting to use utils.py's cmd()?  
> 
> I checked and tried using the cmd() and it indeed eliminates a lot of
> lines here. But the test itself becomes a little unreliable.
> I often see TimeoutError: [Errno Wait for file contents failed]
> /sys/class/net/ens2f0np0/carrier from the wait_file (Jakub asked me to
> use wait_file)

Does the link take more than the default 5 sec to come up?
wait_file() has a deadline param that should let us wait longer

> Also, even when the test succeeds, after the suite exits, I cannot
> ping the remote host for a long time. In contrast, my manual loop
> worked 100pc of the times I tested.
> I am using the command like below:
> 
>    for _ in range(10):
>         if cmd(f"ping -c 1 -W 1 {remote_addr}", fail=False, timeout=2).ret == 0:
>             break
>         time.sleep(1)
>     else:
>         raise KsftSkipEx("Cannot reach remote host after interface up")
> 
> I am not a py expert so is there something I am missing?

I don't think there's anything Python related here :(
Is it possible that NIC reports carrier before it can actually send
packets? Maybe the wait_file() gives ping has a higher chance of failing
with carrier up which makes the neighbor resolution failure more sticky?