From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85243205AC3; Fri, 7 Mar 2025 00:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741305618; cv=none; b=Ee17SF1z1P65lfFeObVBkKlNICEPMC0vqBGZm4xyTWZ4pOmxFREaYTjQoq+q6A1CGDV9VkifsIXChFYMv2LZXwB6vOsSc0Bn4DCAW63zw4Ef12oiLwCxK4hDHY3QCu4jKi/r0CM6rkTVQuMH6XKiiiILBsJiUHCwbGD7hWpa2nY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741305618; c=relaxed/simple; bh=FItWwzoS9Lbo2L/BMi14HcuJ9QdtDuU2oO98zy6iKf8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tPTSRC101CpeFCUaQwE6MNYD6mtknqgJBh8Qi3f2Z1B/giHBNSa+DxEqSiSjW7Dbs6CC56kefZAS8dzEaIHpGTngOLNbanBNTW9qzpHzZ8bws8p4apuhyIQnlE07jb9oG2j5X0B8SD62hc7qnM29TY0ijqMZyoDIVpneRsetp58= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LWLOl93m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LWLOl93m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9110C4CEE0; Fri, 7 Mar 2025 00:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741305618; bh=FItWwzoS9Lbo2L/BMi14HcuJ9QdtDuU2oO98zy6iKf8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=LWLOl93mJHqGw4SEHsYpwhbBZukDSnlegW3FMgwkvrkreHweHjKD5bwT5LrDVO0+q pNrnrSqq6jYccfEfux7FudVqXVoL165wEoCmf/zvAgEvDaEM0ELFYMtJCT4yVCiRMb vFf63LgLlnPjwozGB+APzxhJljXRGore9DxuHZkDfun+k7jQo+wSv0RmbeWAw+WPIt LvNEjWSjeamjkkA+QVw05DC62DuKG/cpuXQn0pXlZ9nK67rhibIPnY/XKV87LoxVbk k2Bmh/fxaUslIyhiwAlvL3YsF5of73d26xmBblqMrIKmgIlINRJFCISEIGlVxHogG6 gScxHHtrRysfQ== Date: Thu, 6 Mar 2025 16:00:17 -0800 From: Jakub Kicinski To: Willem de Bruijn 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 Message-ID: <20250306160017.1a385f6e@kernel.org> In-Reply-To: References: <20250306171158.1836674-1-kuba@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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?