Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp131622rwi; Wed, 12 Oct 2022 17:18:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM723PTpnS9GhUH2ki/kNdlziHFBQ2ioyQzVxgd2O1KnKRFt9+UHw8FTWMoFwxT4tHtLUIVi X-Received: by 2002:a17:907:3e02:b0:782:1267:f2c8 with SMTP id hp2-20020a1709073e0200b007821267f2c8mr24552720ejc.585.1665620293090; Wed, 12 Oct 2022 17:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665620293; cv=none; d=google.com; s=arc-20160816; b=eU6o7p24hqXY7H54ulnJDhPFqIIXvrhVY+nLrQFAyOn7RyO8X8OF7+BWcDS2RALU1O ERJVt1/hJbyO7TvxpL3c7Rc+WG6Mz+/+4kd6wEmeMlpOQZ+JbyHYjHN52SBp6FtH953w ILVDhCKw3pIIlR6934Dzodmvjw1wG3AUz7dgt/zHCstZ46WjxY3r/tJ2AHDy2+68xRIL tIYMO9Ck+ZBYHPH040UPYfP+D/lBNs2EyTgHJoReV0QlS5uX5HXMw/+QiQCGDwuXHAq6 g4KTc70Tx1I6wd/iEK6ztb4MWUuPobLsjohZu5IdL59t9G1An3pPFS17+FAAHjFZbZxA nOww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=5yl+IrN5JIQ6K70LZJo+pynH1PkVtppZ1pBc7ZksFtE=; b=gRniM/NtFZOBgFkrR2ix2Fmfck/9oQcxecvF94+NJX2JtQxh65su82tbA1RB/5Go0Q JNJn505l92eX8hj4wmIJJ77uEcWHK2Sb7fnuSOFuPfL3nsmKs6Tn6/oliP8jTC3Nmcbe yenmZ5D1SF4IaxlaeFRTXo9MchgZiKViOO/z0MIqKaBDf4Pg04P64I+W0UNaGNLFauML FM61JqPuS0YS+q5Z58kORt23xJelc5eEjtc40VOLKOD3lFm8SPtmyVzr6szbq4Y2z2o7 jhLx7xHQifsU08Dw5KTRKhJASCvADTw/+9o+O+iM8Mlz922sTJPMaEdQ9xJa3yhkgzAf sklA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=w6ezJSmw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz12-20020a1709077d8c00b00782b261ea21si19741494ejc.729.2022.10.12.17.17.47; Wed, 12 Oct 2022 17:18:13 -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; dkim=pass header.i=@linux.dev header.s=key1 header.b=w6ezJSmw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229696AbiJLX0Q (ORCPT + 99 others); Wed, 12 Oct 2022 19:26:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbiJLX0O (ORCPT ); Wed, 12 Oct 2022 19:26:14 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F417E7CAB6; Wed, 12 Oct 2022 16:26:12 -0700 (PDT) Message-ID: <33d17f23-03cb-9bff-2e50-06ab0f597640@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1665617171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5yl+IrN5JIQ6K70LZJo+pynH1PkVtppZ1pBc7ZksFtE=; b=w6ezJSmwVtpssAQF1n7F/pKNNksCrEHY0OQ1FrnzUF3KMPxsi+r+vsiRLMmTeEUGndN1PN Da/O4jzRf8uvdRiqAihiKSFJJoGy5G1hBNSatTQWmTnq8lb4+AA3jiGdX49xo7k7zAioOm KJE8ao5VMLWa80iMGQBoEQ2dz4UwuPY= Date: Wed, 12 Oct 2022 16:26:05 -0700 MIME-Version: 1.0 Subject: Re: [PATCH bpf-next v4 6/6] selftest/bpf: Fix error usage of ASSERT_OK in xdp_adjust_tail.c Content-Language: en-US To: Xu Kuohai Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , 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 , bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, netdev@vger.kernel.org References: <20221011120108.782373-1-xukuohai@huaweicloud.com> <20221011120108.782373-7-xukuohai@huaweicloud.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: <20221011120108.782373-7-xukuohai@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS 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 On 10/11/22 5:01 AM, Xu Kuohai wrote: > 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")) Ouch... ic. It is why this test has been passing. > 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 */