From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA0E5A0518 for ; Fri, 24 Jul 2020 14:03:22 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D15681BFE3; Fri, 24 Jul 2020 14:03:22 +0200 (CEST) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by dpdk.org (Postfix) with ESMTP id AD3C51BFE3 for ; Fri, 24 Jul 2020 14:03:21 +0200 (CEST) Received: by mail-wr1-f46.google.com with SMTP id f2so8066734wrp.7 for ; Fri, 24 Jul 2020 05:03:21 -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=5dpRpTU3Q1EC0ytuP/m3L/n8LeFyG3iA8SZ3kXZtGJU=; b=rU9cAWG37iBHrVxAIxVJrSUUeL3cODXp5k6IgHWRcyFa1XWEuyXBfuJXK0pfvT6t/X Ndbqi3udy992vQ4w7XekN8u8ofAL4RCP7gNtGXXEPMvJYUVq1UWzW2lKIE70uZQwXRtT cxY7lqdmTs6UmYdk46ZxR5stVnH3TIBSz9OmPsK8C1bsHpI5IU6OcBTnuvWNgzh8dOLw K4FUmqwj/ssAd/WVmLrIlrZNuRgnN4nKeu5Wz2xNGIYqLTa3oNyDRFsPd9qP8kR3ciXr GtGHdC0L2mY/obaihWx4nVSkQp2jgBpkVQSgiQx5J7nVJrt0N/L0W5fnW8DNJLO9bNDf V6lw== 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=5dpRpTU3Q1EC0ytuP/m3L/n8LeFyG3iA8SZ3kXZtGJU=; b=dvNXLgthIwNII82K8hkwrSbHGw77bFzrpf9GVT0gfJSFsdVVrv69Lj7oYcNISR1T07 Kfoz4WIlyc5DyO6nEuqr+LuqKsBrWowRVi8AHqHmYaCmHJeeBgnSaBW6ax9yjsRGTEgh k0E0OfMHSTbUWWGlXcE9XofUOnWG0gJENJrWjMfrZWAcV1gNt9Ibtswv86uIQAgBL3/G B2dvm/durKl4pE4nIyTSjLQkb+JZlIKBxMQUp9LlyHibp2wRf5CNViH+1Ovc7UVNYgq7 v5vRXamIJ+rjvLnL01WVjdueFvheI9mkCOYWkh3wbQ0pR80T+Lv1d/Smo1sux9uUtc2W S+8g== X-Gm-Message-State: AOAM531NvvsFkHeGHB6TTcEoI2/T5wqRO8fBKiyrCxDgAjsbZOSVL73L pVOPQ13TzPUZ67EtJaByU7g= X-Google-Smtp-Source: ABdhPJw/i7sFmVau72FB8faCds0Kay3TF5b9hXZ/y1tPiaTvuAx/oLMPrDqbyEj2cIY5ituJjXK/aA== X-Received: by 2002:adf:f711:: with SMTP id r17mr8431353wrp.409.1595592201407; Fri, 24 Jul 2020 05:03:21 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id u1sm1317235wrb.78.2020.07.24.05.03.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:03:20 -0700 (PDT) From: luca.boccassi@gmail.com To: Konstantin Ananyev Cc: dpdk stable Date: Fri, 24 Jul 2020 12:58:01 +0100 Message-Id: <20200724120030.1863487-43-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'test/bpf: fix few small issues' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 3e457e69b6a0b0b4f7220481aac1766197916253 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Wed, 27 May 2020 15:16:49 +0100 Subject: [PATCH] test/bpf: fix few small issues [ upstream commit 83633ba230761647b5014301c1f98b670d03e375 ] Address for few small issues: - unreachable return statement - failed test-case can finish with 'success' status Also use unified cmp_res() function to check return value. Signed-off-by: Konstantin Ananyev --- app/test/test_bpf.c | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/app/test/test_bpf.c b/app/test/test_bpf.c index ee534687a..4a61a7d7c 100644 --- a/app/test/test_bpf.c +++ b/app/test/test_bpf.c @@ -1797,13 +1797,6 @@ test_call1_check(uint64_t rc, const void *arg) dummy_func1(arg, &v32, &v64); v64 += v32; - if (v64 != rc) { - printf("%s@%d: invalid return value " - "expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n", - __func__, __LINE__, v64, rc); - return -1; - } - return 0; return cmp_res(__func__, v64, rc, dv, dv, sizeof(*dv)); } @@ -1934,13 +1927,7 @@ test_call2_check(uint64_t rc, const void *arg) dummy_func2(&a, &b); v = a.u64 + a.u32 + b.u16 + b.u8; - if (v != rc) { - printf("%s@%d: invalid return value " - "expected=0x%" PRIx64 ", actual=0x%" PRIx64 "\n", - __func__, __LINE__, v, rc); - return -1; - } - return 0; + return cmp_res(__func__, v, rc, arg, arg, 0); } static const struct rte_bpf_xsym test_call2_xsym[] = { @@ -2429,7 +2416,6 @@ test_call5_check(uint64_t rc, const void *arg) v = 0; fail: - return cmp_res(__func__, v, rc, &v, &rc, sizeof(v)); } @@ -2458,6 +2444,7 @@ static const struct rte_bpf_xsym test_call5_xsym[] = { }, }; +/* all bpf test cases */ static const struct bpf_test tests[] = { { .name = "test_store1", @@ -2738,7 +2725,6 @@ run_test(const struct bpf_test *tst) } tst->prepare(tbuf); - rc = rte_bpf_exec(bpf, tbuf); ret = tst->check_result(rc, tbuf); if (ret != 0) { @@ -2746,17 +2732,20 @@ run_test(const struct bpf_test *tst) __func__, __LINE__, tst->name, ret, strerror(ret)); } + /* repeat the same test with jit, when possible */ rte_bpf_get_jit(bpf, &jit); - if (jit.func == NULL) - return 0; + if (jit.func != NULL) { - tst->prepare(tbuf); - rc = jit.func(tbuf); - rv = tst->check_result(rc, tbuf); - ret |= rv; - if (rv != 0) { - printf("%s@%d: check_result(%s) failed, error: %d(%s);\n", - __func__, __LINE__, tst->name, rv, strerror(ret)); + tst->prepare(tbuf); + rc = jit.func(tbuf); + rv = tst->check_result(rc, tbuf); + ret |= rv; + if (rv != 0) { + printf("%s@%d: check_result(%s) failed, " + "error: %d(%s);\n", + __func__, __LINE__, tst->name, + rv, strerror(ret)); + } } rte_bpf_destroy(bpf); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:50.270670479 +0100 +++ 0043-test-bpf-fix-few-small-issues.patch 2020-07-24 12:53:48.255005863 +0100 @@ -1,16 +1,16 @@ -From 83633ba230761647b5014301c1f98b670d03e375 Mon Sep 17 00:00:00 2001 +From 3e457e69b6a0b0b4f7220481aac1766197916253 Mon Sep 17 00:00:00 2001 From: Konstantin Ananyev Date: Wed, 27 May 2020 15:16:49 +0100 Subject: [PATCH] test/bpf: fix few small issues +[ upstream commit 83633ba230761647b5014301c1f98b670d03e375 ] + Address for few small issues: - unreachable return statement - failed test-case can finish with 'success' status Also use unified cmp_res() function to check return value. -Cc: stable@dpdk.org - Signed-off-by: Konstantin Ananyev --- app/test/test_bpf.c | 39 ++++++++++++++-------------------------