From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 655CBC3F68F for ; Fri, 20 Dec 2019 10:50:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B3642465E for ; Fri, 20 Dec 2019 10:50:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HkuQSnhA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727202AbfLTKuX (ORCPT ); Fri, 20 Dec 2019 05:50:23 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30255 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727177AbfLTKuW (ORCPT ); Fri, 20 Dec 2019 05:50:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576839021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zMpOOo3iufJ9ca6/YVFrdxmrvBnoxtNnRc6ySdLQkNQ=; b=HkuQSnhAvtOJTCGXuXjDjyLoUOUISo9E/XNngyhp/F0M0+Pjtt/llnK0TGVjamzdTU4eIf nS9oWdoWpfhWvZE+LrS1o/J45+TxqqJwREpk1Ulo7pypzbEc/WSeCtEfMwJQe3czFsUZnE +j5UO3GFrBavYVhMkLGXkUuwYFpwqjE= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-CEQbskIeMHehzSE0_C_uUA-1; Fri, 20 Dec 2019 05:50:20 -0500 X-MC-Unique: CEQbskIeMHehzSE0_C_uUA-1 Received: by mail-lf1-f70.google.com with SMTP id z3so1058463lfq.22 for ; Fri, 20 Dec 2019 02:50:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=zMpOOo3iufJ9ca6/YVFrdxmrvBnoxtNnRc6ySdLQkNQ=; b=MGZfD7Wg8WAbsSvHkBrniNFv6yfEQsePCmhSSS7UsqiXrG2bnOOe6hozHatwVzty+u e4fHkRjhOjSthwXychBPaXZh09xe/9jV+sv9ldzAqvJ17uUHDjPN3P3hEGNxSZFxd9qP A16Q9QqSOV6IQNR9YGtgNmyubPI8cMQn51c2Mfr0l6KvKJIEt51qheNWrMdkw97P7xH4 kpOV559ges25ZHw90+fia3SO3A9m09WGeSIOM1SvqhLIBJOebfoXUyuwPxtTLOibQI9C LHUMsQCpXA4PGKsOjO+EsjE0MJtjf1VO/1X+N8E3Lttx3BHyx0M9NCEJvV/UpwHwYyQ+ XhkA== X-Gm-Message-State: APjAAAXa5xN/NATl7SJPpJT09Wroyv/60/mv8eL+EsYcC+X2mcV6Hmlm B7slCzCi5uEFccxmdo3VOh86C/r8fG6HwJ4hpcxZgS5m9/pM+OKsERWwkm1jccgpGM0JNznYx4d 6wGn/D6IfUTtNFH3r X-Received: by 2002:a2e:721a:: with SMTP id n26mr9399419ljc.128.1576839018156; Fri, 20 Dec 2019 02:50:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxWai7mH5bN6DUYqYikkEJa3ngKRJyCOOPV4p4up1n/uVniG9/nnEFiXV1TbCsg5IX8+FwN8w== X-Received: by 2002:a2e:721a:: with SMTP id n26mr9399405ljc.128.1576839017992; Fri, 20 Dec 2019 02:50:17 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id x21sm4010516ljd.2.2019.12.20.02.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 02:50:17 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 98282180969; Fri, 20 Dec 2019 11:50:16 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Andrii Nakryiko Cc: Daniel Borkmann , Alexei Starovoitov , Martin KaFai Lau , Song Liu , Yonghong Song , Jesper Dangaard Brouer , David Miller , Networking , bpf Subject: Re: [PATCH RFC bpf-next 1/3] libbpf: Add new bpf_object__load2() using new-style opts In-Reply-To: References: <157676577049.957277.3346427306600998172.stgit@toke.dk> <157676577159.957277.7471130922810004500.stgit@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 20 Dec 2019 11:50:16 +0100 Message-ID: <87eewz2rvb.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Andrii Nakryiko writes: > On Thu, Dec 19, 2019 at 6:29 AM Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> >> From: Toke H=C3=B8iland-J=C3=B8rgensen >> >> Since we introduced DECLARE_LIBBPF_OPTS and related macros for declaring >> function options, that is now the preferred way to extend APIs. Introduc= e a >> variant of the bpf_object__load() function that uses this function, and >> deprecate the _xattr variant. Since all the good function names were tak= en, >> the new function is unimaginatively called bpf_object__load2(). >> >> Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen >> --- > > I've been thinking about options for load quite a bit lately, and I'm > leaning towards an opinion, that bpf_object__load() shouldn't take any > options, and all the various per-bpf_object options have to be > specified in bpf_object_open_opts and stored, if necessary for > load/attach phase. So I'd rather move target_btf_path and log_level to > open_opts instead. Hmm, yeah, don't really object to that. I do think the 'log_level' is a bit of an odd parameter in any case, though. If I turn on verbose logging using the log_level parameter, that won't affect the logging of libbpf itself, which was certainly surprising to me when I first discovered it. So maybe rename it when adding it as an open option ("verbose_verifier" or something along those lines?). Anyhow, given your idea with having a separate bpf_linker__() type, this is not really needed for linking in any case, so I'll just drop this patch for now... -Toke