Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3422086ybn; Fri, 27 Sep 2019 06:13:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyajjXWFbEcwQvb9QjcWQE+d5NcA5g9SpHzksEHEsOznJLTA6afxb/FeAYqSbwPswFfjK8a X-Received: by 2002:a1c:1c7:: with SMTP id 190mr90148wmb.23.1569589987970; Fri, 27 Sep 2019 06:13:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569589987; cv=none; d=google.com; s=arc-20160816; b=QX5sdb0vAvMKOnS+T13OpiasI5KzgjNps3rpOHM29C39s3+urkTKDcya4kMAkvE4hv jCzlVXtYaCljwJkl/RnBMRtnHVdEFiqwX4LTuQipty8TPv8dO4NGA1QLgoCz17mzdYpx V56LCnS6JiSFwy54nnIKOCCxVmoNhgUySFGNDpLB/hM7+FZvC9MFar4QAwaax/yKMq9O CKvaX8MPzWk4adBlodrfUNDcr5qI07/plLD6A/Y9KbeWsVSP91fzTeynNvatpOKxjVOm TWWfpdNyFCWKVIq8G9U1xH5c13AL2ppWqtMmf3uKYijWtrc9LMaGSGH6IkpZ/j0/igR9 Yfvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=r/YlMd+ABdbFqVfQSuisclIe5RaTInuYhTyrlp7UJqI=; b=hSpiTSR7yMeDeKTUcoRF8vL1VvjTCIclORhcAMRHHGCQXgEKez8osR8ICHsp6+PkKO LFDDS8Dl53aZ/+g3orUuTEn2ebitPPQmO0BWhbtF6B/Z251IPZW0YHVIDE/wQLoLPpFv NOsCaR0O4QjznGBX6spEiJy427IqVqRgPi3yHV1AHzbCPc0zY/gZFwRaFBQ1H2OlInpr ncZU5tGth2qPtcynX++D5vxtRXvCvnBJv9byREkKN8IputB6JSJBOUZOw8mF2Eq+ez9C 9EQXY4xIO68nTLgExwd+ZALfZqAPqf6bdZYmx+Yb5F8ntButjOSX8szwqoAVVUyzcGej EIvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LwB7iZ62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x30si1481155edi.351.2019.09.27.06.12.41; Fri, 27 Sep 2019 06:13:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LwB7iZ62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbfI0NMG (ORCPT + 99 others); Fri, 27 Sep 2019 09:12:06 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:38408 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbfI0NMG (ORCPT ); Fri, 27 Sep 2019 09:12:06 -0400 Received: by mail-ed1-f66.google.com with SMTP id l21so2287504edr.5 for ; Fri, 27 Sep 2019 06:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=r/YlMd+ABdbFqVfQSuisclIe5RaTInuYhTyrlp7UJqI=; b=LwB7iZ62Q3MzwaxIUnSj4Pzy98gBm+A1KMiJbjObU2r9JHOq5qvX1sRJr7OzQ50a/1 YMxWixU8GiufOzDfTXWqBl1ocb23Z+/GcUFhiS1oC8Em8zTeH/yiNIyZgbQFNuL0aOhu 8m6Dt9Bwc4LPb34QbLXQpU2exb9l5PNJ2zedU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=r/YlMd+ABdbFqVfQSuisclIe5RaTInuYhTyrlp7UJqI=; b=hJas3NKzVLyxrFLNRGWQITBjcRtLnrvC9Vq3dYUmalgoPNYDAdyizCKrA9qdNM4w7W 5LX9xRWjYYntmhKQ4BFFgQxvAvhbA7MG0EIamWPn5aGeP+O1/iRTGtT4uxFVDr/T3Q6e An7GpNXQKnhSacivMbS83VWqnUDR+LY00Dw+Ir74+WdZ7QiiJjJx1eoNT1iKNZqr9MmL KD4GllXwuhjbKiJk85z0EFVxBlJ6PlZ/mQgp4k5LZnjOb25j9cPe2Z+DMNxqs7REXCZo DUiGQsFXtzeiijrvSLEsRHvqJFtyJ0yG5yRCkAF4t28U69d5qqSqL//GF2SjyF8zFaah SceA== X-Gm-Message-State: APjAAAVn4jsreNe+mV6rpg3Rb/FTZeAFh1Yu6CmrrVz3MFx6LuYgAj2n FCpkEUO/CdSUhii3t5sTn6EeDQ== X-Received: by 2002:a17:907:20eb:: with SMTP id rh11mr7559558ejb.25.1569589924483; Fri, 27 Sep 2019 06:12:04 -0700 (PDT) Received: from chromium.org ([2620:0:105f:fd00:440a:66a5:a253:2909]) by smtp.gmail.com with ESMTPSA id p1sm575690ejg.10.2019.09.27.06.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 06:12:04 -0700 (PDT) From: KP Singh X-Google-Original-From: KP Singh Date: Fri, 27 Sep 2019 15:12:02 +0200 To: Song Liu Cc: Anton Protopopov , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Martin Lau , Yonghong Song , Networking , bpf , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH bpf-next] tools: libbpf: update extended attributes version of bpf_object__open() Message-ID: <20190927131202.GA18934@chromium.org> References: <20190815000330.12044-1-a.s.protopopov@gmail.com> <796E4DA8-4844-4708-866E-A8AE9477E94E@fb.com> <9EC54605-1911-48B0-B33A-02EC46DEF3DD@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9EC54605-1911-48B0-B33A-02EC46DEF3DD@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-Aug 19:24, Song Liu wrote: > > > > On Aug 30, 2019, at 11:53 AM, Anton Protopopov wrote: > > > > чт, 29 авг. 2019 г. в 16:02, Song Liu : > >> > >> > >> > >>> On Aug 14, 2019, at 5:03 PM, Anton Protopopov wrote: > >>> > >> > >> [...] > >> > >>> > >>> > >>> int bpf_object__unload(struct bpf_object *obj) > >>> diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h > >>> index e8f70977d137..634f278578dd 100644 > >>> --- a/tools/lib/bpf/libbpf.h > >>> +++ b/tools/lib/bpf/libbpf.h > >>> @@ -63,8 +63,13 @@ LIBBPF_API libbpf_print_fn_t libbpf_set_print(libbpf_print_fn_t fn); > >>> struct bpf_object; > >>> > >>> struct bpf_object_open_attr { > >>> - const char *file; > >>> + union { > >>> + const char *file; > >>> + const char *obj_name; > >>> + }; > >>> enum bpf_prog_type prog_type; > >>> + void *obj_buf; > >>> + size_t obj_buf_sz; > >>> }; > >> > >> I think this would break dynamically linked libbpf. No? > > > > Ah, yes, sure. What is the right way to make changes which break ABI in libbpf? > > I don't have a good idea here on the top of my head. > > Maybe we need a new struct and/or function for this. I incorporated the suggested fixes and sent a new patch for this as we ran into pretty much the same issue. (i.e. not being able to set needs_kver / flags). https://lore.kernel.org/bpf/20190927130834.18829-1-kpsingh@chromium.org/T/#u - KP > > > > > BTW, does the commit ddc7c3042614 ("libbpf: implement BPF CO-RE offset > > relocation algorithm") which adds a new field to the struct > > bpf_object_load_attr also break ABI? > > I think this change was in the same release, so it is OK. > > Thanks, > Song