Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5326103imm; Tue, 21 Aug 2018 09:49:02 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyY/2phsdz/q7AW5/FjMhnEM9pdQEhhakOmm5Dq8M6agnIi6EOvScIOg2ARGLnnn/Iop1Yu X-Received: by 2002:a17:902:710c:: with SMTP id a12-v6mr12827898pll.28.1534870142839; Tue, 21 Aug 2018 09:49:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534870142; cv=none; d=google.com; s=arc-20160816; b=lWQuqN0Cq91ql8LI4xzK1FkBvShnRBOjFwE3RG5benHSixCTpxgyA5Hg1EG7KY0zOu Yl5aLTw4bJ5yB3nX2przE8XPt4itzgIVvPDd7rVhmVBbO3FF3Bx4I33Q2HLwWgph3BlL 3oG8Lirl799Qrag4GVkCVUDy7YLEDYgzuy4vynxu69Ul4LGEK7VUjcDPN5qTcsfZozbU Ay6gjYuQAg9UpArsHvZcGfCHPdafciYrrFYlQCU/UjMVRrYQln1Va9yqWuhjS0YIEACd e+RBuc9DGsBHMn2P7Fct1AzJobPAERBzKm+89AmoGgKhmIThXWr8uCKgyIy94pWDTzjN Bmkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=BDkEf5k9dkHjOup5CUjO5xVZWg/tALtAYkBjHOV4qb0=; b=Y1o0Nn11Nr3B6OUn4lI/dAjTCFQ7bh2IniCD2KB9dUHJKNUMSrHPR9K9wrFJsAx3yM ZbUF+ECrGQuih6xnAWrtMfQy4JzdfxEjv3LShF64zeHtITtdJ3MCN9XgWUcWqZZqTYJH MrITD/k91oGIBoeD/m1A7V+bShQ5lsElDymXeCb/C9B/3ag8LUGXt3vw5Og5nooEuaEd yMWvoxzv5sk0dfC/QxRc7M+aTFk4B4ei/glVoTkQMl6QcnkTqmHVvuUGWeeIZOwZLvi2 PPh+LWlQI/XXOA4iKjjdIHacR08aUmqLuwRBNPN6/4rQ7QIupBr27SQCpmH5Z4yI6HYp Ji1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=GIZvi5KQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27-v6si11883321pgc.152.2018.08.21.09.48.47; Tue, 21 Aug 2018 09:49:02 -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=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=GIZvi5KQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbeHUUHr (ORCPT + 99 others); Tue, 21 Aug 2018 16:07:47 -0400 Received: from mail-ua1-f66.google.com ([209.85.222.66]:35364 "EHLO mail-ua1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbeHUUHq (ORCPT ); Tue, 21 Aug 2018 16:07:46 -0400 Received: by mail-ua1-f66.google.com with SMTP id q12-v6so12247707ual.2 for ; Tue, 21 Aug 2018 09:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BDkEf5k9dkHjOup5CUjO5xVZWg/tALtAYkBjHOV4qb0=; b=GIZvi5KQOyhTH7pC2aD7FcQJAoUoP3jsmY06U0sjBYjUKj4p35CnNB1tIkmSyrfSce aanGZVyPPis+/VzdTJFH258JsCQ1wnO5urftGRbUx4FAgQNPGA69TCmwSzqPIg6/DxNG XOw5YSxPMK/VKF5wR1YWU0i83g5IVkVbNYKrgUZAPu2YTOMB02mhn3tFYhiQYAbuth82 G+iJXMWCRqaExMn6utekKm+lsOqmoUFMJIjDRMTOqdX0PPZPJ0UF7Rk9heoFqpu23xxO ZlafeapcNleKpBddXPEC9sHT236DKAOgshsBPWjPPQXh2snz+S6ARSQYp/fDOHV2tMPf 3brw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BDkEf5k9dkHjOup5CUjO5xVZWg/tALtAYkBjHOV4qb0=; b=tDWQzjOx0IkAufbDQcbbIV0/FedBeUvvctrZHrzaDc7FGf7qPZRhTw7ubFOnG3vTmD yy4e2KJy5+IYHqG5U2QOsrrPbik0ana+mgOXJTmEdcOl8cnU44Dj/017Br/UtrOWIPpO kyFiQBB8gQGJjWse8pZP1WmwR0zCQmPx+ldhhWKT/TMR001NPG27Bm9JO/6uuvsZTmgI vdYpuHRqCeQLkCG6V/ahvLDwuYIgndrNi8QRoXML7mTRnZ0EUb6w6nbNXLwnq4f1Rm09 04La5ciH6X2Ug8m/z0RAJHB3j8OY85f+rbvk1X20WQVx+tWDhtLW3rwlzfSru8yCyAGT HBuA== X-Gm-Message-State: APzg51DeT5n5+d8UyyfVDpY4Q4Zay+eoJEVEaI68/8UaZXuZs+6vQj6k 6JbHv/CzlPb95v8WLOsJWAlDNX6eFetRX69X2X5SFYgU5Ttm8A== X-Received: by 2002:a9f:3968:: with SMTP id i40-v6mr3428144uag.63.1534870012926; Tue, 21 Aug 2018 09:46:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9f:2a87:0:0:0:0:0 with HTTP; Tue, 21 Aug 2018 09:46:52 -0700 (PDT) In-Reply-To: <20180821161258.19718-1-treeze.taeung@gmail.com> References: <20180821161258.19718-1-treeze.taeung@gmail.com> From: Jakub Kicinski Date: Tue, 21 Aug 2018 18:46:52 +0200 Message-ID: Subject: Re: [PATCH] libbpf: Remove the duplicate checking of function storage To: Taeung Song Cc: Daniel Borkmann , Alexei Starovoitov , Linux Netdev List , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 21, 2018 at 6:12 PM, Taeung Song wrote: > After the commit eac7d84519a3 ("tools: libbpf: don't return '.text' > as a program for multi-function programs"), bpf_program__next() > in bpf_object__for_each_program skips the function storage such as .text, > so eliminate the duplicate checking. > > Cc: Jakub Kicinski > Signed-off-by: Taeung Song Looks reasonable, but you may need to repost once bpf-next is open: https://www.kernel.org/doc/Documentation/networking/netdev-FAQ.txt Acked-by: Jakub Kicinski > diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c > index 2abd0f112627..8476da7f2720 100644 > --- a/tools/lib/bpf/libbpf.c > +++ b/tools/lib/bpf/libbpf.c > @@ -2336,7 +2336,7 @@ int bpf_prog_load_xattr(const struct bpf_prog_load_attr *attr, > bpf_program__set_expected_attach_type(prog, > expected_attach_type); > > - if (!bpf_program__is_function_storage(prog, obj) && !first_prog) > + if (!first_prog) > first_prog = prog; > } > > -- > 2.17.1 >