public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Zahka <daniel.zahka@gmail.com>
To: Wei Wang <weibunny.kernel@gmail.com>,
	netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
	Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	David Wei <dw@davidwei.uk>, Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>
Cc: Wei Wang <weibunny@fb.com>
Subject: Re: [PATCH v9 net-next 5/5] selftest/net: psp: Add test for dev-assoc/disassoc
Date: Tue, 31 Mar 2026 10:04:08 -0400	[thread overview]
Message-ID: <956aefbd-b795-48be-ab73-58f489b1b535@gmail.com> (raw)
In-Reply-To: <20260330223143.2394706-6-weibunny.kernel@gmail.com>


On 3/30/26 6:31 PM, Wei Wang wrote:
> +
> +def _dev_assoc_no_nsid(cfg):
> +    """ Test dev-assoc and dev-disassoc without nsid attribute """
> +    _init_psp_dev(cfg, True)
> +    psp_dev_id = cfg.psp_dev_id
> +
> +    # Get nk_host's ifindex (in host namespace, same as caller)
> +    nk_host_dev = ip(f"link show dev {cfg._nk_host_ifname}", json=True)[0]
> +    nk_host_ifindex = nk_host_dev['ifindex']
> +
> +    # Associate without nsid - should look up ifindex in caller's netns
> +    cfg.pspnl.dev_assoc({'id': psp_dev_id, 'ifindex': nk_host_ifindex})
> +
> +    # Verify assoc-list contains the device
> +    dev_info = cfg.pspnl.dev_get({'id': psp_dev_id})
> +    ksft_true('assoc-list' in dev_info, "No assoc-list after association")
> +    found = False
> +    for assoc in dev_info['assoc-list']:
> +        if assoc['ifindex'] == nk_host_ifindex:
> +            found = True
> +            break
> +    ksft_true(found, "Associated device not found in assoc-list")
> +
> +    # Disassociate without nsid - should also use caller's netns
> +    cfg.pspnl.dev_disassoc({'id': psp_dev_id, 'ifindex': nk_host_ifindex})
> +
> +    # Verify assoc-list no longer contains the device
> +    dev_info = cfg.pspnl.dev_get({'id': psp_dev_id})
> +    found = False
> +    if 'assoc-list' in dev_info:
> +        for assoc in dev_info['assoc-list']:
> +            if assoc['ifindex'] == nk_host_ifindex:
> +                found = True
> +                break
> +    ksft_true(not found, "Device should not be in assoc-list after disassociation")
> +
> +    del cfg.psp_dev_id
> +    del cfg.psp_info
> +
...
> +
> +@ksft_variants([
> +    KsftNamedVariant(f"v{v}_ip6", v, "6")
> +    for v in range(4)
> +])
> +def dev_assoc_no_nsid(cfg, version, ipver):
> +    cfg.require_ipver(ipver)
> +    _dev_assoc_no_nsid(cfg)
> +


Why do we need ip connectivity for this test? Why are you parameterizing 
over PSP version?



  reply	other threads:[~2026-03-31 14:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 22:31 [PATCH v9 net-next 0/5] psp: Add support for dev-assoc/disassoc Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 1/5] psp: add admin/non-admin version of psp_device_get_locked Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 2/5] psp: add new netlink cmd for dev-assoc and dev-disassoc Wei Wang
2026-03-31 13:03   ` Daniel Zahka
2026-03-31 21:48     ` Wei Wang
2026-03-31 23:43   ` kernel test robot
2026-03-30 22:31 ` [PATCH v9 net-next 3/5] psp: add a new netdev event for dev unregister Wei Wang
2026-03-31 13:30   ` Daniel Zahka
2026-03-31 21:51     ` Wei Wang
2026-04-01 13:02       ` Daniel Zahka
2026-04-01 21:39         ` Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 4/5] selftests/net: Add bpf skb forwarding program Wei Wang
2026-03-30 22:31 ` [PATCH v9 net-next 5/5] selftest/net: psp: Add test for dev-assoc/disassoc Wei Wang
2026-03-31 14:04   ` Daniel Zahka [this message]
2026-03-31 22:09     ` Wei Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=956aefbd-b795-48be-ab73-58f489b1b535@gmail.com \
    --to=daniel.zahka@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dw@davidwei.uk \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=weibunny.kernel@gmail.com \
    --cc=weibunny@fb.com \
    --cc=willemdebruijn.kernel@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox