From patchwork Sat Jul 24 15:21:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juhee Kang X-Patchwork-Id: 485797 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 C4887C4320A for ; Sat, 24 Jul 2021 15:21:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A467E60EB6 for ; Sat, 24 Jul 2021 15:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbhGXOlH (ORCPT ); Sat, 24 Jul 2021 10:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbhGXOlH (ORCPT ); Sat, 24 Jul 2021 10:41:07 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FBFBC061575; Sat, 24 Jul 2021 08:21:38 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id pf12-20020a17090b1d8cb0290175c085e7a5so13313130pjb.0; Sat, 24 Jul 2021 08:21:38 -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=r1ag42xDJLaVY9xMBOItoSUvNhhk/9cVUCkJzLTzDvQ=; b=mM/h6Y0Xp2tak1Q0gjkuodOOFbWbpGPQl2csWweB83zYfGaDkW4/6KwIbZx1EJYeHO Uzq/hBGAC0AWmVgmr2gz7r5ZdWPm7vNyOKYRabGFIz/NBj2Gc9ipt/Jr5jbHiNsGjW0S S8uGOxVy1BIcBhWDg7D2avedI/8ZW6T7mjr0qeUych064RLL8aCsZMjLTIvB1eNgaes/ Rcn2GDDRbSWc6swNKRMErxQ5rFVOPhoqVYSgdtn+cKbTMa8gFN7joyDJ1w+cquyRPsZ7 96QwyoWK3NPc8ugYnZ48U1SmNPAv6P5Rj+1tgP8AGUWOs8rRw/B650bxuclkH2nMoWmD X8fg== 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=r1ag42xDJLaVY9xMBOItoSUvNhhk/9cVUCkJzLTzDvQ=; b=Frqot/f3Ja+rg3s/iuumiljs4fsBrwCW3CvdqCQhM1z/+dUyOBX307bN1A2BxGEq/I 0nIdf+qk7nrsEG134ACgux9ZLT7eR8pHaANz7ATTW/5vBM9Sf5DTzZMytJY2Tz2DG+qy Ylw+gJU9S1vQXhtSkThCE6XqWTudc9JlnzJKpBjx8mXMWN4JoXn5DqyiNnjTrQ/KLrvC bnA8sOII3Xx2ptyUgHp9cMWLApcCPuLDOYNZt4rhNwBsTK+a70ilHZVukIEd2eqgis0U oRA+Sr0h0dab6+ASSIZYip4HOEWEfziZz25JXn4ajv2oLcjivhU9VXFAcz4dU0qzD2Hh D9yA== X-Gm-Message-State: AOAM532KrlGkocIdOcVswDnoI8xCEp0YZoZPsyQwAPh1zTkocB+edZPI zwAQwdQiB6iI7jL44omES9M= X-Google-Smtp-Source: ABdhPJzc3WyvYVYK072FmsaT7J14rCP2CimF9HW8rLoggrzLrngQcfYDmXLWOP/6jm4c7srG//tgzg== X-Received: by 2002:a63:dd46:: with SMTP id g6mr9953964pgj.347.1627140097789; Sat, 24 Jul 2021 08:21:37 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id w22sm36682527pfu.50.2021.07.24.08.21.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 08:21:37 -0700 (PDT) From: Juhee Kang To: Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [bpf-next 1/2] samples: bpf: Fix tracex7 error raised on the missing argument Date: Sat, 24 Jul 2021 15:21:23 +0000 Message-Id: <20210724152124.9762-1-claudiajkang@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The current behavior of 'tracex7' doesn't consist with other bpf samples tracex{1..6}. Other samples do not require any argument to run with, but tracex7 should be run with btrfs device argument. (it should be executed with test_override_return.sh) Currently, tracex7 doesn't have any description about how to run this program and raises an unexpected error. And this result might be confusing since users might not have a hunch about how to run this program. // Current behavior # ./tracex7 sh: 1: Syntax error: word unexpected (expecting ")") // Fixed behavior # ./tracex7 ERROR: Run with the btrfs device argument! In order to fix this error, this commit adds logic to report a message and exit when running this program with a missing argument. Additionally in test_override_return.sh, there is a problem with multiple directory(tmpmnt) creation. So in this commit adds a line with removing the directory with every execution. Signed-off-by: Juhee Kang Acked-by: Yonghong Song --- samples/bpf/test_override_return.sh | 1 + samples/bpf/tracex7_user.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/samples/bpf/test_override_return.sh b/samples/bpf/test_override_return.sh index e68b9ee6814b..6480b55502c7 100755 --- a/samples/bpf/test_override_return.sh +++ b/samples/bpf/test_override_return.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -rf tmpmnt rm -f testfile.img dd if=/dev/zero of=testfile.img bs=1M seek=1000 count=1 DEVICE=$(losetup --show -f testfile.img) diff --git a/samples/bpf/tracex7_user.c b/samples/bpf/tracex7_user.c index fdcd6580dd73..8be7ce18d3ba 100644 --- a/samples/bpf/tracex7_user.c +++ b/samples/bpf/tracex7_user.c @@ -14,6 +14,11 @@ int main(int argc, char **argv) int ret = 0; FILE *f; + if (!argv[1]) { + fprintf(stderr, "ERROR: Run with the btrfs device argument!\n"); + return 0; + } + snprintf(filename, sizeof(filename), "%s_kern.o", argv[0]); obj = bpf_object__open_file(filename, NULL); if (libbpf_get_error(obj)) { From patchwork Sat Jul 24 15:21:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juhee Kang X-Patchwork-Id: 485579 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 AB680C4320A for ; Sat, 24 Jul 2021 15:21:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8967E6056C for ; Sat, 24 Jul 2021 15:21:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbhGXOlK (ORCPT ); Sat, 24 Jul 2021 10:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbhGXOlJ (ORCPT ); Sat, 24 Jul 2021 10:41:09 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CB14C061575; Sat, 24 Jul 2021 08:21:40 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id a20so6780959plm.0; Sat, 24 Jul 2021 08:21:40 -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=YO+3D7atNziJ00YoEqVQ4u+r3Pt08MtNO7aczD+MpIs=; b=sWfQx2byWQ2XbJr/7AlVtlK+ZHLARyzVkDMrboDJKFf+GGtHlDyNOcUH9Fz6pW0BxK HFl8sBcz84XqB8IoGhvXpwJhdrr/g019BHk/B+geRKW4CFa3ah9x1+sugScKHyKYQFtd dGW4HhjyROkKhkDAb0YWhwwNkiR+olAKeHNL0Ih1bkxKm8z2NG+WAhCmvFFJtsDEjaKe LWztnqEFO1lT6ynyvimLd3hricLi+OCSm21JgErch+qkRmDeSKqNH7Gp6bX5/1lqw/FN /kuA1yNVR82ztAuIty/5EAUykzj9HjJfLSxV3Hi4ZvsDPqv+CavIroHhZ3BtM0vcRv42 1rig== 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=YO+3D7atNziJ00YoEqVQ4u+r3Pt08MtNO7aczD+MpIs=; b=HiB23Om8ijLcMUnOrCGsgQX5WV/7Grujxu9VQFYbN4tjqYMDDuHY6+RoUzV7ILXaMB gDoUgTNpP1HEhZMC1/Hntupih61x+0GExaDEdAzTkMld3+1sjuzOWU6zcgbJ/s62tduX dmtTP1eaJUR3oE23c0Of6EUinSewOF8tkiytovphTPtdeP/POTjbEzuG1bpWVD/m6qTX dNAfl19GuhCEl6P7P4lZtH1lmQrTmW/hfUiR/6vRfi9THRZpn0I1OD/DxaX3Ic36+E8M sCT4AjO+FWXkcAdrYJCq0/4WpKe1OwCsFN1XMUl77MJgw2QMx5Bo1+oR/b+28SnJt5Bm 0tkA== X-Gm-Message-State: AOAM53189qe22pcRYzKL0HEPjLYEPOqTRV0Zk2hDFwE0qYuo+6EM1FCi IoLBZSi/QVKN0ucWsCANmBE= X-Google-Smtp-Source: ABdhPJy16SLT3P10eQ03C9l87/erJd/C/uV7Tf0YFLXDviZnwUZE/S9GPDy+jKPj3Vp4SB9zFA/Ykg== X-Received: by 2002:a63:1551:: with SMTP id 17mr10016420pgv.76.1627140099737; Sat, 24 Jul 2021 08:21:39 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id w22sm36682527pfu.50.2021.07.24.08.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jul 2021 08:21:39 -0700 (PDT) From: Juhee Kang To: Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [bpf-next 2/2] samples: bpf: Add the omitted xdp samples to .gitignore Date: Sat, 24 Jul 2021 15:21:24 +0000 Message-Id: <20210724152124.9762-2-claudiajkang@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210724152124.9762-1-claudiajkang@gmail.com> References: <20210724152124.9762-1-claudiajkang@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org There are recently added xdp samples (xdp_redirect_map_multi and xdpsock_ctrl_proc) which are not managed by .gitignore. This commit adds these files to .gitignore. Signed-off-by: Juhee Kang Acked-by: Yonghong Song --- samples/bpf/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/bpf/.gitignore b/samples/bpf/.gitignore index 0b9548ea8477..fcba217f0ae2 100644 --- a/samples/bpf/.gitignore +++ b/samples/bpf/.gitignore @@ -45,11 +45,13 @@ xdp_monitor xdp_redirect xdp_redirect_cpu xdp_redirect_map +xdp_redirect_map_multi xdp_router_ipv4 xdp_rxq_info xdp_sample_pkts xdp_tx_iptunnel xdpsock +xdpsock_ctrl_proc xsk_fwd testfile.img hbm_out.log