Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>,  Willem de Bruijn <willemb@google.com>
Cc: davem@davemloft.net,  netdev@vger.kernel.org,
	 edumazet@google.com,  pabeni@redhat.com,  andrew+netdev@lunn.ch,
	 horms@kernel.org,  shuah@kernel.org,  petrm@nvidia.com,
	 sdf@fomichev.me,  linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net-next v2 1/2] selftests: drv-net: add path helper for net/lib
Date: Thu, 06 Mar 2025 20:31:08 -0500	[thread overview]
Message-ID: <67ca4c5c91c2a_4cd7a29460@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20250306160017.1a385f6e@kernel.org>

Jakub Kicinski wrote:
> On Thu, 6 Mar 2025 17:22:47 -0500 Willem de Bruijn wrote:
> > > +    def lpath(self, path):
> > > +        """
> > > +        Similar to rpath, but for files in net/lib TARGET.
> > > +        """
> > > +        lib_dir = (Path(__file__).parent / "../../../../net/lib").resolve()
> > > +        return (lib_dir / path).as_posix()
> > > +  
> > 
> > small nit that one letter acronyms are not the most self describing ;)
> > I would initially read this as local path
> 
> The other option that came to mind was to have one helper called path()
> and pass rel=CONST to it. For example:
> 
> 	prog = cfg.path("xdp_dummy.bpf.o", rel=cfg.NET_LIB)
> 
> Thinking about it now we could also store dir directly, which is
> probably most "Pythonic"?
> 
> 	prog = cfg.net_lib_dir / "xdp_dummy.bpf.o"
> 
> Thoughts?

The pythonic approach is nice. No function indirection, so self explanatory.
But they all are reasonable, of course.

      reply	other threads:[~2025-03-07  1:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 17:11 [PATCH net-next v2 1/2] selftests: drv-net: add path helper for net/lib Jakub Kicinski
2025-03-06 17:11 ` [PATCH net-next v2 2/2] selftests: net: use the dummy bpf from net/lib Jakub Kicinski
2025-03-06 19:35   ` Willem de Bruijn
2025-03-06 20:56     ` Jakub Kicinski
2025-03-06 22:20       ` Willem de Bruijn
2025-03-06 22:22 ` [PATCH net-next v2 1/2] selftests: drv-net: add path helper for net/lib Willem de Bruijn
2025-03-07  0:00   ` Jakub Kicinski
2025-03-07  1:31     ` Willem de Bruijn [this message]

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=67ca4c5c91c2a_4cd7a29460@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petrm@nvidia.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=willemb@google.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