get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/122101/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 122101,
    "url": "https://patches.dpdk.org/api/patches/122101/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230116130724.50277-4-mb@smartsharesystems.com/",
    "project": {
        "id": 1,
        "url": "https://patches.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": "<20230116130724.50277-4-mb@smartsharesystems.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230116130724.50277-4-mb@smartsharesystems.com",
    "date": "2023-01-16T13:07:24",
    "name": "[v7,4/4] eal: add nonnull and access function attributes",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "5c07ea2a01630416dd88252dda751fdc24501f1b",
    "submitter": {
        "id": 591,
        "url": "https://patches.dpdk.org/api/people/591/?format=api",
        "name": "Morten Brørup",
        "email": "mb@smartsharesystems.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230116130724.50277-4-mb@smartsharesystems.com/mbox/",
    "series": [
        {
            "id": 26561,
            "url": "https://patches.dpdk.org/api/series/26561/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26561",
            "date": "2023-01-16T13:07:21",
            "name": "[v7,1/4] net/bnx2x: fix warnings about rte_memcpy lengths",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/26561/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/122101/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/122101/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 F1BAF423F0;\n\tMon, 16 Jan 2023 14:07:45 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8399942D24;\n\tMon, 16 Jan 2023 14:07:30 +0100 (CET)",
            "from smartserver.smartsharesystems.com\n (smartserver.smartsharesystems.com [77.243.40.215])\n by mails.dpdk.org (Postfix) with ESMTP id 03C8A40E6E\n for <dev@dpdk.org>; Mon, 16 Jan 2023 14:07:26 +0100 (CET)",
            "from dkrd2.smartsharesys.local ([192.168.4.12]) by\n smartserver.smartsharesystems.com with Microsoft SMTPSVC(6.0.3790.4675);\n Mon, 16 Jan 2023 14:07:26 +0100"
        ],
        "From": "=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>",
        "To": "dev@dpdk.org, roretzla@linux.microsoft.com, rmody@marvell.com,\n timothy.mcdaniel@intel.com, matan@nvidia.com, viacheslavo@nvidia.com",
        "Cc": "ruifeng.wang@arm.com, zhoumin@loongson.cn, drc@linux.vnet.ibm.com,\n kda@semihalf.com, bruce.richardson@intel.com, konstantin.v.ananyev@yandex.ru,\n\t=?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>",
        "Subject": "[PATCH v7 4/4] eal: add nonnull and access function attributes",
        "Date": "Mon, 16 Jan 2023 14:07:24 +0100",
        "Message-Id": "<20230116130724.50277-4-mb@smartsharesystems.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20230116130724.50277-1-mb@smartsharesystems.com>",
        "References": "<20221202153432.131023-1-mb@smartsharesystems.com>\n <20230116130724.50277-1-mb@smartsharesystems.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-OriginalArrivalTime": "16 Jan 2023 13:07:26.0553 (UTC)\n FILETIME=[7B191C90:01D929AB]",
        "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": "Add nonnull function attribute to help the compiler detect a NULL\npointer being passed to a function not accepting NULL pointers as an\nargument at build time.\n\nAdd access function attributes to tell the compiler how a function\naccesses memory pointed to by its pointer arguments.\n\nAdd these attributes to the rte_memcpy() function, as the first in\nhopefully many to come.\n\nSigned-off-by: Morten Brørup <mb@smartsharesystems.com>\nAcked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\nv7:\n* Fix indentation. (checkpatch)\nv6:\n* Make this the last patch in the series, putting the fixes first.\n  (David)\n* Split the generic access macro into dedicated macros per access mode.\n  (David)\nv5:\n* No changes.\nv4:\n* No changes.\nv3:\n* No changes.\nv2:\n* Only define \"nonnull\" for GCC and CLANG.\n* Append _param/_params to prepare for possible future attributes\n  attached directly to the individual parameters, like __rte_unused.\n* Use RTE_TOOLCHAIN_GCC instead of RTE_CC_GCC, to fix complaints about\n  GCC_VERSION being undefined.\n* Try to fix Doxygen compliants.\n---\n lib/eal/arm/include/rte_memcpy_32.h |  8 +++\n lib/eal/arm/include/rte_memcpy_64.h |  6 +++\n lib/eal/include/rte_common.h        | 76 +++++++++++++++++++++++++++++\n lib/eal/ppc/include/rte_memcpy.h    |  3 ++\n lib/eal/x86/include/rte_memcpy.h    |  6 +++\n 5 files changed, 99 insertions(+)",
    "diff": "diff --git a/lib/eal/arm/include/rte_memcpy_32.h b/lib/eal/arm/include/rte_memcpy_32.h\nindex fb3245b59c..a625a91951 100644\n--- a/lib/eal/arm/include/rte_memcpy_32.h\n+++ b/lib/eal/arm/include/rte_memcpy_32.h\n@@ -14,6 +14,8 @@ extern \"C\" {\n \n #include \"generic/rte_memcpy.h\"\n \n+#include <rte_common.h>\n+\n #ifdef RTE_ARCH_ARM_NEON_MEMCPY\n \n #ifndef __ARM_NEON\n@@ -125,6 +127,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src)\n \tmemcpy((dst), (src), (n)) :          \\\n \trte_memcpy_func((dst), (src), (n)); })\n \n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static inline void *\n rte_memcpy_func(void *dst, const void *src, size_t n)\n {\n@@ -290,6 +295,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src)\n \tmemcpy(dst, src, 256);\n }\n \n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static inline void *\n rte_memcpy(void *dst, const void *src, size_t n)\n {\ndiff --git a/lib/eal/arm/include/rte_memcpy_64.h b/lib/eal/arm/include/rte_memcpy_64.h\nindex 85ad587bd3..0c86237cc9 100644\n--- a/lib/eal/arm/include/rte_memcpy_64.h\n+++ b/lib/eal/arm/include/rte_memcpy_64.h\n@@ -282,6 +282,9 @@ void rte_memcpy_ge64(uint8_t *dst, const uint8_t *src, size_t n)\n }\n \n #if RTE_CACHE_LINE_SIZE >= 128\n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static __rte_always_inline\n void *rte_memcpy(void *dst, const void *src, size_t n)\n {\n@@ -303,6 +306,9 @@ void *rte_memcpy(void *dst, const void *src, size_t n)\n }\n \n #else\n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static __rte_always_inline\n void *rte_memcpy(void *dst, const void *src, size_t n)\n {\ndiff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h\nindex 15765b408d..c9cd2c7496 100644\n--- a/lib/eal/include/rte_common.h\n+++ b/lib/eal/include/rte_common.h\n@@ -149,6 +149,82 @@ typedef uint16_t unaligned_uint16_t;\n \t__attribute__((format(printf, format_index, first_arg)))\n #endif\n \n+/**\n+ * Tells compiler that the pointer arguments must be non-null.\n+ *\n+ * @param ...\n+ *    Comma separated list of parameter indexes of pointer arguments.\n+ */\n+#if defined(RTE_CC_GCC) || defined(RTE_CC_CLANG)\n+#define __rte_nonnull_params(...) \\\n+\t__attribute__((nonnull(__VA_ARGS__)))\n+#else\n+#define __rte_nonnull_params(...)\n+#endif\n+\n+/**\n+ * Tells compiler that the memory pointed to by a pointer argument\n+ * is only read, not written to, by the function.\n+ * It might not be accessed at all.\n+ *\n+ * @param ...\n+ *    Parameter index of pointer argument.\n+ *    Optionally followeded by comma and parameter index of size argument.\n+ */\n+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400)\n+#define __rte_read_only_param(...) \\\n+\t__attribute__((access(read_only, __VA_ARGS__)))\n+#else\n+#define __rte_read_only_param(...)\n+#endif\n+\n+/**\n+ * Tells compiler that the memory pointed to by a pointer argument\n+ * is only written to, not read, by the function.\n+ * It might not be accessed at all.\n+ *\n+ * @param ...\n+ *    Parameter index of pointer argument.\n+ *    Optionally followeded by comma and parameter index of size argument.\n+ */\n+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400)\n+#define __rte_write_only_param(...) \\\n+\t__attribute__((access(write_only, __VA_ARGS__)))\n+#else\n+#define __rte_write_only_param(...)\n+#endif\n+\n+/**\n+ * Tells compiler that the memory pointed to by a pointer argument\n+ * is both read and written to by the function.\n+ * It might not be read, written to, or accessed at all.\n+ *\n+ * @param ...\n+ *    Parameter index of pointer argument.\n+ *    Optionally followeded by comma and parameter index of size argument.\n+ */\n+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400)\n+#define __rte_read_write_param(...) \\\n+\t__attribute__((access(read_write, __VA_ARGS__)))\n+#else\n+#define __rte_read_write_param(...)\n+#endif\n+\n+/**\n+ * Tells compiler that the memory pointed to by a pointer argument\n+ * is not accessed by the function.\n+ *\n+ * @param ...\n+ *    Parameter index of pointer argument.\n+ *    Optionally followeded by comma and parameter index of size argument.\n+ */\n+#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 100400)\n+#define __rte_no_access_param(...) \\\n+\t__attribute__((access(none, __VA_ARGS__)))\n+#else\n+#define __rte_no_access_param(...)\n+#endif\n+\n /**\n  * Tells compiler that the function returns a value that points to\n  * memory, where the size is given by the one or two arguments.\ndiff --git a/lib/eal/ppc/include/rte_memcpy.h b/lib/eal/ppc/include/rte_memcpy.h\nindex 6f388c0234..c36869a414 100644\n--- a/lib/eal/ppc/include/rte_memcpy.h\n+++ b/lib/eal/ppc/include/rte_memcpy.h\n@@ -84,6 +84,9 @@ rte_mov256(uint8_t *dst, const uint8_t *src)\n \tmemcpy((dst), (src), (n)) :          \\\n \trte_memcpy_func((dst), (src), (n)); })\n \n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static inline void *\n rte_memcpy_func(void *dst, const void *src, size_t n)\n {\ndiff --git a/lib/eal/x86/include/rte_memcpy.h b/lib/eal/x86/include/rte_memcpy.h\nindex d4d7a5cfc8..ee543aa37d 100644\n--- a/lib/eal/x86/include/rte_memcpy.h\n+++ b/lib/eal/x86/include/rte_memcpy.h\n@@ -42,6 +42,9 @@ extern \"C\" {\n  * @return\n  *   Pointer to the destination data.\n  */\n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static __rte_always_inline void *\n rte_memcpy(void *dst, const void *src, size_t n);\n \n@@ -859,6 +862,9 @@ rte_memcpy_aligned(void *dst, const void *src, size_t n)\n \treturn ret;\n }\n \n+__rte_nonnull_params(1, 2)\n+__rte_write_only_param(1, 3)\n+__rte_read_only_param(2, 3)\n static __rte_always_inline void *\n rte_memcpy(void *dst, const void *src, size_t n)\n {\n",
    "prefixes": [
        "v7",
        "4/4"
    ]
}