get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123393,
    "url": "http://patches.dpdk.org/api/patches/123393/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207230438.1617331-8-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://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": "<20230207230438.1617331-8-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230207230438.1617331-8-stephen@networkplumber.org",
    "date": "2023-02-07T23:04:28",
    "name": "[RFC,v2,07/17] efd: replace RTE_LOGTYPE_EFD with local type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "ed3565d0ba7eae94fe8b92051fcfbbfd6b2d5f6c",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230207230438.1617331-8-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 26874,
            "url": "http://patches.dpdk.org/api/series/26874/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26874",
            "date": "2023-02-07T23:04:21",
            "name": "static logtype removal",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/26874/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/123393/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/123393/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 D906741C34;\n\tWed,  8 Feb 2023 00:05:41 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3924F42D3E;\n\tWed,  8 Feb 2023 00:05:15 +0100 (CET)",
            "from mail-pj1-f50.google.com (mail-pj1-f50.google.com\n [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 35C7E42D39\n for <dev@dpdk.org>; Wed,  8 Feb 2023 00:05:13 +0100 (CET)",
            "by mail-pj1-f50.google.com with SMTP id\n c10-20020a17090a1d0a00b0022e63a94799so372038pjd.2\n for <dev@dpdk.org>; Tue, 07 Feb 2023 15:05:13 -0800 (PST)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n gq17-20020a17090b105100b0020dc318a43esm71189pjb.25.2023.02.07.15.05.11\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Feb 2023 15:05:11 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\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=XC9Z/WZcbYJRMRfGGnRbWvLq8XyY7AHTqG0rf0Z88tw=;\n b=qvwzapTcuZqBaC2c59y5lWyW/p7KpRhoxl1W09jOILgBQMky5PQ+IderW/RGMJz7QN\n hNH2NQ7XOTb0hdrL1wEAEwjLnKDhv+gZJyAiqwMOUrQNb4UkaD1jn/A6TIcOnvy00LjN\n rurWW8puYFeeLdkd0rlLbsatTfHDijdtjiEV61EREZjaKLVwLzrj200pHKJ2K+rjSYJ1\n Xv8DLvcmkUi5VcfNOm/lwTEdiEzPq67PupAL3NLM9wMrAayLmNR7yyiGRJHkm6HCUwRT\n NtnpGB3NHuGODWCOo8LgqEBclMKPMde6llI2rBwwsp3f39QHctzuRlACHWoUoj75Q580\n iR+A==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\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=XC9Z/WZcbYJRMRfGGnRbWvLq8XyY7AHTqG0rf0Z88tw=;\n b=nG6tJ3eG/kOJ6on3YihM7wvdlQgAOrqI+bpVLDdr+KeioR0AgxIDOnAPe/sOywV0uR\n c75G05k5s6X/I6BXQakJehBCXnfSY8BYEGTppcfDrbXc1kR5jztcUn0Bp6wY446Z57XV\n 6Ayqf1xDOqtkkRZZyJfL3P7PHCMf76N31apC2L6v79LNnl4mw++NUQpzmQawDa+E/Ao5\n rKHdLQY64OjC5twtqjvxo70/atBj75zZNfBjV4ClgrUo2nkST/17ZtU5qfxsxNyV2i2N\n RviZRh/39bWwjS46Xl75wuXWHRkvt2DWZE6oiJa81pYkMMRlqFfZeq1J3OHfTHqq50Lx\n JBzw==",
        "X-Gm-Message-State": "AO0yUKW2D0ugmHIrN7f/0tBxqtr6pSFfD4BI9xULTXx7kxqgenvAMJPY\n kJ0EIUdNLRGK2zcRku8lZg4zGcsRdgCCo9SVzdA=",
        "X-Google-Smtp-Source": "\n AK7set9dEZ39NxY0Cu+n8kqjXMI4REE3Vnj40fzCcaAH9neG33SV8ZDA3Thf0cksmZrFtT48/AIbew==",
        "X-Received": "by 2002:a17:90b:1a8c:b0:22c:9078:178 with SMTP id\n ng12-20020a17090b1a8c00b0022c90780178mr5899977pjb.27.1675811112075;\n Tue, 07 Feb 2023 15:05:12 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Byron Marohn <byron.marohn@intel.com>, Yipeng Wang <yipeng1.wang@intel.com>",
        "Subject": "[RFC v2 07/17] efd: replace RTE_LOGTYPE_EFD with local type",
        "Date": "Tue,  7 Feb 2023 15:04:28 -0800",
        "Message-Id": "<20230207230438.1617331-8-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230207230438.1617331-1-stephen@networkplumber.org>",
        "References": "<20230207204151.1503491-1-stephen@networkplumber.org>\n <20230207230438.1617331-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": "Replace all uses of global logtype with a local log type.\nDo not break message formats across source lines.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/eal/common/eal_common_log.c |   1 -\n lib/eal/include/rte_log.h       |   2 +-\n lib/efd/rte_efd.c               | 106 +++++++++++++++-----------------\n 3 files changed, 52 insertions(+), 57 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex e7ccde1c9ccd..675f3d07bbe3 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -365,7 +365,6 @@ static const struct logtype logtype_strings[] = {\n \t{RTE_LOGTYPE_PIPELINE,   \"lib.pipeline\"},\n \t{RTE_LOGTYPE_MBUF,       \"lib.mbuf\"},\n \t{RTE_LOGTYPE_CRYPTODEV,  \"lib.cryptodev\"},\n-\t{RTE_LOGTYPE_EFD,        \"lib.efd\"},\n \t{RTE_LOGTYPE_EVENTDEV,   \"lib.eventdev\"},\n \n \t{RTE_LOGTYPE_USER1,      \"user1\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex 361d1ad96299..a90fa629168d 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -44,7 +44,7 @@ extern \"C\" {\n #define RTE_LOGTYPE_PIPELINE  15 /**< Log related to pipeline. */\n #define RTE_LOGTYPE_MBUF      16 /**< Log related to mbuf. */\n #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */\n-#define RTE_LOGTYPE_EFD       18 /**< Log related to EFD. */\n+\t\t\t\t /* was RTE_LOGTYPE_EFD */\n #define RTE_LOGTYPE_EVENTDEV  19 /**< Log related to eventdev. */\n \n /* these log types can be used in an application */\ndiff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c\nindex 686a13775742..23316ef7300f 100644\n--- a/lib/efd/rte_efd.c\n+++ b/lib/efd/rte_efd.c\n@@ -87,6 +87,11 @@ static struct rte_tailq_elem rte_efd_tailq = {\n };\n EAL_REGISTER_TAILQ(rte_efd_tailq);\n \n+RTE_LOG_REGISTER_DEFAULT(efd_logtype, INFO);\n+\n+#define EFD_LOG(level, fmt, args...) \\\n+\trte_log(RTE_LOG_ ## level, efd_logtype, \"%s(): \" fmt \"\\n\", __func__, ##args)\n+\n /** Internal permutation array used to shuffle bins into pseudorandom groups */\n const uint32_t efd_bin_to_group[EFD_CHUNK_NUM_BIN_TO_GROUP_SETS][EFD_CHUNK_NUM_BINS] = {\n \t{\n@@ -509,13 +514,12 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \tefd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);\n \n \tif (online_cpu_socket_bitmask == 0) {\n-\t\tRTE_LOG(ERR, EFD, \"At least one CPU socket must be enabled \"\n-\t\t\t\t\"in the bitmask\\n\");\n+\t\tEFD_LOG(ERR, \"At least one CPU socket must be enabled in the bitmask\");\n \t\treturn NULL;\n \t}\n \n \tif (max_num_rules == 0) {\n-\t\tRTE_LOG(ERR, EFD, \"Max num rules must be higher than 0\\n\");\n+\t\tEFD_LOG(ERR, \"Max num rules must be higher than 0\");\n \t\treturn NULL;\n \t}\n \n@@ -554,7 +558,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \n \tte = rte_zmalloc(\"EFD_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, EFD, \"tailq entry allocation failed\\n\");\n+\t\tEFD_LOG(ERR, \"tailq entry allocation failed\");\n \t\tgoto error_unlock_exit;\n \t}\n \n@@ -564,15 +568,15 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \t\t\tRTE_CACHE_LINE_SIZE,\n \t\t\toffline_cpu_socket);\n \tif (table == NULL) {\n-\t\tRTE_LOG(ERR, EFD, \"Allocating EFD table management structure\"\n-\t\t\t\t\" on socket %u failed\\n\",\n-\t\t\t\toffline_cpu_socket);\n+\t\tEFD_LOG(ERR,\n+\t\t\t\"Allocating EFD table management structureon socket %u failed\",\n+\t\t\toffline_cpu_socket);\n \t\tgoto error_unlock_exit;\n \t}\n \n \n-\tRTE_LOG(DEBUG, EFD, \"Allocated EFD table management structure \"\n-\t\t\t\"on socket %u\\n\", offline_cpu_socket);\n+\tEFD_LOG(DEBUG, \"Allocated EFD table management structure on socket %u\",\n+\t\toffline_cpu_socket);\n \n \ttable->max_num_rules = num_chunks * EFD_TARGET_CHUNK_MAX_NUM_RULES;\n \ttable->num_rules = 0;\n@@ -586,17 +590,17 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \t\t\tRTE_CACHE_LINE_SIZE,\n \t\t\toffline_cpu_socket);\n \tif (key_array == NULL) {\n-\t\tRTE_LOG(ERR, EFD, \"Allocating key array\"\n-\t\t\t\t\" on socket %u failed\\n\",\n-\t\t\t\toffline_cpu_socket);\n+\t\tEFD_LOG(ERR,\n+\t\t\t\"Allocating key array on socket %u failed\",\n+\t\t\toffline_cpu_socket);\n \t\tgoto error_unlock_exit;\n \t}\n \ttable->keys = key_array;\n \tstrlcpy(table->name, name, sizeof(table->name));\n \n-\tRTE_LOG(DEBUG, EFD, \"Creating an EFD table with %u chunks,\"\n-\t\t\t\" which potentially supports %u entries\\n\",\n-\t\t\tnum_chunks, table->max_num_rules);\n+\tEFD_LOG(DEBUG,\n+\t\t\"Creating an EFD table with %u chunks, which potentially supports %u entries\",\n+\t\tnum_chunks, table->max_num_rules);\n \n \t/* Make sure all the allocatable table pointers are NULL initially */\n \tfor (socket_id = 0; socket_id < RTE_MAX_NUMA_NODES; socket_id++)\n@@ -623,19 +627,16 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \t\t\t\tRTE_CACHE_LINE_SIZE,\n \t\t\t\tsocket_id);\n \t\t\tif (table->chunks[socket_id] == NULL) {\n-\t\t\t\tRTE_LOG(ERR, EFD,\n-\t\t\t\t\t\t\"Allocating EFD online table on \"\n-\t\t\t\t\t\t\"socket %u failed\\n\",\n-\t\t\t\t\t\tsocket_id);\n+\t\t\t\tEFD_LOG(ERR,\n+\t\t\t\t\t\"Allocating EFD online table on socket %u failed\",\n+\t\t\t\t\tsocket_id);\n \t\t\t\tgoto error_unlock_exit;\n \t\t\t}\n-\t\t\tRTE_LOG(DEBUG, EFD,\n-\t\t\t\t\t\"Allocated EFD online table of size \"\n-\t\t\t\t\t\"%\"PRIu64\" bytes (%.2f MB) on socket %u\\n\",\n-\t\t\t\t\tonline_table_size,\n-\t\t\t\t\t(float) online_table_size /\n-\t\t\t\t\t\t(1024.0F * 1024.0F),\n-\t\t\t\t\tsocket_id);\n+\t\t\tEFD_LOG(DEBUG,\n+\t\t\t\t\"Allocated EFD online table of size %\" PRIu64 \" bytes (%.2f MB) on socket %u\",\n+\t\t\t\tonline_table_size,\n+\t\t\t\t(float) online_table_size / (1024.0F * 1024.0F),\n+\t\t\t\tsocket_id);\n \t\t}\n \t}\n \n@@ -675,16 +676,17 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \t\t\tRTE_CACHE_LINE_SIZE,\n \t\t\toffline_cpu_socket);\n \tif (table->offline_chunks == NULL) {\n-\t\tRTE_LOG(ERR, EFD, \"Allocating EFD offline table on socket %u \"\n-\t\t\t\t\"failed\\n\", offline_cpu_socket);\n+\t\tEFD_LOG(ERR,\n+\t\t\t\"Allocating EFD offline table on socket %u failed\",\n+\t\t\toffline_cpu_socket);\n \t\tgoto error_unlock_exit;\n \t}\n \n-\tRTE_LOG(DEBUG, EFD,\n-\t\t\t\"Allocated EFD offline table of size %\"PRIu64\" bytes \"\n-\t\t\t\" (%.2f MB) on socket %u\\n\", offline_table_size,\n-\t\t\t(float) offline_table_size / (1024.0F * 1024.0F),\n-\t\t\toffline_cpu_socket);\n+\tEFD_LOG(DEBUG,\n+\t\t\"Allocated EFD offline table of size %\" PRIu64 \" bytes  (%.2f MB) on socket %u\",\n+\t\toffline_table_size,\n+\t\t(float) offline_table_size / (1024.0F * 1024.0F),\n+\t\toffline_cpu_socket);\n \n \tte->data = (void *) table;\n \tTAILQ_INSERT_TAIL(efd_list, te, next);\n@@ -695,7 +697,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,\n \tr = rte_ring_create(ring_name, rte_align32pow2(table->max_num_rules),\n \t\t\toffline_cpu_socket, 0);\n \tif (r == NULL) {\n-\t\tRTE_LOG(ERR, EFD, \"memory allocation failed\\n\");\n+\t\tEFD_LOG(ERR, \"ring memory allocation failed\");\n \t\trte_efd_free(table);\n \t\treturn NULL;\n \t}\n@@ -1015,20 +1017,17 @@ efd_compute_update(struct rte_efd_table * const table,\n \tif (found == 0) {\n \t\t/* Key does not exist. Insert the rule into the bin/group */\n \t\tif (unlikely(current_group->num_rules >= EFD_MAX_GROUP_NUM_RULES)) {\n-\t\t\tRTE_LOG(ERR, EFD,\n-\t\t\t\t\t\"Fatal: No room remaining for insert into \"\n-\t\t\t\t\t\"chunk %u group %u bin %u\\n\",\n-\t\t\t\t\t*chunk_id,\n-\t\t\t\t\tcurrent_group_id, *bin_id);\n+\t\t\tEFD_LOG(ERR,\n+\t\t\t\t\"Fatal: No room remaining for insert into chunk %u group %u bin %u\",\n+\t\t\t\t*chunk_id, current_group_id, *bin_id);\n \t\t\treturn RTE_EFD_UPDATE_FAILED;\n \t\t}\n \n \t\tif (unlikely(current_group->num_rules ==\n \t\t\t\t(EFD_MAX_GROUP_NUM_RULES - 1))) {\n-\t\t\tRTE_LOG(INFO, EFD, \"Warn: Insert into last \"\n-\t\t\t\t\t\"available slot in chunk %u \"\n-\t\t\t\t\t\"group %u bin %u\\n\", *chunk_id,\n-\t\t\t\t\tcurrent_group_id, *bin_id);\n+\t\t\tEFD_LOG(NOTICE,\n+\t\t\t       \"Insert into last available slot in chunk %u group %u bin %u\",\n+\t\t\t       *chunk_id, current_group_id, *bin_id);\n \t\t\tstatus = RTE_EFD_UPDATE_WARN_GROUP_FULL;\n \t\t}\n \n@@ -1112,14 +1111,11 @@ efd_compute_update(struct rte_efd_table * const table,\n \tuint8_t choice = 0;\n \tfor (;;) {\n \t\tif (current_group != new_group &&\n-\t\t\t\tnew_group->num_rules + bin_size >\n-\t\t\t\t\tEFD_MAX_GROUP_NUM_RULES) {\n-\t\t\tRTE_LOG(DEBUG, EFD,\n-\t\t\t\t\t\"Unable to move_groups to dest group \"\n-\t\t\t\t\t\"containing %u entries.\"\n-\t\t\t\t\t\"bin_size:%u choice:%02x\\n\",\n-\t\t\t\t\tnew_group->num_rules, bin_size,\n-\t\t\t\t\tchoice - 1);\n+\t\t    new_group->num_rules + bin_size > EFD_MAX_GROUP_NUM_RULES) {\n+\t\t\tEFD_LOG(DEBUG,\n+\t\t\t\t\"Unable to move_groups to dest group containing %u entries. bin_size:%u choice:%02x\",\n+\t\t\t\tnew_group->num_rules, bin_size,\n+\t\t\t\tchoice - 1);\n \t\t\tgoto next_choice;\n \t\t}\n \t\tmove_groups(*bin_id, bin_size, new_group, current_group);\n@@ -1132,10 +1128,10 @@ efd_compute_update(struct rte_efd_table * const table,\n \t\tif (!ret)\n \t\t\treturn status;\n \n-\t\tRTE_LOG(DEBUG, EFD,\n-\t\t\t\t\"Failed to find perfect hash for group \"\n-\t\t\t\t\"containing %u entries. bin_size:%u choice:%02x\\n\",\n-\t\t\t\tnew_group->num_rules, bin_size, choice - 1);\n+\t\tEFD_LOG(DEBUG,\n+\t\t\t\"Failed to find perfect hash for group containing %u entries. bin_size:%u choice:%02x\",\n+\t\t\tnew_group->num_rules, bin_size, choice - 1);\n+\n \t\t/* Restore groups modified to their previous state */\n \t\trevert_groups(current_group, new_group, bin_size);\n \n",
    "prefixes": [
        "RFC",
        "v2",
        "07/17"
    ]
}