Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/123400/?format=api
http://patches.dpdk.org/api/patches/123400/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230207230438.1617331-15-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-15-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230207230438.1617331-15-stephen@networkplumber.org", "date": "2023-02-07T23:04:35", "name": "[RFC,v2,14/17] kni: replace RTE_LOGTYPE_KNI with dynamic type", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3d4cb122408d1303b07dead037e0f744009a4625", "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-15-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/123400/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/123400/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 1064C41C34;\n\tWed, 8 Feb 2023 00:06:51 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E901D42DA2;\n\tWed, 8 Feb 2023 00:05:25 +0100 (CET)", "from mail-pj1-f52.google.com (mail-pj1-f52.google.com\n [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id A192B42BC9\n for <dev@dpdk.org>; Wed, 8 Feb 2023 00:05:20 +0100 (CET)", "by mail-pj1-f52.google.com with SMTP id\n rm7-20020a17090b3ec700b0022c05558d22so360110pjb.5\n for <dev@dpdk.org>; Tue, 07 Feb 2023 15:05:20 -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.19\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 07 Feb 2023 15:05:19 -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=F63Q3+OzR2yVFeUNq5eBJMBVmfpDBbBM8IfALOhQmPw=;\n b=FjAAoNpyuqekKYa9VoH6QycZ/evTgYkXLwJ68cNfwJAgwLk9GZJi34y3gxnAL7QEbK\n ixrN0w/Snk13qDZUCvFQJ3j47BTP7hV0GpnGDE1ytBH4RjXwvtfqMEiQ6l0jEHFZRBds\n e5h16vjZpCzFLJg/eD67sXHwfJmw7P6Nx30ChNLwA6JT+xTT6tz5H9WiYZiXLO05faui\n b5C37Mp9SEpRFSIrgh5JPE+NTkrqP9HqbcumtfAwzqDaMEVk+JGYa6fuYQJn3xwycc4l\n +VB+f5vzVWnXdb+9yOF1ll4O3jlNhzaaiWilyBLhEs1rcDKfheyeLO8TCDVnOHCINuAo\n HVUA==", "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=F63Q3+OzR2yVFeUNq5eBJMBVmfpDBbBM8IfALOhQmPw=;\n b=A/xNesUa4ieYfdb1cdnPoDgKgKrAfZgJMCIbwvLsRZgExWzhrr6NRkePE4yB00Kz9T\n syujTk2dwHJWW/hfUyZT5la8CSSDCyWh0IU+xpo0pYMueE/0XP0Kr2aqGWo73UzItN8H\n S2J5o5r0nhydLrRQKfwhfxQqPm4dtl5yX9zr6IUdiFnQhArbxnXbhUO26GNQy70nBjR7\n svluN2+pE/LawecZJaEdK+dY0H827WTTRv4Myl8Rptb/Ny6UD5sc0iMzMVWtBgakmkfQ\n mUqhil2PRc//SarGM0u3DttK9gb2Wl6l9r6fhg9dEYi+dv1luKSGsulkvTrMrkGPxnWm\n 7g7Q==", "X-Gm-Message-State": "AO0yUKVCfR9N0/pXM/7I4SoXuDe4uP52js2hMbdj4OcMhAYZp+0+aqRV\n jQV3PZ0MNGstXbcMV+zkmBOKSbssa5KQix9JYDI=", "X-Google-Smtp-Source": "\n AK7set94GAae4TNTIiBRXosG88rNhRWBJiWFq5o9KW96U6WVy368SgCBrs09Q705IPe4p0BiQ/bLDg==", "X-Received": "by 2002:a17:90b:3847:b0:22b:f214:a919 with SMTP id\n nl7-20020a17090b384700b0022bf214a919mr5779093pjb.49.1675811119590;\n Tue, 07 Feb 2023 15:05:19 -0800 (PST)", "From": "Stephen Hemminger <stephen@networkplumber.org>", "To": "dev@dpdk.org", "Cc": "Stephen Hemminger <stephen@networkplumber.org>", "Subject": "[RFC v2 14/17] kni: replace RTE_LOGTYPE_KNI with dynamic type", "Date": "Tue, 7 Feb 2023 15:04:35 -0800", "Message-Id": "<20230207230438.1617331-15-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": "Even though KNI will eventually disappear, fix the\nlogtype now.\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/kni/rte_kni.c | 63 ++++++++++++++++++---------------\n 3 files changed, 35 insertions(+), 31 deletions(-)", "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex ff250b9a6d56..b0c625a02cdf 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = {\n \t{RTE_LOGTYPE_EAL, \"lib.eal\"},\n \t{RTE_LOGTYPE_PMD, \"pmd\"},\n \t{RTE_LOGTYPE_HASH, \"lib.hash\"},\n-\t{RTE_LOGTYPE_KNI, \"lib.kni\"},\n \t{RTE_LOGTYPE_METER, \"lib.meter\"},\n \t{RTE_LOGTYPE_SCHED, \"lib.sched\"},\n \t{RTE_LOGTYPE_PORT, \"lib.port\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex 55067efb0a84..69d3d07252ec 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -34,7 +34,7 @@ extern \"C\" {\n #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */\n #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */\n \t\t\t\t /* was RTE_LOGTYPE_LPM */\n-#define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */\n+\t\t\t\t /* was RTE_LOGTYPE_KNI */\n \t\t\t\t /* was RTE_LOGTYPE_ACL */\n \t\t\t\t /* was RTE_LOGTYPE_POWER */\n #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */\ndiff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c\nindex 8ab6c4715314..baf732017a43 100644\n--- a/lib/kni/rte_kni.c\n+++ b/lib/kni/rte_kni.c\n@@ -92,15 +92,20 @@ static void kni_allocate_mbufs(struct rte_kni *kni);\n \n static volatile int kni_fd = -1;\n \n+RTE_LOG_REGISTER_SUFFIX(kni_logtype, \"kni\", INFO);\n+\n+#define KNI_LOG(level, fmt, args...) \\\n+\trte_log(RTE_LOG_ ## level, kni_logtype,\tfmt, ## args)\n+\n /* Shall be called before any allocation happens */\n int\n rte_kni_init(unsigned int max_kni_ifaces __rte_unused)\n {\n-\tRTE_LOG(WARNING, KNI, \"WARNING: KNI is deprecated and will be removed in DPDK 23.11\\n\");\n+\tKNI_LOG(WARNING, \"WARNING: KNI is deprecated and will be removed in DPDK 23.11\\n\");\n \n #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)\n \tif (rte_eal_iova_mode() != RTE_IOVA_PA) {\n-\t\tRTE_LOG(ERR, KNI, \"KNI requires IOVA as PA\\n\");\n+\t\tKNI_LOG(ERR, \"KNI requires IOVA as PA\\n\");\n \t\treturn -1;\n \t}\n #endif\n@@ -109,7 +114,7 @@ rte_kni_init(unsigned int max_kni_ifaces __rte_unused)\n \tif (kni_fd < 0) {\n \t\tkni_fd = open(\"/dev/\" KNI_DEVICE, O_RDWR);\n \t\tif (kni_fd < 0) {\n-\t\t\tRTE_LOG(ERR, KNI,\n+\t\t\tKNI_LOG(ERR,\n \t\t\t\t\"Can not open /dev/%s\\n\", KNI_DEVICE);\n \t\t\treturn -1;\n \t\t}\n@@ -225,7 +230,7 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \n \t/* Check if KNI subsystem has been initialized */\n \tif (kni_fd < 0) {\n-\t\tRTE_LOG(ERR, KNI, \"KNI subsystem has not been initialized. Invoke rte_kni_init() first\\n\");\n+\t\tKNI_LOG(ERR, \"KNI subsystem has not been initialized. Invoke rte_kni_init() first\\n\");\n \t\treturn NULL;\n \t}\n \n@@ -233,19 +238,19 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool,\n \n \tkni = __rte_kni_get(conf->name);\n \tif (kni != NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"KNI already exists\\n\");\n+\t\tKNI_LOG(ERR, \"KNI already exists\\n\");\n \t\tgoto unlock;\n \t}\n \n \tte = rte_zmalloc(\"KNI_TAILQ_ENTRY\", sizeof(*te), 0);\n \tif (te == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"Failed to allocate tailq entry\\n\");\n+\t\tKNI_LOG(ERR, \"Failed to allocate tailq entry\\n\");\n \t\tgoto unlock;\n \t}\n \n \tkni = rte_zmalloc(\"KNI\", sizeof(struct rte_kni), RTE_CACHE_LINE_SIZE);\n \tif (kni == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"KNI memory allocation failed\\n\");\n+\t\tKNI_LOG(ERR, \"KNI memory allocation failed\\n\");\n \t\tgoto kni_fail;\n \t}\n \n@@ -424,7 +429,7 @@ rte_kni_release(struct rte_kni *kni)\n \n \tstrlcpy(dev_info.name, kni->name, sizeof(dev_info.name));\n \tif (ioctl(kni_fd, RTE_KNI_IOCTL_RELEASE, &dev_info) < 0) {\n-\t\tRTE_LOG(ERR, KNI, \"Fail to release kni device\\n\");\n+\t\tKNI_LOG(ERR, \"Fail to release kni device\\n\");\n \t\tgoto unlock;\n \t}\n \n@@ -439,7 +444,7 @@ rte_kni_release(struct rte_kni *kni)\n \t\tusleep(1000);\n \n \tif (kni_fifo_count(kni->rx_q))\n-\t\tRTE_LOG(ERR, KNI, \"Fail to free all Rx-q items\\n\");\n+\t\tKNI_LOG(ERR, \"Fail to free all Rx-q items\\n\");\n \n \tkni_free_fifo_phy(kni->pktmbuf_pool, kni->alloc_q);\n \tkni_free_fifo(kni->tx_q);\n@@ -466,16 +471,16 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])\n \tint ret = 0;\n \n \tif (!rte_eth_dev_is_valid_port(port_id)) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid port id %d\\n\", port_id);\n+\t\tKNI_LOG(ERR, \"Invalid port id %d\\n\", port_id);\n \t\treturn -EINVAL;\n \t}\n \n-\tRTE_LOG(INFO, KNI, \"Configure mac address of %d\", port_id);\n+\tKNI_LOG(INFO, \"Configure mac address of %d\", port_id);\n \n \tret = rte_eth_dev_default_mac_addr_set(port_id,\n \t\t\t\t\t(struct rte_ether_addr *)mac_addr);\n \tif (ret < 0)\n-\t\tRTE_LOG(ERR, KNI, \"Failed to config mac_addr for port %d\\n\",\n+\t\tKNI_LOG(ERR, \"Failed to config mac_addr for port %d\\n\",\n \t\t\tport_id);\n \n \treturn ret;\n@@ -488,11 +493,11 @@ kni_config_promiscusity(uint16_t port_id, uint8_t to_on)\n \tint ret;\n \n \tif (!rte_eth_dev_is_valid_port(port_id)) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid port id %d\\n\", port_id);\n+\t\tKNI_LOG(ERR, \"Invalid port id %d\\n\", port_id);\n \t\treturn -EINVAL;\n \t}\n \n-\tRTE_LOG(INFO, KNI, \"Configure promiscuous mode of %d to %d\\n\",\n+\tKNI_LOG(INFO, \"Configure promiscuous mode of %d to %d\\n\",\n \t\tport_id, to_on);\n \n \tif (to_on)\n@@ -501,7 +506,7 @@ kni_config_promiscusity(uint16_t port_id, uint8_t to_on)\n \t\tret = rte_eth_promiscuous_disable(port_id);\n \n \tif (ret != 0)\n-\t\tRTE_LOG(ERR, KNI,\n+\t\tKNI_LOG(ERR,\n \t\t\t\"Failed to %s promiscuous mode for port %u: %s\\n\",\n \t\t\tto_on ? \"enable\" : \"disable\", port_id,\n \t\t\trte_strerror(-ret));\n@@ -516,11 +521,11 @@ kni_config_allmulticast(uint16_t port_id, uint8_t to_on)\n \tint ret;\n \n \tif (!rte_eth_dev_is_valid_port(port_id)) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid port id %d\\n\", port_id);\n+\t\tKNI_LOG(ERR, \"Invalid port id %d\\n\", port_id);\n \t\treturn -EINVAL;\n \t}\n \n-\tRTE_LOG(INFO, KNI, \"Configure allmulticast mode of %d to %d\\n\",\n+\tKNI_LOG(INFO, \"Configure allmulticast mode of %d to %d\\n\",\n \t\tport_id, to_on);\n \n \tif (to_on)\n@@ -528,7 +533,7 @@ kni_config_allmulticast(uint16_t port_id, uint8_t to_on)\n \telse\n \t\tret = rte_eth_allmulticast_disable(port_id);\n \tif (ret != 0)\n-\t\tRTE_LOG(ERR, KNI,\n+\t\tKNI_LOG(ERR,\n \t\t\t\"Failed to %s allmulticast mode for port %u: %s\\n\",\n \t\t\tto_on ? \"enable\" : \"disable\", port_id,\n \t\t\trte_strerror(-ret));\n@@ -551,7 +556,7 @@ rte_kni_handle_request(struct rte_kni *kni)\n \t\treturn 0; /* It is OK of can not getting the request mbuf */\n \n \tif (req != kni->sync_addr) {\n-\t\tRTE_LOG(ERR, KNI, \"Wrong req pointer %p\\n\", req);\n+\t\tKNI_LOG(ERR, \"Wrong req pointer %p\\n\", req);\n \t\treturn -1;\n \t}\n \n@@ -592,7 +597,7 @@ rte_kni_handle_request(struct rte_kni *kni)\n \t\t\t\t\tkni->ops.port_id, req->allmulti);\n \t\tbreak;\n \tdefault:\n-\t\tRTE_LOG(ERR, KNI, \"Unknown request id %u\\n\", req->req_id);\n+\t\tKNI_LOG(ERR, \"Unknown request id %u\\n\", req->req_id);\n \t\treq->result = -EINVAL;\n \t\tbreak;\n \t}\n@@ -603,7 +608,7 @@ rte_kni_handle_request(struct rte_kni *kni)\n \telse\n \t\tret = 1;\n \tif (ret != 1) {\n-\t\tRTE_LOG(ERR, KNI, \"Fail to put the muf back to resp_q\\n\");\n+\t\tKNI_LOG(ERR, \"Fail to put the muf back to resp_q\\n\");\n \t\treturn -1; /* It is an error of can't putting the mbuf back */\n \t}\n \n@@ -679,7 +684,7 @@ kni_allocate_mbufs(struct rte_kni *kni)\n \n \t/* Check if pktmbuf pool has been configured */\n \tif (kni->pktmbuf_pool == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"No valid mempool for allocating mbufs\\n\");\n+\t\tKNI_LOG(ERR, \"No valid mempool for allocating mbufs\\n\");\n \t\treturn;\n \t}\n \n@@ -690,7 +695,7 @@ kni_allocate_mbufs(struct rte_kni *kni)\n \t\tpkts[i] = rte_pktmbuf_alloc(kni->pktmbuf_pool);\n \t\tif (unlikely(pkts[i] == NULL)) {\n \t\t\t/* Out of memory */\n-\t\t\tRTE_LOG(ERR, KNI, \"Out of memory\\n\");\n+\t\t\tKNI_LOG(ERR, \"Out of memory\\n\");\n \t\t\tbreak;\n \t\t}\n \t\tphys[i] = va2pa(pkts[i]);\n@@ -757,18 +762,18 @@ rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops)\n \tenum kni_ops_status req_status;\n \n \tif (ops == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid KNI request operation.\\n\");\n+\t\tKNI_LOG(ERR, \"Invalid KNI request operation.\\n\");\n \t\treturn -1;\n \t}\n \n \tif (kni == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid kni info.\\n\");\n+\t\tKNI_LOG(ERR, \"Invalid kni info.\\n\");\n \t\treturn -1;\n \t}\n \n \treq_status = kni_check_request_register(&kni->ops);\n \tif (req_status == KNI_REQ_REGISTERED) {\n-\t\tRTE_LOG(ERR, KNI, \"The KNI request operation has already registered.\\n\");\n+\t\tKNI_LOG(ERR, \"The KNI request operation has already registered.\\n\");\n \t\treturn -1;\n \t}\n \n@@ -780,7 +785,7 @@ int\n rte_kni_unregister_handlers(struct rte_kni *kni)\n {\n \tif (kni == NULL) {\n-\t\tRTE_LOG(ERR, KNI, \"Invalid kni info.\\n\");\n+\t\tKNI_LOG(ERR, \"Invalid kni info.\\n\");\n \t\treturn -1;\n \t}\n \n@@ -806,7 +811,7 @@ rte_kni_update_link(struct rte_kni *kni, unsigned int linkup)\n \n \tfd = open(path, O_RDWR);\n \tif (fd == -1) {\n-\t\tRTE_LOG(ERR, KNI, \"Failed to open file: %s.\\n\", path);\n+\t\tKNI_LOG(ERR, \"Failed to open file: %s.\\n\", path);\n \t\treturn -1;\n \t}\n \n@@ -823,7 +828,7 @@ rte_kni_update_link(struct rte_kni *kni, unsigned int linkup)\n \tnew_carrier = linkup ? \"1\" : \"0\";\n \tret = write(fd, new_carrier, 1);\n \tif (ret < 1) {\n-\t\tRTE_LOG(ERR, KNI, \"Failed to write file: %s.\\n\", path);\n+\t\tKNI_LOG(ERR, \"Failed to write file: %s.\\n\", path);\n \t\tclose(fd);\n \t\treturn -1;\n \t}\n", "prefixes": [ "RFC", "v2", "14/17" ] }{ "id": 123400, "url": "