Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2087583rwi; Tue, 11 Oct 2022 04:49:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NlM17gQxOlGb7JxBzioOKb+TLrk7bbgsS4RbpKOEEVhlWaA1VC0ePN+kF8K+2SFlr8Ysv X-Received: by 2002:a17:90b:400e:b0:20d:4f9a:4b21 with SMTP id ie14-20020a17090b400e00b0020d4f9a4b21mr8995126pjb.93.1665488943623; Tue, 11 Oct 2022 04:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665488943; cv=none; d=google.com; s=arc-20160816; b=eBh1L/90kj8CaFXfoj0i6jrzOE045r3g3tyTLIOnYoBfPC4sCcuZZEkUnM8K3ki+q4 rATW+68AfHpAFesmAcEFl+O5eUFpCv4jFRwMogpZxCRQapgZSyNr4kjPhgzw+jwm/VMx TF1HpcXdOWQcf0FvP1cAYSuw0mSF6/WfNcs8IUGcRFyWo0QAIvqaS8fA/JRCY0KGlnkD neMxUb0KC4/ZGB9LryuzPgR+7UpSbqbw68OmSn17FaWbb/IHrZebM6C/5xcab4fS+Ylc YkNrJtHxarPRC+VOTRey1qvrJDBKsM20lmOmQ6Qd5R2WqZRqsiopYrrVl7ntpPash9Sx N1yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=L1qxpdM1tT4ix3LiqqA4RHz3TrkotZKdRqL9DNBH0AY=; b=kBZDd3Tj0XPssqy9YhNGpiVikA/thAGrUXrgmgSTl/ak2OXw+S1MVE+DPFv7JZJvte EKa/6A+mKrmAjXNN0HApFTLBtp/FCkpRW//OUAfX2P6yGzo1oo9Z5TKPid5S2JgGdt/T BlvJz3CdZOF+OSjL0PU5pj+uC0wZjfI9EC/9+ifZzu2omRKH/vyKDywuYi/+E5TXlktj ogUOGSwvAPHT3t8+laiJ4jbFwwO0NcHHTP0EzyztwVDalFlY+dYcA+Vdm348kGuzp2Yj bsvL6RvMqQQuDv/04tMCJoVBg3T8ThjRrX+XtiWBeaVNNOR9/HITbiLF11lIdovyGd9L jZqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p38-20020a056a000a2600b0053a339cafb3si17477686pfh.53.2022.10.11.04.48.51; Tue, 11 Oct 2022 04:49:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbiJKLoE (ORCPT + 99 others); Tue, 11 Oct 2022 07:44:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229978AbiJKLnh (ORCPT ); Tue, 11 Oct 2022 07:43:37 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6BB38A7F2; Tue, 11 Oct 2022 04:43:35 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4Mmv4y3LFMzl64T; Tue, 11 Oct 2022 19:41:38 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP2 (Coremail) with SMTP id Syh0CgBX8NTXVkVj5HNpAA--.32480S8; Tue, 11 Oct 2022 19:43:34 +0800 (CST) From: Xu Kuohai To: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , "David S . Miller" , Jakub Kicinski , Jesper Dangaard Brouer , Kumar Kartikeya Dwivedi , Alan Maguire , Delyan Kratunov , Lorenzo Bianconi Subject: [PATCH bpf-next v4 6/6] selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c Date: Tue, 11 Oct 2022 08:01:08 -0400 Message-Id: <20221011120108.782373-7-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221011120108.782373-1-xukuohai@huaweicloud.com> References: <20221011120108.782373-1-xukuohai@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgBX8NTXVkVj5HNpAA--.32480S8 X-Coremail-Antispam: 1UD129KBjvJXoW7uFyfur4UArW5ZFWDKw43Awb_yoW8Arykpa 48Gw1qyasYqr1UXF1UJFy29ry8K3WxWw1fCa9F9r4fAr47JF97JF1xKayaq3ZagFWrXw1r Z34UKrn5Zw45J3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBSb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAV Cq3wA2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0 rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267 AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E 14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7 xfMcIj6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Y z7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4UJVWxJr1lIxAI cVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2js IEc7CjxVAFwI0_Gr1j6F4UJbIYCTnIWIevJa73UjIFyTuYvjxUFgAwUUUUU X-CM-SenderInfo: 50xn30hkdlqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Kuohai xdp_adjust_tail.c calls ASSERT_OK() to check the return value of bpf_prog_test_load(), but the condition is not correct. Fix it. Fixes: 791cad025051 ("bpf: selftests: Get rid of CHECK macro in xdp_adjust_tail.c") Signed-off-by: Xu Kuohai --- tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c index 009ee37607df..39973ea1ce43 100644 --- a/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c +++ b/tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c @@ -18,7 +18,7 @@ static void test_xdp_adjust_tail_shrink(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_shrink")) return; err = bpf_prog_test_run_opts(prog_fd, &topts); @@ -53,7 +53,7 @@ static void test_xdp_adjust_tail_grow(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) return; err = bpf_prog_test_run_opts(prog_fd, &topts); @@ -90,7 +90,7 @@ static void test_xdp_adjust_tail_grow2(void) ); err = bpf_prog_test_load(file, BPF_PROG_TYPE_XDP, &obj, &prog_fd); - if (ASSERT_OK(err, "test_xdp_adjust_tail_grow")) + if (!ASSERT_OK(err, "test_xdp_adjust_tail_grow")) return; /* Test case-64 */ -- 2.30.2