From patchwork Wed Feb 24 02:24:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Denhardt X-Patchwork-Id: 12102827 X-Patchwork-Delegate: bpf@iogearbox.net 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=-14.7 required=3.0 tests=BAYES_00,DATE_IN_PAST_12_24, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 C7614C433E0 for ; Wed, 24 Feb 2021 21:26:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95CC464F0C for ; Wed, 24 Feb 2021 21:26:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235422AbhBXV0m (ORCPT ); Wed, 24 Feb 2021 16:26:42 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53825 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234354AbhBXV0l (ORCPT ); Wed, 24 Feb 2021 16:26:41 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9365A5C0183; Wed, 24 Feb 2021 16:25:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Feb 2021 16:25:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zenhack.net; h= message-id:in-reply-to:references:from:date:subject:to; s=fm2; bh=jTVg3G4cu/UsP/usEY8GDOyu2foXdL73CsN7V9uXu7U=; b=g3eGJxbZGB5k PAC9HmqtMDv2zy0QseRDpt2ZXY9UpeDyPIGFiTyhSsInnRiO/+cPP9NSVNDCK8E7 1jXsLYdz4505S5+cQh8DHvm+mOLUCRJrI9PNV2882JvJv/YBWUnFcaIVkzDl6e+j MX1nMTTkC27bdoVyx/DAgfFV+Su6ugZsKzKz6eVHBIki0MlTZKgsbRhMYRdbV8lJ BcQTUgRKQxETQMOkg7tbMmhP7BWCvPF+9AlaNKBbk1Ul09SW8nzdK5EYzfeApiMA BwS4WNfiQRQzPmtt8Trk8ylrP1QmOlEbm0PAy7LzzAh05IGa7VbMflkukGOdjDnb 20nz8FO7Vw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=jTVg3G4cu/UsP/usEY8GDOyu2foXd L73CsN7V9uXu7U=; b=P0wY4hrNNUxLhORlzpolsDeU4C3pkb/1mCt35lTmCnL9v wt74huLdaOj/WuGB7AtaI1jHeozLU7pe6oYg3+m1bv8aSusehTv33X0yuJVlaHgv 20qipK9Br1yV+w2Pie0BhkBVBXWQSG4SPZxUHcM1wV9PznoA0/fMND/5gwtPV925 5h7MqxurYoCFxouR8OyCpgN6D3ZzHVjmSzYH/F++5WfJHfar0EXhhAD/7MuwB5xY d2wX06UyV14ShXopYyt+QjUWl6phM52zgSQYLYxw1xucMUzBtyTQhASmzO8fROMw qbNUIfKPqIApDsgtqRq+4/TwMCjTrCCoE5ZkZQAbg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrkeejgddugeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkjghfhfffuffvsedttdertddttd dtnecuhfhrohhmpefkrghnucffvghnhhgrrhguthcuoehirghnseiivghnhhgrtghkrdhn vghtqeenucggtffrrghtthgvrhhnpeelleeggffguedvgfelgeffleduudeltdetgfegie dvkeegfeefieffuddvjeejffenucfkphepuddttddrtddrfeejrddvvddunecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepihgrnhesiigvnhhhrg gtkhdrnhgvth X-ME-Proxy: Received: from localhost (pool-100-0-37-221.bstnma.fios.verizon.net [100.0.37.221]) by mail.messagingengine.com (Postfix) with ESMTPA id 4D69124005B; Wed, 24 Feb 2021 16:25:35 -0500 (EST) X-Mailbox-Line: From b0bea780bc292f29e7b389dd062f20adc2a2d634 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Ian Denhardt Date: Tue, 23 Feb 2021 21:24:00 -0500 Subject: [PATCH 2/2] tools, bpf_asm: exit non-zero on errors. To: ast@kernel.org, daniel@iogearbox.net, bpf@vger.kernel.org, netdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org X-Patchwork-Delegate: bpf@iogearbox.net ...so callers can correctly detect failure. Signed-off-by: Ian Denhardt --- tools/bpf/bpf_exp.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/bpf/bpf_exp.y b/tools/bpf/bpf_exp.y index 8d03e5245da5..dfb7254a24e8 100644 --- a/tools/bpf/bpf_exp.y +++ b/tools/bpf/bpf_exp.y @@ -185,13 +185,13 @@ ldx | OP_LDXB number '*' '(' '[' number ']' '&' number ')' { if ($2 != 4 || $9 != 0xf) { fprintf(stderr, "ldxb offset not supported!\n"); - exit(0); + exit(1); } else { bpf_set_curr_instr(BPF_LDX | BPF_MSH | BPF_B, 0, 0, $6); } } | OP_LDX number '*' '(' '[' number ']' '&' number ')' { if ($2 != 4 || $9 != 0xf) { fprintf(stderr, "ldxb offset not supported!\n"); - exit(0); + exit(1); } else { bpf_set_curr_instr(BPF_LDX | BPF_MSH | BPF_B, 0, 0, $6); } } ; @@ -472,7 +472,7 @@ static void bpf_assert_max(void) { if (curr_instr >= BPF_MAXINSNS) { fprintf(stderr, "only max %u insns allowed!\n", BPF_MAXINSNS); - exit(0); + exit(1); } } @@ -522,7 +522,7 @@ static int bpf_find_insns_offset(const char *label) if (ret == -ENOENT) { fprintf(stderr, "no such label \'%s\'!\n", label); - exit(0); + exit(1); } return ret;