On Tue, 24 Mar 2026 16:18:30 +0100 Sabrina Dubroca wrote:
> > Adding back the nsim debugfs file and test assertions guarded by "if
> > cfg._ns" would ensure filter propagation correctness, but would feel
> > non-Pythonic and a little hacky given that the same assertion can't
> > work on real HW.
>
> I think that's fine. The tests are anyway python wrappers around
> iproute commands, it's neither "Pythonic" nor pretty.
> Jakub, any objection?
No objections, I already added this nasty little piece of code in gro.py
try:
# Disable TSO for local tests
cfg.require_nsim() # will raise KsftXfailEx if not running on nsim
_set_ethtool_feat(cfg.remote_ifname, cfg.remote_feat,
{"tcp-segmentation-offload": False},
host=cfg.remote)
except KsftXfailEx:
pass
I agree with Cosmin that the check feels a bit non-Pythonic. Dunno
if the try except ends up being any better tho :S
Let's not use "if cfg._ns" tho, please add a method that will return
true / false (or feel free to come up with a cleaner way if you can
think of it). We definitely don't want to encourage nsim-only checks,
if you add new methods please mention in their documentation that we
strongly prefer if the authors can think of a way to prove correctness
that would also work on real HW.