From patchwork Fri Sep 4 06:34:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel T. Lee" X-Patchwork-Id: 1357210 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=eSvsI8hU; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BjSZs6XXzz9sVL for ; Fri, 4 Sep 2020 16:34:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbgIDGep (ORCPT ); Fri, 4 Sep 2020 02:34:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgIDGen (ORCPT ); Fri, 4 Sep 2020 02:34:43 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F2DC061244; Thu, 3 Sep 2020 23:34:43 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id d19so3810721pgl.10; Thu, 03 Sep 2020 23:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Rc/G3FvCK68XOkOF3U68/RmVeAl00BksfK7WI0ZmGFk=; b=eSvsI8hUIFQ2WdwQBy5JrQyn5GOuQzQWYV5Gfg8Dw6nTc1NtSTDKRg2NgG5ACPt9zC Y1yb9kVluK6PHGVGGzdRHJvVr9E8PoR8AMh2/3Tu70ixZVCTwgR4pmrnLpwovYXljfX8 HP6QD0DG+JYKo7R9wawMSWTD7aHI16sQ5vm+EtfCX6bKMkyDTUyILh7UAKxZ7GH+PHgg 6WTFCPZ6LSmF2rPmZHNNf9wAnDg1Xp51rdcWtWWmMwevfUGIH4gE+ZI4X9hk/fagFWWS QirFFj+sOB6fzbDnJJzaMIF4eqfOTRDmIVRhHL+ThQ+FXm81DY6IixabqzpIZM1dvRiE iZdg== 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:date:message-id:mime-version :content-transfer-encoding; bh=Rc/G3FvCK68XOkOF3U68/RmVeAl00BksfK7WI0ZmGFk=; b=gFv0w9XS28aa4Aj9WSMCR69WBPIZHVeEZwSCWtg6WWCC1fCnuwZF35zuJE5hE2Z/Iv yPNo844v/c5cH4qs31EcY/FSVwzNQ0xGxqwkd8aRd3O4xVHF1M3wM85U0k3qbu6+tfdc tw2DnkZ47eyWz968m50XC3VdCKx6jhR65Lxiaf7rkJgmrEsr9qKOK66hyjljxUEVxeLG b24rMw7FktWvIgVR/+HZDgEkOh6dJu3jpCgV37lNEhMkNpBEeup1baAwY/QwQM7qeWq1 ryXsiDhgjfhtpX5+ko8nQ7Qt5SqE5XAcVItEAND+Tk1WiyXQX7l/ddEFQRFcYsxugPmt jOhQ== X-Gm-Message-State: AOAM531McgsY8y7BrDYuDGfEV8jbKmF/qntinP7qKDm3QpZ/iwtFEgjO SGOMe2APjrj48xpYQLHlkg== X-Google-Smtp-Source: ABdhPJzjpgzbY9fQ0OJ179Bd6yMFJ0wTa+/Gi/JkplENpu5d6jUmE4eW864O+JkupHia/6zlLJvoxg== X-Received: by 2002:a63:1b65:: with SMTP id b37mr6200567pgm.453.1599201283170; Thu, 03 Sep 2020 23:34:43 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id l22sm5499182pfc.27.2020.09.03.23.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 23:34:42 -0700 (PDT) From: "Daniel T. Lee" To: Daniel Borkmann , Alexei Starovoitov Cc: Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH bpf-next 1/2] samples: bpf: Replace bpf_program__title() with bpf_program__section_name() Date: Fri, 4 Sep 2020 15:34:33 +0900 Message-Id: <20200904063434.24963-1-danieltimlee@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From commit 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name""), the term title has been replaced with section name in libbpf. Since the bpf_program__title() has been deprecated, this commit switches this function to bpf_program__section_name(). Due to this commit, the compilation warning issue has also been resolved. Fixes: 521095842027 ("libbpf: Deprecate notion of BPF program "title" in favor of "section name"") Signed-off-by: Daniel T. Lee Acked-by: Andrii Nakryiko --- samples/bpf/sockex3_user.c | 6 +++--- samples/bpf/spintest_user.c | 6 +++--- samples/bpf/tracex5_user.c | 6 +++--- samples/bpf/xdp_redirect_cpu_user.c | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/bpf/sockex3_user.c b/samples/bpf/sockex3_user.c index 4dbee7427d47..7793f6a6ae7e 100644 --- a/samples/bpf/sockex3_user.c +++ b/samples/bpf/sockex3_user.c @@ -29,8 +29,8 @@ int main(int argc, char **argv) struct rlimit r = {RLIM_INFINITY, RLIM_INFINITY}; struct bpf_program *prog; struct bpf_object *obj; + const char *section; char filename[256]; - const char *title; FILE *f; snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); @@ -58,8 +58,8 @@ int main(int argc, char **argv) bpf_object__for_each_program(prog, obj) { fd = bpf_program__fd(prog); - title = bpf_program__title(prog, false); - if (sscanf(title, "socket/%d", &key) != 1) { + section = bpf_program__section_name(prog); + if (sscanf(section, "socket/%d", &key) != 1) { fprintf(stderr, "ERROR: finding prog failed\n"); goto cleanup; } diff --git a/samples/bpf/spintest_user.c b/samples/bpf/spintest_user.c index 847da9284fa8..f090d0dc60d6 100644 --- a/samples/bpf/spintest_user.c +++ b/samples/bpf/spintest_user.c @@ -17,7 +17,7 @@ int main(int ac, char **argv) long key, next_key, value; struct bpf_program *prog; int map_fd, i, j = 0; - const char *title; + const char *section; struct ksym *sym; if (setrlimit(RLIMIT_MEMLOCK, &r)) { @@ -51,8 +51,8 @@ int main(int ac, char **argv) } bpf_object__for_each_program(prog, obj) { - title = bpf_program__title(prog, false); - if (sscanf(title, "kprobe/%s", symbol) != 1) + section = bpf_program__section_name(prog); + if (sscanf(section, "kprobe/%s", symbol) != 1) continue; /* Attach prog only when symbol exists */ diff --git a/samples/bpf/tracex5_user.c b/samples/bpf/tracex5_user.c index 98dad57a96c4..c17d3fb5fd64 100644 --- a/samples/bpf/tracex5_user.c +++ b/samples/bpf/tracex5_user.c @@ -39,8 +39,8 @@ int main(int ac, char **argv) struct bpf_program *prog; struct bpf_object *obj; int key, fd, progs_fd; + const char *section; char filename[256]; - const char *title; FILE *f; setrlimit(RLIMIT_MEMLOCK, &r); @@ -78,9 +78,9 @@ int main(int ac, char **argv) } bpf_object__for_each_program(prog, obj) { - title = bpf_program__title(prog, false); + section = bpf_program__section_name(prog); /* register only syscalls to PROG_ARRAY */ - if (sscanf(title, "kprobe/%d", &key) != 1) + if (sscanf(section, "kprobe/%d", &key) != 1) continue; fd = bpf_program__fd(prog); diff --git a/samples/bpf/xdp_redirect_cpu_user.c b/samples/bpf/xdp_redirect_cpu_user.c index 004c0622c913..3dd366e9474d 100644 --- a/samples/bpf/xdp_redirect_cpu_user.c +++ b/samples/bpf/xdp_redirect_cpu_user.c @@ -111,7 +111,7 @@ static void print_avail_progs(struct bpf_object *obj) bpf_object__for_each_program(pos, obj) { if (bpf_program__is_xdp(pos)) - printf(" %s\n", bpf_program__title(pos, false)); + printf(" %s\n", bpf_program__section_name(pos)); } } From patchwork Fri Sep 4 06:34:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Daniel T. Lee" X-Patchwork-Id: 1357212 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: incoming-bpf@patchwork.ozlabs.org Delivered-To: patchwork-incoming-bpf@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=bpf-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=M9pmWJ1j; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BjSZy51RMz9sVB for ; Fri, 4 Sep 2020 16:34:50 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728293AbgIDGes (ORCPT ); Fri, 4 Sep 2020 02:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726151AbgIDGeq (ORCPT ); Fri, 4 Sep 2020 02:34:46 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8888BC061244; Thu, 3 Sep 2020 23:34:46 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id q3so674845pls.11; Thu, 03 Sep 2020 23:34:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f5n/OPSDhM3uanqKb+YL48CfWwtA6HLpmv/RHBP/jyY=; b=M9pmWJ1jNLwnusYt/BTqHLszFVRWcQiwrJFiGA6fIFN78uDqxgZnasoyCB36eQ0zzK iV5jNdtkaPEvDdZJYSdKe2oAABYEbn4uOMIkafUK7obM9UOZ13waFtb8w1mxiJSDle65 DJVv8WT1X1aqLDMuVWlDmVE2trnG3F9JtiIKY7x0fR26kUetvqHgz5VBsHsLH8WYn1Wz xBrxvgdot8T9kfa7npF72yfCui4ZUHwyfz1Hdw1aGTZuRcHv/LS1nuuRVoOJCKy1eLZV 24JN9NGYNFIY7hfyeIwZRswMUfctD4sgrWs4aYz3tqKRrryJoyBTzwTOJdAmOAvVYzVd 8nZw== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f5n/OPSDhM3uanqKb+YL48CfWwtA6HLpmv/RHBP/jyY=; b=bXDaoXGt2yJTDLXiCvsyfsdN0wvuN8ey1CXdQPI3RSL88HBV3/93wCZD3bUbJ2s5B5 p5AfPWK9j4k7XCkvjipbbCqZK1K4CCGW63Rk8USW94SrjC9kP8jKAD9ngmlUEckPtUXj TPrV7Pc+8TOrWsQ/wv8WJqsGc1+RiktThbO7YfRwyoWLp3n6nBqKRyJQEIzcuAHVkp2e WBcOVfCxNvWSsRO2hVJZxohP8t3cwRptwwd3cdCu4brq8qD6Eu19emYAUad/homJ5FjC p3Re/eO/gsHjUSf6Ci9O1UsV+/ISyGo7wGTDNwokbyh4VAbpZCjl9W+jh7aBag2JauTV fMlQ== X-Gm-Message-State: AOAM531f/p8RPedgzTFK+6GYSdX4Gr8tWxlbXB7KTbDVQjjhLbbIfaGi 3w2iDpN7xJRO3c5QI6CD59ESBcOhmg== X-Google-Smtp-Source: ABdhPJxueensrIMi2TLmxN//NgzFa8XCyszDo0/cMO2i5wuOY4XxxhenZ7kXNP33ORay9EdxrBOtrQ== X-Received: by 2002:a17:90a:d496:: with SMTP id s22mr6488131pju.167.1599201286095; Thu, 03 Sep 2020 23:34:46 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id l22sm5499182pfc.27.2020.09.03.23.34.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 23:34:45 -0700 (PDT) From: "Daniel T. Lee" To: Daniel Borkmann , Alexei Starovoitov Cc: Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH bpf-next 2/2] samples: bpf: add xsk_fwd test file to .gitignore Date: Fri, 4 Sep 2020 15:34:34 +0900 Message-Id: <20200904063434.24963-2-danieltimlee@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200904063434.24963-1-danieltimlee@gmail.com> References: <20200904063434.24963-1-danieltimlee@gmail.com> MIME-Version: 1.0 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org This commit adds xsk_fwd test file to .gitignore which is newly added to samples/bpf. Signed-off-by: Daniel T. Lee --- samples/bpf/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore index 034800c4d1e6..b2f29bc8dc43 100644 --- a/samples/bpf/.gitignore +++ b/samples/bpf/.gitignore @@ -50,4 +50,5 @@ xdp_rxq_info xdp_sample_pkts xdp_tx_iptunnel xdpsock +xsk_fwd testfile.img