From patchwork Tue Jul 27 04:10:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juhee Kang X-Patchwork-Id: 488588 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.7 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, URIBL_BLOCKED, 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 438F7C4320A for ; Tue, 27 Jul 2021 04:11:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F14D60F44 for ; Tue, 27 Jul 2021 04:11:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233760AbhG0ELI (ORCPT ); Tue, 27 Jul 2021 00:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231361AbhG0ELG (ORCPT ); Tue, 27 Jul 2021 00:11:06 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33F5AC061757; Mon, 26 Jul 2021 21:11:06 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id b6so15961160pji.4; Mon, 26 Jul 2021 21:11:06 -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=ZOkKQ9mkCrA/qKt17/VrVIc8lBqLzH6oDA9OLUrqsLg=; b=j+UUCcJ0m+14hlwaznZVmHvpFYYB4iQJqThy2jxxWCrpSyiDxy281u59mJaijMiAvb jaKoYw+oIzbTAvvU/Pl/pLVAeKMjGd7X4jPrGErNqQAGGDQ1MJwf8vxWFKkykn7oy9ul 7dP4xIxA5jA0M9DPAdcYXfEMvqOdi6meD182lL8s0QjxdtJ1DHVHT6CQwCGUMCvZx2W4 02AG+bjrGF1gsSAsS0f3SxTaa0uBn+REAK9T6XZ6VSDd/fo5EDI9Wdi4UQgJzibUpTo2 nD90UZ2pZDD6k9bZ+yTPm7GG74OsDcjQ4D5Sv892g7aEW0ktmx7F5OdBWwLV82cG4b8x x6+A== 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=ZOkKQ9mkCrA/qKt17/VrVIc8lBqLzH6oDA9OLUrqsLg=; b=MeJ20jT5gtiSlyaXZQXqIMcumd9YRxKeofY3W5xU0SD5d5el3+zN/2TM9ZBHvnq+z0 Pu6MNmJmXNE5ohUAGpdzQE3RTtJ+sMCMs6RNvVtlpypm9thsA7Yq/CFw1IkPavVOol+i IBg2cYjQ1OCnzHDpGCfluqQtpWrkTYmMdJF9xkMxOLNAQOflnH5qxGSHE4RICygbE7dt V/z02mMq40JTn8XOpJxsBfn4L0ijMzIyriHiLBfm3lxr9U7yfiRGCun5VKl9xKH989Qy PNhycjq7gc1XDNQZf0kKwGR/SRqTv2T65UU8KFEPj9c0k1bBOt50bMsX7EbppuaIzpSn ShQA== X-Gm-Message-State: AOAM530Gjyi9O6Mg3oTN9xVNOPYNPRoPA6F8/8lqQRDTetOmX2AldLqe 4pGtx8BeWPcz83qOb08F3L0= X-Google-Smtp-Source: ABdhPJy34SnLNcMy/4Hy814wU8BxlaglEkiGaDxa+XAFhJuwwVb+PtmTf0LOf1Qle2pFypECDx4cww== X-Received: by 2002:a62:1c14:0:b029:34a:70f5:40da with SMTP id c20-20020a621c140000b029034a70f540damr21425236pfc.37.1627359065665; Mon, 26 Jul 2021 21:11:05 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id p3sm1493866pgi.20.2021.07.26.21.11.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 21:11:05 -0700 (PDT) From: Juhee Kang To: Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Yonghong Song Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [bpf-next v2 1/2] samples: bpf: Fix tracex7 error raised on the missing argument Date: Tue, 27 Jul 2021 04:10:55 +0000 Message-Id: <20210727041056.23455-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 --- Change in v2: - change directory remove option from -rf to -r 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..35db26f736b9 100755 --- a/samples/bpf/test_override_return.sh +++ b/samples/bpf/test_override_return.sh @@ -1,5 +1,6 @@ #!/bin/bash +rm -r 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 Tue Jul 27 04:10:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juhee Kang X-Patchwork-Id: 487387 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.7 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 E4F4EC4320A for ; Tue, 27 Jul 2021 04:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC1A460F4F for ; Tue, 27 Jul 2021 04:11:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234608AbhG0ELN (ORCPT ); Tue, 27 Jul 2021 00:11:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231842AbhG0ELI (ORCPT ); Tue, 27 Jul 2021 00:11:08 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31F0DC061760; Mon, 26 Jul 2021 21:11:08 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id c11so14237910plg.11; Mon, 26 Jul 2021 21:11:08 -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=JMajMSbrz6jIETxWQrupvDuj8oMJlpeN6SfFa+yn8NBvMXHspLLtz38FYe/YoDv2Nt 8k8sTKDARzFUv9b5TlL3oCV4rBsD2Krkzvd8OqKsWg7+OVOXGQISwgUpBKkoTAMvj10B LubPlCt9Berw4/zI7Vj3o4ermiWanEeoDeoA0xnfOtQLhxlhmATsMyGCsGSEmjArG/uc SzV/rDDGIlFQencByd0hxZ847sfdYIRf9cVCvyonBRuDXTnDBN0h4nvPPtgc55AVIIIl aTduj9UNfwT7y869gkzhbPWDl7FaAkpuqkJ1K+kR3cYpNsv4a8R0FK9BWaRp7Kr4l0/Z HO+Q== 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=IF5JRplNRtwEMEvo4hrvTSTqfrXmcfjAZsFcOnoULJSETY7r63n8N9OYL7e0MHs8eW mvi+7D+hbkvmXiRazeKtpxbcaEHv+Ixj9q00j3Mp6/JvUqg62HY6ZwTcRCYeEsevFN21 R91cWA7fzBaAjZ24LbuD3CY9QCieAf4EbnUPuyQZrQb7vBe/jIcN+2w2d49Y93FcjZpm 62nU4JLykg+tmc2wOt5E/c08y470/TVrh7KIKXEQhLSZQGShyAOJrYQNpaSRWt8/BbWV Xe4Y/YN6gL4OCMSjO+bAQuIcGxnbFLmrz46b/1hSbVP5e/uylmUZUvA0i6so/jrL7PI1 OyXA== X-Gm-Message-State: AOAM530OZ0N2AAbGmBi8KzBmC33hWrPjusUy+/0uzfzSlyCCS3izGedn 5n3Pe/sHo2434KEeIkYaok0= X-Google-Smtp-Source: ABdhPJwJ1xXU9+7YooWY30U9PI49GilcOic+Az1jVR8aLQrIzBxWCFBWte3/N1KlnN+nFubI9qlCGg== X-Received: by 2002:aa7:90cd:0:b029:333:baa9:87b7 with SMTP id k13-20020aa790cd0000b0290333baa987b7mr20911504pfk.23.1627359067723; Mon, 26 Jul 2021 21:11:07 -0700 (PDT) Received: from localhost.localdomain ([182.209.58.45]) by smtp.gmail.com with ESMTPSA id p3sm1493866pgi.20.2021.07.26.21.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 21:11:07 -0700 (PDT) From: Juhee Kang To: Daniel Borkmann , Alexei Starovoitov , Andrii Nakryiko , Yonghong Song Cc: netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [bpf-next v2 2/2] samples: bpf: Add the omitted xdp samples to .gitignore Date: Tue, 27 Jul 2021 04:10:56 +0000 Message-Id: <20210727041056.23455-2-claudiajkang@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210727041056.23455-1-claudiajkang@gmail.com> References: <20210727041056.23455-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 --- 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