Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/139102/?format=api
http://patchwork.dpdk.org/api/patches/139102/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240404162422.61510-3-stephen@networkplumber.org/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240404162422.61510-3-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20240404162422.61510-3-stephen@networkplumber.org", "date": "2024-04-04T16:22:14", "name": "[v3,2/2] test: add functional test for uuid", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "5c8277d99d6c36a9a29a927da3c9b90470d3392a", "submitter": { "id": 27, "url": "http://patchwork.dpdk.org/api/people/27/?format=api", "name": "Stephen Hemminger", "email": "stephen@networkplumber.org" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240404162422.61510-3-stephen@networkplumber.org/mbox/", "series": [ { "id": 31679, "url": "http://patchwork.dpdk.org/api/series/31679/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31679", "date": "2024-04-04T16:22:12", "name": "uuid: add generate functions and tests", "version": 3, "mbox": "http://patchwork.dpdk.org/series/31679/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/139102/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/139102/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9C8B043DFB;\n\tThu, 4 Apr 2024 18:24:55 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id DD30140A72;\n\tThu, 4 Apr 2024 18:24:42 +0200 (CEST)", "from mail-oa1-f44.google.com (mail-oa1-f44.google.com\n [209.85.160.44]) by mails.dpdk.org (Postfix) with ESMTP id BBA7B402BC\n for <dev@dpdk.org>; Thu, 4 Apr 2024 18:24:39 +0200 (CEST)", "by mail-oa1-f44.google.com with SMTP id\n 586e51a60fabf-22ec890ee96so154868fac.1\n for <dev@dpdk.org>; Thu, 04 Apr 2024 09:24:39 -0700 (PDT)", "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n k196-20020a633dcd000000b005ceeeea1816sm13784188pga.77.2024.04.04.09.24.38\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 04 Apr 2024 09:24:38 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712247879;\n x=1712852679; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=O2hbXsi8PUIPXcDbPGNQLDAn/Jd2tgQRFFjFN8WIeOQ=;\n b=tvleSgtzUEwfMMvlS3TpchwCuTinNdrL2ABqxoiQCTXVgwWFMAME9xHr8SWxMHBihq\n vqse/vhRnHkemf++eeSw+cEvDUeNJXk8yXSnpi3Lzb8nAyd/JrW89jGB3iAVYjR0rOZi\n 8sYtY9C9zoeGF69FOpGkIfeyfgVQdcx2IWaOV5w4hPNYGfNRLbSSlnPa/0tU90f7+CGd\n AMYBXkMSc5Xqs91f+SUV3u4ve0zS34O0J9+KIul82LuOIPAFBb67HePGwq3G/+F1psuE\n 3vaC5MibRtHo8K+hn7xnSPC410sLH+4g9474XnosLcckDBI5sgc6DMmKfGnAaarb0byc\n aqFQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1712247879; x=1712852679;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=O2hbXsi8PUIPXcDbPGNQLDAn/Jd2tgQRFFjFN8WIeOQ=;\n b=BuIIdsGtwMsUe6xpFs3hxC195EbRwLE0YtP+J68xXWAe2eEkAfSulbyeMILBMx++lj\n SJsXj5kUBZgJLMN5DILARTH0yxMKsmb5SDyKIhRmZW3nTLfVvYCMKAJ5XStTQ1pqHzAy\n yVRG9VibwNYNwqavTzIZwnEMBQDYJ8jbVEWNh6qKzpw9M+NfJ1PcZPLCqt6lHz1svngb\n i+M+Q41+5DvBP1Pp0it447JG+xES8ufkVGd6zWb1mgRaJBk3x+mik9+H9Bf2eL2VpO/Y\n twq7ugDNzXivG3fm5kSpSBiXPAnhWz+aySWJ7/RetVKj0w/kMZmL8d0NxBB/udgcYZ6j\n ahgw==", "X-Gm-Message-State": "AOJu0Yx/b2dCYRvcJi55SqMeWlQ/57vGH2LGJuDHpaHkqCqWL6xpmQGs\n LfPXuU6XLiAAdx4tMsUTf5rfarXO+VVcncLoO1aDGHE8UuHsBv9smR7dIb5orLDDC0TouK+8kT3\n k1Lg=", "X-Google-Smtp-Source": "\n AGHT+IGRVtyi+ECXBbWGedIOW8/BvhIKc9JHKHkY1Wc49ndKCDtDvZ2oeyTQyr2G2Ng3jkJiV/OZPQ==", "X-Received": "by 2002:a05:6871:828:b0:22a:7c81:1e2e with SMTP id\n q40-20020a056871082800b0022a7c811e2emr3205445oap.16.1712247879028;\n Thu, 04 Apr 2024 09:24:39 -0700 (PDT)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Subject": "[PATCH v3 2/2] test: add functional test for uuid", "Date": "Thu, 4 Apr 2024 09:22:14 -0700", "Message-ID": "<20240404162422.61510-3-stephen@networkplumber.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20240404162422.61510-1-stephen@networkplumber.org>", "References": "<20240403163432.437275-1-stephen@networkplumber.org>\n <20240404162422.61510-1-stephen@networkplumber.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The uuid functions in EAL were not covered by existing functional\ntests.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test/meson.build | 1 +\n app/test/test_uuid.c | 138 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 139 insertions(+)\n create mode 100644 app/test/test_uuid.c", "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex 7d909039ae..11fb7dbffa 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -198,6 +198,7 @@ source_file_deps = {\n 'test_trace.c': [],\n 'test_trace_perf.c': [],\n 'test_trace_register.c': [],\n+ 'test_uuid.c' : [],\n 'test_vdev.c': ['kvargs', 'bus_vdev'],\n 'test_version.c': [],\n }\ndiff --git a/app/test/test_uuid.c b/app/test/test_uuid.c\nnew file mode 100644\nindex 0000000000..a4b1b34786\n--- /dev/null\n+++ b/app/test/test_uuid.c\n@@ -0,0 +1,138 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2024 Stephen Hemminger\n+ */\n+\n+#include <rte_uuid.h>\n+\n+#include \"test.h\"\n+\n+#define NROUNDS 100\n+\n+static int\n+check_duplicate_uuid(rte_uuid_t uids[])\n+{\n+\tint i, j;\n+\tchar out[256];\n+\n+\tfor (i = 0; i < NROUNDS - 1; i++) {\n+\t\tfor (j = i + 1; j < NROUNDS; j++) {\n+\t\t\tif (rte_uuid_compare(uids[i], uids[j]) == 0) {\n+\t\t\t\trte_uuid_unparse(uids[i], out, sizeof(out));\n+\t\t\t\tprintf(\"Generated duplicate random uuids %d == %d : %s\\n\",\n+\t\t\t\t i, j, out);\n+\t\t\t\treturn TEST_FAILED;\n+\t\t\t}\n+\t\t}\n+\t}\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+static const struct uuid_case {\n+\tconst char *in;\n+\trte_uuid_t result;\n+} good_cases[] = {\n+\t{ \"02ce8e94-5b84-47fc-8f86-72633c5b5061\",\n+\t RTE_UUID_INIT(0x02ce8e94, 0x5b84, 0x47fc, 0x8f86, 0x72633c5b5061) },\n+\t{ \"2c72af87-d220-4931-98ec-45c8520c94e1\",\n+\t RTE_UUID_INIT(0x2c72af87, 0xd220, 0x4931, 0x98ec, 0x45c8520c94e1) },\n+\t{ \"441edca1-0942-4ccd-9b33-233e0454fe5b\",\n+\t RTE_UUID_INIT(0x441edca1, 0x0942, 0x4ccd, 0x9b33, 0x233e0454fe5b) },\n+};\n+\n+static const char * const bad_cases[] = {\n+\t\"\",\t\t\t\t\t/* empty */\n+\t\"41edca1-0942-4ccd-9b33-233e0454fe5b\", /* too short */\n+\t\"d5cecbac-531b-4527-b0629-2bc3011dc9c\", /* hyphen in wrong place */\n+\t\"db318745-1347-4f5e-m142-d86dc41172b2\", /* bad hex */\n+};\n+\n+static int\n+test_uuid(void)\n+{\n+\trte_uuid_t uids[NROUNDS] = { };\n+\trte_uuid_t clone[NROUNDS] = { };\n+\tunsigned int i;\n+\tint ret;\n+\n+\t/* Test generate random uuid */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\tif (!rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Zero'd uuid %d is not null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_generate_random(uids[i]);\n+\n+\t\tif (rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Generated random uuid %d is null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tret = check_duplicate_uuid(uids);\n+\tif (ret != TEST_SUCCESS)\n+\t\treturn ret;\n+\n+\t/* Test generate time */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\trte_uuid_generate_time(uids[i]);\n+\n+\t\tif (rte_uuid_is_null(uids[i])) {\n+\t\t\tprintf(\"Generated random uuid %d is null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\n+\t/* Test that copy works */\n+\tfor (i = 0; i < NROUNDS; i++) {\n+\t\tif (!rte_uuid_is_null(clone[i])) {\n+\t\t\tprintf(\"Zero'd clone %d is not null\\n\", i);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_copy(clone[i], uids[i]);\n+\n+\t\tif (rte_uuid_compare(uids[i], clone[i]) != 0) {\n+\t\t\tprintf(\"Copied uuid does not match\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < RTE_DIM(good_cases); i++) {\n+\t\tconst struct uuid_case *c = &good_cases[i];\n+\t\tchar out[37];\n+\t\trte_uuid_t uu;\n+\n+\t\tif (rte_uuid_parse(c->in, uu) != 0) {\n+\t\t\tprintf(\"Failed to parse '%s'\\n\", c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t\tif (rte_uuid_compare(uu, c->result) != 0) {\n+\t\t\tprintf(\"Parse mismatch for '%s'\\n\", c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\trte_uuid_unparse(uu, out, sizeof(out));\n+\t\tif (strcmp(out, c->in) != 0) {\n+\t\t\tprintf(\"Parse/unparse mismatch (%s != %s)\\n\",\n+\t\t\t out, c->in);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\n+\tfor (i = 0; i < RTE_DIM(bad_cases); i++) {\n+\t\tconst char *s = bad_cases[i];\n+\t\trte_uuid_t uu;\n+\n+\t\tif (rte_uuid_parse(s, uu) == 0) {\n+\t\t\tprintf(\"Accepted parse of '%s'\\n\", s);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t}\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+REGISTER_FAST_TEST(uuid_autotest, true, true, test_uuid);\n", "prefixes": [ "v3", "2/2" ] }{ "id": 139102, "url": "