Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/104839/?format=api
http://patchwork.dpdk.org/api/patches/104839/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1638490007-9939-7-git-send-email-jizh@linux.microsoft.com/", "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": "<1638490007-9939-7-git-send-email-jizh@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1638490007-9939-7-git-send-email-jizh@linux.microsoft.com", "date": "2021-12-03T00:06:44", "name": "[v11,6/9] app/test: differentiate a strerror on different OS", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "86bd1b3fa51ae60c570dd01d1e44087030184114", "submitter": { "id": 1934, "url": "http://patchwork.dpdk.org/api/people/1934/?format=api", "name": "Jie Zhou", "email": "jizh@linux.microsoft.com" }, "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/1638490007-9939-7-git-send-email-jizh@linux.microsoft.com/mbox/", "series": [ { "id": 20842, "url": "http://patchwork.dpdk.org/api/series/20842/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20842", "date": "2021-12-03T00:06:39", "name": "app/test: enable subset of tests on Windows", "version": 11, "mbox": "http://patchwork.dpdk.org/series/20842/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/104839/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/104839/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 B56E1A0548;\n\tFri, 3 Dec 2021 01:07:39 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0F46542722;\n\tFri, 3 Dec 2021 01:07:03 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 0E0704014F\n for <dev@dpdk.org>; Fri, 3 Dec 2021 01:06:55 +0100 (CET)", "from\n linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net\n (linux.microsoft.com [13.77.154.182])\n by linux.microsoft.com (Postfix) with ESMTPSA id F0EFA20E67C3;\n Thu, 2 Dec 2021 16:06:53 -0800 (PST)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com F0EFA20E67C3", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1638490014;\n bh=21CgDt/WmaQZSTbJ2JL9cXzuZWlWx3jRTGxq27mxIS4=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=Hl3sG4qqkcYS5YDApfI10qjN3xWL/j2UKgnv9bma4OU8CLt7VAx6gU2v0nYl8mASR\n h7ABC7gUIV+HRJUBFTVGa5TKJZg8U7dxtVS7fV1+7MnV9T7pHIyszDyfUmbs/gXgXC\n SoUUkQVaGQCBZvoTLGNcWc5TN7KVLcQ0Oz7hjau0=", "From": "Jie Zhou <jizh@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "dmitry.kozliuk@gmail.com, roretzla@microsoft.com,\n navasile@linux.microsoft.com, dmitrym@microsoft.com,\n pallavi.kadam@intel.com, talshn@nvidia.com, thomas@monjalon.net,\n aconole@redhat.com", "Subject": "[PATCH v11 6/9] app/test: differentiate a strerror on different OS", "Date": "Thu, 2 Dec 2021 16:06:44 -0800", "Message-Id": "<1638490007-9939-7-git-send-email-jizh@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1638490007-9939-1-git-send-email-jizh@linux.microsoft.com>", "References": "<1638384245-12587-1-git-send-email-jizh@linux.microsoft.com>\n <1638490007-9939-1-git-send-email-jizh@linux.microsoft.com>", "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": "On Windows, strerror returns just \"Unknown error\" for errnum greater\nthan MAX_ERRNO, while linux and freebsd returns \"Unknown error <num>\",\nwhich is the current expectation for errno_autotest. Differentiate\nthe error string on Windows to remove a \"duplicate error code\" failure.\n\nSigned-off-by: Jie Zhou <jizh@linux.microsoft.com>\n\n---\n app/test/test_errno.c | 12 +++++++++++-\n lib/eal/common/eal_common_errno.c | 4 ++++\n 2 files changed, 15 insertions(+), 1 deletion(-)", "diff": "diff --git a/app/test/test_errno.c b/app/test/test_errno.c\nindex 3ff0456a58..0db4fbc8b3 100644\n--- a/app/test/test_errno.c\n+++ b/app/test/test_errno.c\n@@ -18,13 +18,19 @@ test_errno(void)\n {\n \tconst char *rte_retval;\n \tconst char *libc_retval;\n+\n+#ifndef RTE_EXEC_ENV_WINDOWS\n #ifdef RTE_EXEC_ENV_FREEBSD\n \t/* BSD has a colon in the string, unlike linux */\n \tconst char unknown_code_result[] = \"Unknown error: %d\";\n #else\n \tconst char unknown_code_result[] = \"Unknown error %d\";\n #endif\n-\tchar expected_libc_retval[sizeof(unknown_code_result)+3];\n+\tchar expected_libc_retval[sizeof(unknown_code_result) + 3];\n+#else\n+\t/* Windows doesn't return error number for error greater than MAX_errno*/\n+\tstatic const char expected_libc_retval[] = \"Unknown error\";\n+#endif\n \n \t/* use a small selection of standard errors for testing */\n \tint std_errs[] = {EAGAIN, EBADF, EACCES, EINTR, EINVAL};\n@@ -54,11 +60,13 @@ test_errno(void)\n \t\t\t\trte_retval, libc_retval);\n \t\tif (strcmp(rte_retval, libc_retval) == 0)\n \t\t\treturn -1;\n+#ifndef RTE_EXEC_ENV_WINDOWS\n \t\t/* generate appropriate error string for unknown error number\n \t\t * and then check that this is what we got back. If not, we have\n \t\t * a duplicate error number that conflicts with errno.h */\n \t\tsnprintf(expected_libc_retval, sizeof(expected_libc_retval),\n \t\t\t\tunknown_code_result, rte_errs[i]);\n+#endif\n \t\tif ((strcmp(expected_libc_retval, libc_retval) != 0) &&\n \t\t\t\t(strcmp(\"\", libc_retval) != 0)){\n \t\t\tprintf(\"Error, duplicate error code %d\\n\", rte_errs[i]);\n@@ -69,8 +77,10 @@ test_errno(void)\n \t/* ensure that beyond RTE_MAX_ERRNO, we always get an unknown code */\n \trte_retval = rte_strerror(RTE_MAX_ERRNO + 1);\n \tlibc_retval = strerror(RTE_MAX_ERRNO + 1);\n+#ifndef RTE_EXEC_ENV_WINDOWS\n \tsnprintf(expected_libc_retval, sizeof(expected_libc_retval),\n \t\t\tunknown_code_result, RTE_MAX_ERRNO + 1);\n+#endif\n \tprintf(\"rte_strerror: '%s', strerror: '%s'\\n\",\n \t\t\trte_retval, libc_retval);\n \tif ((strcmp(rte_retval, libc_retval) != 0) ||\ndiff --git a/lib/eal/common/eal_common_errno.c b/lib/eal/common/eal_common_errno.c\nindex f86802705a..4c4abb802e 100644\n--- a/lib/eal/common/eal_common_errno.c\n+++ b/lib/eal/common/eal_common_errno.c\n@@ -37,7 +37,11 @@ rte_strerror(int errnum)\n \t/* since some implementations of strerror_r throw an error\n \t * themselves if errnum is too big, we handle that case here */\n \tif (errnum >= RTE_MAX_ERRNO)\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+\t\tsnprintf(ret, RETVAL_SZ, \"Unknown error%s\", sep);\n+#else\n \t\tsnprintf(ret, RETVAL_SZ, \"Unknown error%s %d\", sep, errnum);\n+#endif\n \telse\n \t\tswitch (errnum){\n \t\tcase E_RTE_SECONDARY:\n", "prefixes": [ "v11", "6/9" ] }{ "id": 104839, "url": "