From patchwork Mon Feb 20 23:35:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124224 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 59A7741CF1; Tue, 21 Feb 2023 00:36:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BEA104311D; Tue, 21 Feb 2023 00:36:01 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id ED4B443117 for ; Tue, 21 Feb 2023 00:35:59 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n20so1396390pfu.12 for ; Mon, 20 Feb 2023 15:35:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bRyRO3VTymBjGYshCckfveSSAEGjziLD70dZsRHNoIE=; b=ZvyRUz6LvTLPwn3sG/VeeBY34LuV8x0Yaq5Q6PVyyMnyWVEspBGvxScQ/o/Gyxm5f3 iqq1Ux8cbMETuVIggycxfkqlxz2S0RwV1uMTfbG07JGHJQrFNGoFhZ9NDJ7Nrj6ZYe13 d3a0m+5AY1LE9xzG0KDkLGphY/AfXtMZeDVmkIDUfQvK0FQ88lHPABGsK4pF9XAkd521 IbBamsCu/ivFsKYCx+KW7wcroFlp48zAZuLjgefpMCWrxep/AByEY/wjoCE2Vhetbgat 8qpdC3a8Emgfey8550B4GA1vyMdgHS3VMqCyS072zpWfdkVj3vf30WotPdneTOPs2RtD GjAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bRyRO3VTymBjGYshCckfveSSAEGjziLD70dZsRHNoIE=; b=TJRkpRY3L8g91kABRQTMfDhfhokffXw47ZeOwYeP8mqGvxtB53iy61K8Vk6PN0qYrS 77ZEQqTr7wcJFaC5eA6NLTD/UroiobdZpuRPVeQ9Ld0PDPDJcknq+pHhH+t4HR5RSCeA 2+1eswm5dkpeh1rP1+lNaY48hqNu9j3+iU3HlUsI5DNic46dRn5ecdCsUl1DsyYySdav /ZDca/1Cr3l2n5Ui4BAAYUsLpvdVulwAxPoT289cVsl62PTG1Sj5IGm83RaaCbPQOvUr LF/M8W+aJ9hiP2C7UwqeLcOd4991R8S/4/9b2KmSc7sChdyfw11vEd+RPSrkYxbhf8tC DVMQ== X-Gm-Message-State: AO0yUKWqB34y+lcTnghWOLRus0senQb3BUsUHwWBKJn8pLdfCMqXAs++ /RAdGQYpRAHKaOlAo7TyZp3NgksBCyLzHm4qilQ= X-Google-Smtp-Source: AK7set/2x7I1T0qd9hAhFlFM1GIfHapNw8JGYtJwpPXQCvunARIvnk9G9JdvtHhR2aaM2TRB0i+UcQ== X-Received: by 2002:a05:6a00:86:b0:5a8:c044:663e with SMTP id c6-20020a056a00008600b005a8c044663emr3234383pfj.21.1676936158901; Mon, 20 Feb 2023 15:35:58 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.35.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:35:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu Subject: [PATCH v8 01/22] gso: don't log message on non TCP/UDP Date: Mon, 20 Feb 2023 15:35:35 -0800 Message-Id: <20230220233556.168553-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org If a large packet is passed into GSO routines of unknown protocol then library would log a message. Better to tell the application instead of logging. Fixes: 119583797b6a ("gso: support TCP/IPv4 GSO") Reviewed-by: Jiayu Hu Signed-off-by: Stephen Hemminger --- lib/gso/rte_gso.c | 5 ++--- lib/gso/rte_gso.h | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gso/rte_gso.c b/lib/gso/rte_gso.c index 4b59217c16ee..c8e67c2d4b48 100644 --- a/lib/gso/rte_gso.c +++ b/lib/gso/rte_gso.c @@ -80,9 +80,8 @@ rte_gso_segment(struct rte_mbuf *pkt, ret = gso_udp4_segment(pkt, gso_size, direct_pool, indirect_pool, pkts_out, nb_pkts_out); } else { - /* unsupported packet, skip */ - RTE_LOG(DEBUG, GSO, "Unsupported packet type\n"); - ret = 0; + ret = -ENOTSUP; /* only UDP or TCP allowed */ + } if (ret < 0) { diff --git a/lib/gso/rte_gso.h b/lib/gso/rte_gso.h index 40922524df42..23d6980aff9f 100644 --- a/lib/gso/rte_gso.h +++ b/lib/gso/rte_gso.h @@ -114,6 +114,7 @@ struct rte_gso_ctx { * - The number of GSO segments filled in pkts_out on success. * - Return 0 if it does not need to be GSO'd. * - Return -ENOMEM if run out of memory in MBUF pools. + * - Return -ENOTSUP for protocols that can not be segmentd (not UDP or TCP) * - Return -EINVAL for invalid parameters. */ int rte_gso_segment(struct rte_mbuf *pkt, From patchwork Mon Feb 20 23:35:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124225 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 8D87A41CF1; Tue, 21 Feb 2023 00:36:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE63243122; Tue, 21 Feb 2023 00:36:06 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id ECAB143119 for ; Tue, 21 Feb 2023 00:36:00 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id x24so1478608pfn.7 for ; Mon, 20 Feb 2023 15:36:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V9Kt7oTF7UOze3PgNSFkM4Zjg2wOosJOCNnRu50oJkE=; b=JsU11DkUNpFMAy055DYwd1x1RAnvfwSWyoaCAvTBe7AUnMlv5/avyDb40n36YkDlVt YpFWeaSsZdim4EzIdwuUC3nWJ90K2wCCYielR0ZTl3uHK6TsWo1hUGlZ/MvkfeA5HHO1 FCdGluWfASIZxTZ03iZBU4XGoeYLOqhxFt8AmIdOsTx3eyysH3COosagDvQ0tdIaWIoT KjBX6QCqV11KWxNtzu0RjyfUs8WTiKMr4BeGhdNcACX6kjlQBjdOVIA8y2XqQGTweAuA vhhdKsaMLceky8gDDH2Z6r+WiB0MCRuH0ooTjea72lYzp+Q9KKA4y/75rL5twGDmLCSN J3Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V9Kt7oTF7UOze3PgNSFkM4Zjg2wOosJOCNnRu50oJkE=; b=cRseuNDgl4goqIyKCjGLsJ4kX//J1jtHUqhWfwxavTtgRh4sY7tpsacI2lZFSiCsiN Chxi0uPvSuBT0uGE3WeVQ7smeXs6vRWYLOHGBxv+BvZbBQ7p3i0GTIlbCEotRnFrkHSD ikVWkDr+F6I5VShBnk8YHx81mTMmG/d0Ie6kRF+vfhviFyZAJddkEcrm7LM7JShtf+LK n7fSvg9QyoAHQ8YQ3TdggnW6a5KRCtO5mkxSUDqXrMO4JG7dBq3tWdbX+SebBOcCMMwj ymv2luRvySiqW4ZVGPIw3x03qow4RUb/azFr9blecmOmXQo+3k3gYvDdr5vJ413YpuX9 xfKQ== X-Gm-Message-State: AO0yUKWCxxRcjvrUp03on2/gxJQZoSg6Cw2s4E44kU5IrZRlzali4PVv lisSpEz5MKIzpIoPkJBYUilqSon9HbzQOgYlosM= X-Google-Smtp-Source: AK7set/6sUN9VyKilqM7q2vvwe6EqJ+abAXN84N4lsmZVrlrRsprDD5dQCP283p3Ut0sMBUb4TRT3w== X-Received: by 2002:a62:1ad1:0:b0:5a9:c772:85ab with SMTP id a200-20020a621ad1000000b005a9c77285abmr3805491pfa.22.1676936159769; Mon, 20 Feb 2023 15:35:59 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:35:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 02/22] eal: drop no longer used GSO logtype Date: Mon, 20 Feb 2023 15:35:36 -0800 Message-Id: <20230220233556.168553-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The message that used this was replaced in previous patch. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index bd7b188ceb4a..894701e8c19c 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -368,7 +368,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, - {RTE_LOGTYPE_GSO, "lib.gso"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 6d2b0856a565..11d517806054 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -46,7 +46,7 @@ extern "C" { #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */ + /* was RTE_LOGTYPE_GSO */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */ From patchwork Mon Feb 20 23:35:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124226 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id D9AB241CF1; Tue, 21 Feb 2023 00:36:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02BDC43127; Tue, 21 Feb 2023 00:36:08 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id C4C504311E for ; Tue, 21 Feb 2023 00:36:01 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id e24so1532435pfn.3 for ; Mon, 20 Feb 2023 15:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KaYsu7gz7TO+vOUNdxRcqvUT1IJO0KThl+eic2e4JGE=; b=dBS9bFhmgDL1yny7CKppH4pM2kBJZqGFcTg2XMhMtSGbLOqXH7/Bq4KI2W09VWY3SF c2MUiMCYoGkacH8Vyu1jo08JrEbOVykJWquGVnQwpTVwFT6YAcEAu3Wy2s0DNP7PjGEk /O9oOXImOmI8UA81rZrOQanEJVZXuJuyViad5PeJ+HfA09TOVVZOx9igdF9AoP5hKd5L 55kYQwL/OzGqbudRW12SbBA+lfBpkDMBQkQAfLyRxCYXhDbkhImlMV7PcBkzZ0vScxuA 3R5ymXnAuQwkHipPKZoUNu8hpqU/l9fn/TkvXRfHflvOryQVFacYHDzUEsK95r6V46th d5QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KaYsu7gz7TO+vOUNdxRcqvUT1IJO0KThl+eic2e4JGE=; b=6pIZ1v1JHZ32PN4TGinmPKIozaOeBYUUqtP3e+gdvw2rPSNZSxCqytGAAM0FnuOw8K ZvXyiOAPJm8LnuxtYsTTBWmHc9kVgJvzPsZAhawF27WW61GmRi+yelvc23k8wDO+5Uip heFsN/F1AJZD0d7FXNmusuGLE5OX44QaWOybtu00lHXHxWU4aG72PI1ZXmzfno4MkZvt 9qlOFhLTYA5TaEQxEuVjsSc3iZUmPrc9NIMAWvbpkUPAcvL+0iKhe+UQzO0qGYZ1TTic XeoU1CklVKp+165kyezxAjuYtHZL81Te4/JXSs9FxCmp09okhuXNW1RcGO1/NfXVYita lnxQ== X-Gm-Message-State: AO0yUKUvapljyzZS8jG/6bqwyelakiR31FjVjJFnw9p0Cj9s1LXGvYy0 gP0NcvzDavdgCzMQzVuGHWIGWpD7XO8qElO7sAk= X-Google-Smtp-Source: AK7set/EyRXhBw2oxxnUtGHIBZzmCdsUATPrx29sKlL7JPJOcrjLjNIh+QH6vouLP6/T4BFADB8e8Q== X-Received: by 2002:a62:7988:0:b0:5a9:c75f:bcc4 with SMTP id u130-20020a627988000000b005a9c75fbcc4mr2507741pfc.25.1676936160749; Mon, 20 Feb 2023 15:36:00 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:00 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 03/22] log: drop unused RTE_LOGTYPE_TIMER Date: Mon, 20 Feb 2023 15:35:37 -0800 Message-Id: <20230220233556.168553-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The timer code does not use rte_log. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 894701e8c19c..5421da008f5b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -352,7 +352,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, - {RTE_LOGTYPE_TIMER, "lib.timer"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 11d517806054..16d6ea31583d 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -30,7 +30,7 @@ extern "C" { #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ #define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ -#define RTE_LOGTYPE_TIMER 4 /**< Log related to timers. */ + /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ From patchwork Mon Feb 20 23:35:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124227 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 755D541CF1; Tue, 21 Feb 2023 00:36:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 967174312C; Tue, 21 Feb 2023 00:36:09 +0100 (CET) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id B70BE43120 for ; Tue, 21 Feb 2023 00:36:02 +0100 (CET) Received: by mail-pg1-f180.google.com with SMTP id i31so818292pgi.10 for ; Mon, 20 Feb 2023 15:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F0D+hj5Bg0vmf4yNAzBM9EKiuqa4HmHrh/mXAEir/+o=; b=J1atS77o9oZM2iOYi2/iL+TCoGUsSJVYvevze7YQMvk3AlMS9Kr2ndbtgPPNrFmg8d LGdKokNsA/jrwzJpJt7E0kpAqoCBBMJVpqJ16UwVp3Ak3LMV2tFO1QlluwLfG10AqFG/ nDuc7+n4pnNCnEzR+qrlSG+lfSow4+01By8XJIz5OpUUfJXPAakkZHsRhqyNzbXFq4f8 DEMzk/3XRj7lbgypTgzWkV5DPoKyVDsrDP4zLVzKx4Ukt883YLq15+CkebOsJG7qbWMw +S+Sc6bStGnZKxDOOyKkKYfIYDL1Q4mUES8K3kjfpaPUZaqYD6VqbU9cTELE1UNiEEEW rYFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F0D+hj5Bg0vmf4yNAzBM9EKiuqa4HmHrh/mXAEir/+o=; b=0sDGvT5CAzUbyx1m/pc0F53gnBGVbUWws97h9dV0+3WGPXDp18sdqfZ3QTNvKb3AOz oWEeuy3PxWqb17YrNdx2gU2biIAkHoYHU6QOWfwztNDkmfCB9LH6VHcvk9Ty5JDjt053 M32zF9ICebiAZP9TZAb667NasUFyHqtHiJ0tnPAZ4NLxF7ZefE97u+2oyAAS1Ri1ci2z 5x/QYyEKGIyMeLP2pM76EDMK6fSYiNmezGIKGGUTvAiCrtmuH43fYwZbA214C+t5NTbD kVk84Y+wesU9x+7wwhpgq6pZ8yv2PQ28fMtxuJMD9n+WxVqShZvEnWTi2FnMmHvC9V18 yzOQ== X-Gm-Message-State: AO0yUKUyyUgMR0fI50tHwPPj5PTqduQgZ7TGVYADZJLHOIM3flVsVCGE YF7ACU/tKeFbVyKtZPbLv7jMKerTD/yU67sQ1bM= X-Google-Smtp-Source: AK7set/Xs9NnmLu2qQHcjAHBkGWQIcEx1dy/b91nqCRN2aAL06yGOZTa8y3jOdGlZCIS1yRNZtsMgQ== X-Received: by 2002:a62:17c1:0:b0:593:c9b6:dc5d with SMTP id 184-20020a6217c1000000b00593c9b6dc5dmr3840338pfx.0.1676936161597; Mon, 20 Feb 2023 15:36:01 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 04/22] efd: replace RTE_LOGTYPE_EFD with dynamic type Date: Mon, 20 Feb 2023 15:35:38 -0800 Message-Id: <20230220233556.168553-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace all uses of the global logtype with a dynamic log type. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/efd/rte_efd.c | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 5421da008f5b..25bb17938cc1 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -365,7 +365,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, - {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 16d6ea31583d..0b39795b4d06 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -44,7 +44,7 @@ extern "C" { #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ #define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ -#define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ + /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ /* was RTE_LOGTYPE_GSO */ diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index 686a13775742..9edb11799c89 100644 --- a/lib/efd/rte_efd.c +++ b/lib/efd/rte_efd.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,9 @@ #include "rte_efd_arm64.h" #endif +RTE_LOG_REGISTER_DEFAULT(efd_logtype, INFO); +#define RTE_LOGTYPE_EFD efd_logtype + #define EFD_KEY(key_idx, table) (table->keys + ((key_idx) * table->key_len)) /** Hash function used to determine chunk_id and bin_id for a group */ #define EFD_HASH(key, table) \ From patchwork Mon Feb 20 23:35:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124228 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id B7D8941CF1; Tue, 21 Feb 2023 00:36:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A4AD743126; Tue, 21 Feb 2023 00:36:10 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 83CAB43120 for ; Tue, 21 Feb 2023 00:36:03 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id e24so1532495pfn.3 for ; Mon, 20 Feb 2023 15:36:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=Dx1O3mE9oP0hXHCS+a8cbszMexVw8Zq8XZS7ikkkI2PIqoLMnNuLtWPl3CmorHb7/D 2f4eKI4H3nPMqVDS6ZScnokrdyVhdEmmgVoaRKbgvU/dEy/CdB133jt6xoT3s32oJ/1i yLadT1WxGo7GUP2klvAEJK49bjjiQ5t1Nmv4W7Zcm57+YKRzxvqBboL9bykQ9mhvRiLz 3u+cV22dIZ5EINf7/56tsENfYGqlZGf75kNuDHpDyvrd5LOHbc6iw7YmvRMZbjhZ8w8g A1WhxkMz85wGsSAuoDIyqDwUYDvB8Xlv28HhJZYt3OfXFpzHkv5u2j19sKEU1Xsv6g8L StNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=4jlsnpKdD5UGDLky3r07PokjwYp2VDu4tgS7W1dWWvDluhhsW2lwAHJNkSaogeTPd2 v2S+VwXnk8TrFY2x5HN5wUwy4nVj8IMTbdZYF/erzegoT9pXkPSqMX95Kowh97RPNzFH kWzJSH4vx1Jg3rxJs5VVWQOTisO6FMTQ/F4mHvF+WhHZ6kuyeub4L21O/X76luplNWe5 VWJuiXKGMHQX6bIlZQw7OPxUl9Wq9P4kLyDID6yJWw2DgPTw6FwDPa1Yx9TlF2BuYQhu QgVxIMhXwHFJ6TcgWFQWwxc8tosOYrMdcfvf1gJ3JO0xdRBmSulZLlLRZlrlBdCcZXHk MADg== X-Gm-Message-State: AO0yUKW3a6L8kmxW4LMTh0ozvMQVkZj3xTYHOxD/5g86S88L7G8Ow5hG EefRu86JHHfEjUAMj0CvZWo5sG6lL4xQqAmlVxg= X-Google-Smtp-Source: AK7set9fA4Obn0Ls7iKMQgfAW01/zSyETU7h4SPTssGdle+e56vBPiFiYQm9twtLNMrpezjqK9oBdQ== X-Received: by 2002:a62:502:0:b0:5a9:9744:5757 with SMTP id 2-20020a620502000000b005a997445757mr1870425pff.21.1676936162526; Mon, 20 Feb 2023 15:36:02 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 05/22] mbuf: replace RTE_LOGTYPE_MBUF with dynamic type Date: Mon, 20 Feb 2023 15:35:39 -0800 Message-Id: <20230220233556.168553-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Introduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 25bb17938cc1..d4389e436913 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 0b39795b4d06..941fbe51fd30 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -42,7 +42,7 @@ extern "C" { #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ + /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ diff --git a/lib/mbuf/mbuf_log.h b/lib/mbuf/mbuf_log.h new file mode 100644 index 000000000000..d759a9a25501 --- /dev/null +++ b/lib/mbuf/mbuf_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c index cfd8062f1e6a..4a379a5185d5 100644 --- a/lib/mbuf/rte_mbuf.c +++ b/lib/mbuf/rte_mbuf.c @@ -20,6 +20,10 @@ #include #include +#include "mbuf_log.h" + +RTE_LOG_REGISTER_DEFAULT(mbuf_logtype, INFO); + /* * pktmbuf pool constructor, given as a callback function to * rte_mempool_create(), or called directly if using diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c index 35839e938cc5..01654db03fc8 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -17,6 +17,8 @@ #include #include +#include "mbuf_log.h" + #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn" struct mbuf_dynfield_elt { diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c index 4c91f4ce8569..5318430126cb 100644 --- a/lib/mbuf/rte_mbuf_pool_ops.c +++ b/lib/mbuf/rte_mbuf_pool_ops.c @@ -8,6 +8,8 @@ #include #include +#include "mbuf_log.h" + int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { From patchwork Mon Feb 20 23:35:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124229 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 90D8641CF1; Tue, 21 Feb 2023 00:36:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B0D1C43135; Tue, 21 Feb 2023 00:36:11 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id BCEC043114 for ; Tue, 21 Feb 2023 00:36:04 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id a7so1567370pfx.10 for ; Mon, 20 Feb 2023 15:36:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ldJ1TGJozc5mJEWZuOvXWpF5n6V+gym2v8kL89wnvo=; b=j6+il5VfuOdANV7IBuZ5tFPkat6xY8MZkZtDU3wqFZeLggWdrY1/3aQVCIER5w2+tT vSwPcB3R8n3ab1zYVxUmHnDGg34gzGE9QoNkoV0XLCGN3HQIHvydq52kDmVv5hMg7T6G dxw9Dk0YRxQ6E5UfqxYDXnWpW1kgRq6plq2Fh1CxHFjf2N8EcRHw6MKPmWQdB1XHvphJ rdp8Z6bjz1nu4tcTLXi7Ni9C5bvwizo+JEc50xxTp8nI59pCS2E86q+LduWHpNHcJDn/ GnE3VwXT+tFTB8xFL7NpIml/0Poe9+TcynL9rC+QfqQDLO0B7uP3/FRRtf/4rodthsCw iSpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ldJ1TGJozc5mJEWZuOvXWpF5n6V+gym2v8kL89wnvo=; b=8Razo1YlJ8lkzMwZQUsL0ZwZ/lwJxJjZEzmdu5Xl7pw+BMGsWxVctcFNEf4lrJ80hu eNx1xpYn7TMBZHBjH9DPh/d3n2b2fFROL14M17KBTmw6CcftEmcE5oiUL4S9zlOo5mz0 SpGTrWem82FrD8KQ8VOxRmGoPxf5WPgY3htGyBcF3yaywgYuLeOtLMgK74wBiMvo+kZg +gRJvjEgzue58CXrzyplF8Oza++g0J7h2gXZCLuoVE9vhrG+eYRJvEGenJbZLr5Im+7j bjp9CPhnUxOS1/1/ESGlsaIWSdvUEWukVDIs19F70yPQqP9u8UBLrmVCsT1FEq+Wd+0k OaWw== X-Gm-Message-State: AO0yUKWxB1R8U+/kG+FSB4HDdXBTXpVc7xPLsnk+/YNhtBc0OUosp8cI FVDUOlDQw7bhc0oO+gwkdByNV2bmuVLPMojl7gQ= X-Google-Smtp-Source: AK7set+GGvaMJtWrlhe2UTWD/I+5OBaBOiienl7a/IqH/1QtEjux3j1x6vakrfU/fA1HK/fLgK81+Q== X-Received: by 2002:a62:6182:0:b0:5a8:ae6b:bdb0 with SMTP id v124-20020a626182000000b005a8ae6bbdb0mr2970941pfb.33.1676936163588; Mon, 20 Feb 2023 15:36:03 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 06/22] acl: replace LOGTYPE_ACL with dynamic type Date: Mon, 20 Feb 2023 15:35:40 -0800 Message-Id: <20230220233556.168553-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Get rid of RTE_LOGTYPE_ACL and RTE_LOGTYPE_MALLOC. For ACL library use a dynamic type. The one message using RTE_LOGTYPE_MALLOC should have been under the ACL logtype anyway. The test code should not have been using fixed log type so just change that to stderr. Signed-off-by: Stephen Hemminger --- app/test/test_acl.c | 3 ++- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++++ lib/acl/rte_acl.c | 4 ++++ lib/acl/tb_mem.c | 3 ++- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/acl/acl_log.h diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 623f34682e69..75588978a720 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -154,7 +154,8 @@ rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx, for (i = 0; i != num; i++) { rc = acl_ipv4vlan_check_rule(rules + i); if (rc != 0) { - RTE_LOG(ERR, ACL, "%s: rule #%u is invalid\n", + fprintf(stderr, + "%s: rule #%u is invalid\n", __func__, i + 1); return rc; } diff --git a/lib/acl/acl_bld.c b/lib/acl/acl_bld.c index 2816632803bd..f38e6478315f 100644 --- a/lib/acl/acl_bld.c +++ b/lib/acl/acl_bld.c @@ -5,6 +5,7 @@ #include #include "tb_mem.h" #include "acl.h" +#include "acl_log.h" #define ACL_POOL_ALIGN 8 #define ACL_POOL_ALLOC_MIN 0x800000 diff --git a/lib/acl/acl_gen.c b/lib/acl/acl_gen.c index e759a2ca1598..54ec485d0c58 100644 --- a/lib/acl/acl_gen.c +++ b/lib/acl/acl_gen.c @@ -4,6 +4,7 @@ #include #include "acl.h" +#include "acl_log.h" #define QRANGE_MIN ((uint8_t)INT8_MIN) diff --git a/lib/acl/acl_log.h b/lib/acl/acl_log.h new file mode 100644 index 000000000000..b55573cbe207 --- /dev/null +++ b/lib/acl/acl_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int acl_logtype; +#define RTE_LOGTYPE_ACL acl_logtype diff --git a/lib/acl/rte_acl.c b/lib/acl/rte_acl.c index a61c3ba188da..a29decb1f6ca 100644 --- a/lib/acl/rte_acl.c +++ b/lib/acl/rte_acl.c @@ -6,8 +6,12 @@ #include #include #include +#include #include "acl.h" +#include "acl_log.h" + +RTE_LOG_REGISTER_DEFAULT(acl_logtype, INFO); TAILQ_HEAD(rte_acl_list, rte_tailq_entry); diff --git a/lib/acl/tb_mem.c b/lib/acl/tb_mem.c index f14d7b4fa26e..6a9d96aaeda2 100644 --- a/lib/acl/tb_mem.c +++ b/lib/acl/tb_mem.c @@ -3,6 +3,7 @@ */ #include "tb_mem.h" +#include "acl_log.h" /* * Memory management routines for temporary memory. @@ -25,7 +26,7 @@ tb_pool(struct tb_mem_pool *pool, size_t sz) size = sz + pool->alignment - 1; block = calloc(1, size + sizeof(*pool->block)); if (block == NULL) { - RTE_LOG(ERR, MALLOC, "%s(%zu)\n failed, currently allocated " + RTE_LOG(ERR, ACL, "%s(%zu)\n failed, currently allocated " "by pool: %zu bytes\n", __func__, sz, pool->alloc); siglongjmp(pool->fail, -ENOMEM); return NULL; diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d4389e436913..9e853addb717 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,14 +349,12 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_ACL, "lib.acl"}, {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 941fbe51fd30..1408722b2c2f 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -27,7 +27,7 @@ extern "C" { /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ -#define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ + /* was RTE_LOGTYPE_MALLOC */ #define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ @@ -35,7 +35,7 @@ extern "C" { #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ -#define RTE_LOGTYPE_ACL 9 /**< Log related to ACL. */ + /* was RTE_LOGTYPE_ACL */ #define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ From patchwork Mon Feb 20 23:35:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124230 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id DA46D41CF1; Tue, 21 Feb 2023 00:36:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EBADA43139; Tue, 21 Feb 2023 00:36:12 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id B68E643120 for ; Tue, 21 Feb 2023 00:36:05 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id fb30so1307454pfb.13 for ; Mon, 20 Feb 2023 15:36:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/qg6n21gkqP1/KVHJbW9jEJA/i9qgeMJfcXqgMCDxHo=; b=a1IFUwuv8HrqMXiRPhaq+tVu4wQyfNFqT+zE01Aj2PVB2vJ20d3f4XQ1RQQ8Fg6hx+ 6YMI0cYPzRaLqsYTY5cvQDXZRJACLBNER/1VEOZY0wHhWbI2FM1nX69g/PXoCcbIGN0k tm+oNQVpRCdCZazN9bxonBoQGEIkeQjb1o9jK6C2gfEFG90LxYxKw4pa/eM5l+wmZ06W vU3TOy5FJRow4aNwFR6+BTgIX+nNsO1BDwQc1pC0RY5VBSezKy5ygnMo32HWAMuOjbxo z+2skeulKp5ppg5rZ+U0PA9SaHDnYqzHFkBCGJIGv99/XO0YzafKtfXLTR0Y/vs/7GBU hTYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/qg6n21gkqP1/KVHJbW9jEJA/i9qgeMJfcXqgMCDxHo=; b=zIgdocTte5ZNyY6r4KgtglYdZpOMJd6XcOOmYRk7v4KTepEU/xi+n5jTeDkLj7tXLf RJSlZ6ehrpWwnIVrcuvWTTqiH0aiqb0nkQhnWuu+2+AN4GdS0MIbObiaPRap7z7WXX8A Lvc8jY7EOlhizvKwhdL0VUuHHpnICKF4Fh8x/4KVe1MAtbwuOKkgzieKyfcWrCKLSjlv MzHPBYtwjj/LCnZHoShgPucZmMMKnIOpgE1aktXH3EqUnOYWjZkW4Fg0imLZAFKc6nOH qWD9TBytSfeBCPuAqSXYW7wods2bBWp/BrEv/vUotiujKfNv+eSuRsu4zjS1DOn5kGbW jGbQ== X-Gm-Message-State: AO0yUKU7RXLI5UjaDpFW8K8doRx94fedG5pH02wqA66fa5735gz3xIEZ EjCGCu4UTQjIR6T+41NGZ+JhKr99BuM7VYCRmGk= X-Google-Smtp-Source: AK7set+vInYmZbW5NvhuW2p1jwZlUKS4eFsiua7LCQ2n+UR0M8rK8czHyuxyEanrkYaaCNNXmEEbNg== X-Received: by 2002:a62:524b:0:b0:5a8:adc8:6de1 with SMTP id g72-20020a62524b000000b005a8adc86de1mr1961477pfb.29.1676936164630; Mon, 20 Feb 2023 15:36:04 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Date: Mon, 20 Feb 2023 15:35:41 -0800 Message-Id: <20230220233556.168553-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Don't use static logtype in sample application. Signed-off-by: Stephen Hemminger --- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 21304d661873..542f76cf9664 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -679,7 +679,7 @@ init_power_library(void) /* init power management library */ ret = rte_power_init(lcore_id); if (ret) { - RTE_LOG(ERR, POWER, + fprintf(stderr, "Library initialization failed on core %u\n", lcore_id); /* From patchwork Mon Feb 20 23:35:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124231 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 7DA3B41CF1; Tue, 21 Feb 2023 00:36:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C96F4313D; Tue, 21 Feb 2023 00:36:14 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id A292A43120 for ; Tue, 21 Feb 2023 00:36:06 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n5so1568385pfv.11 for ; Mon, 20 Feb 2023 15:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OxQp+8uZQnSKb+sm73eA3ffhdHXFMjPJ/H9kv1fBA+U=; b=LsL0K5wTNtx1M22335Kn/Sh3YnUxbNpIYFY+OngT2lx3vkWb23pl8ZDjjdHy6+FVKU +rZtEkqCO56/96yCr0DusNLzlHZgJ0YTNTtdX0iIDeCTxPyA7bgvXaEg0sBBzpON/Yaz 1ROrR3XGqMMurJ5/CouXTqxN0LCaLkPCrMC0a1laFyOM/QS8irSdlqMfTWJYXiP/C60J U6fBHrw2zx5GASmCUZDm3FH8xpHIR8vbswXcuqpkGGJ0sUDG2JY+Cd9D7lAEeNbNJ0UG oEnadYFsiF8pcjnzZpWWIwbEr7o+hpaqk6SXnNmr9QXGTN2LMncyWbwQBjFL1V7hGA48 pdHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OxQp+8uZQnSKb+sm73eA3ffhdHXFMjPJ/H9kv1fBA+U=; b=v5DSmq64bQQ2oXc7ndIR9/v5TEj5z33VjSDpoj5vc5P07EmFOuh0G8/iq+pzITRlB+ NnegmMv4UhmyJdfGFTAawmvxuGxIsnSFN3w8hYXBP9fwjGeph7a2CIRMRYdZPms5yWUw QUnajQxAs6lKiTTbNgCyBJ+zXsMpjetotTxTXNRJusevwrbTXKD4fgHFUM79BFa0mkGg /7ORB/8AmzgXlDDUVYj+9h63PPv+Uo3RkmyQsM/WVHsCEVmctqv2j+i7vX3WKY/N+4sz DQsT5WR2Cj7QoNL8E59T/NKWsR6cB1kKtGnm78LQpeR+jLdT4suiblh+TaTJaiOYtB/d XpFQ== X-Gm-Message-State: AO0yUKVHFOOPsSSEM9MbfQJMUY61DNIE25vtk6AhFEvg+fUc46h5Moy4 NoEjpHy9/WQJTm/5MJs78sjrWyr0bLgoLeikbpo= X-Google-Smtp-Source: AK7set/doi7rHmQGd1WcGI7L4zynXWn8YVreAJGDNirLKYUDJiekKzJOt++XtEr9NfwrCg4DvurfPQ== X-Received: by 2002:aa7:96ee:0:b0:591:3d20:3827 with SMTP id i14-20020aa796ee000000b005913d203827mr1995647pfq.21.1676936165547; Mon, 20 Feb 2023 15:36:05 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:04 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 08/22] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER Date: Mon, 20 Feb 2023 15:35:42 -0800 Message-Id: <20230220233556.168553-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Convert to using a dynamic logtype for the application. Signed-off-by: Stephen Hemminger --- examples/l3fwd-power/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index f57c54d2b57c..76b890b76c88 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -51,7 +51,8 @@ #include "perf_core.h" #include "main.h" -#define RTE_LOGTYPE_L3FWD_POWER RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER(l3fwd_power_logtype, l3fwd.power, INFO); +#define RTE_LOGTYPE_L3FWD_POWER l3fwd_power_logtype #define MAX_PKT_BURST 32 @@ -2236,7 +2237,7 @@ init_power_library(void) /* init power management library */ ret = rte_power_init(lcore_id); if (ret) { - RTE_LOG(ERR, POWER, + RTE_LOG(ERR, L3FWD_POWER, "Library initialization failed on core %u\n", lcore_id); return ret; @@ -2245,7 +2246,7 @@ init_power_library(void) env = rte_power_get_env(); if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ) { - RTE_LOG(ERR, POWER, + RTE_LOG(ERR, L3FWD_POWER, "Only ACPI and PSTATE mode are supported\n"); return -1; } @@ -2263,7 +2264,7 @@ deinit_power_library(void) /* deinit power management library */ ret = rte_power_exit(lcore_id); if (ret) { - RTE_LOG(ERR, POWER, + RTE_LOG(ERR, L3FWD_POWER, "Library deinitialization failed on core %u\n", lcore_id); return ret; @@ -2332,7 +2333,7 @@ update_telemetry(__rte_unused struct rte_timer *tim, ret = rte_metrics_update_values(RTE_METRICS_GLOBAL, telstats_index, values, RTE_DIM(values)); if (ret < 0) - RTE_LOG(WARNING, POWER, "failed to update metrics\n"); + RTE_LOG(WARNING, L3FWD_POWER, "failed to update metrics\n"); } static int @@ -2381,7 +2382,7 @@ launch_timer(unsigned int lcore_id) rte_get_main_lcore()); } - RTE_LOG(INFO, POWER, "Bring up the Timer\n"); + RTE_LOG(INFO, L3FWD_POWER, "Bring up the Timer\n"); telemetry_setup_timer(); @@ -2397,7 +2398,7 @@ launch_timer(unsigned int lcore_id) } } - RTE_LOG(INFO, POWER, "Timer_subsystem is done\n"); + RTE_LOG(INFO, L3FWD_POWER, "Timer_subsystem is done\n"); return 0; } From patchwork Mon Feb 20 23:35:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124232 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id D36FC41CF1; Tue, 21 Feb 2023 00:36:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67E2143146; Tue, 21 Feb 2023 00:36:23 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 7BA8F43125 for ; Tue, 21 Feb 2023 00:36:07 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id h14so3288186plf.10 for ; Mon, 20 Feb 2023 15:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tR/s2Bip+52O5Mp5OTr+kHcnPVHdQJOMY2LxxyPH5rI=; b=UVQqRFfoZnPHOkU0rdUBj3u2x1r5xPu/SVOv3DFH2QNyrDvWxlPnlmwc1WXrcJye0h YVh07TUU+tVSqGpo4Ktyik0r0pWO6VT2WxIvJxKc1xqLAU1FNJpco3Y2UXnFylseUcBy 1IZ426eX1ijc9i8mXtlrTIZUwpyyOH9wLVIFkpeF09IAttqnxqFLvBZGHNY4GINYghcN G8sWnZwTPYeSuXLlgNJle2xiHXYx5+ogtnznKT03vmtxvksLrOOOrh6ysQuFxosRxqiO Mdt+Rk6Ku+bJ9oRU/D2ftXKPcHrUmHT4l2nLEWL7ZmvyctMLc3ZDV3Rar6TVT1H7MrZl AK8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tR/s2Bip+52O5Mp5OTr+kHcnPVHdQJOMY2LxxyPH5rI=; b=ZOmz5ar8Iug+gchPRZFUVui/W8Oq5mYb3jUwucqde/b+U6vq/G+E3YeD8dv1HROxU2 eNVx/sFHFku2VBLKKYq+V5EXs9DzEFxIIa3zE1HzFxxiAHFE+TgydfRFo2QexXb9uGx8 YfcbwdBte7YotBJJAmGeS+ar43kPDTrmUEsUPoireSqAQ4DsYl4achBT7pVTsSFwu3wd xNTYRZ4GR/O1oGkohjGitacUPfwpjdQkBj5U6SlIeHP6x0u3pAYXg6pKsW03zVWLv3Vl HQR9H65G+ChcrvuVDSgSJybgn7AH+xbYofD7CvMxc89QP7ytPkgJXINkO0MUSOB3h8Zm u6nQ== X-Gm-Message-State: AO0yUKWOgoA4GxEzjEz5OW1TMSI34zjZWXnB+BA4apusGl1+WQv6NetT krS2qdwxl0y+z1Y2r7LO1bO2ahvPx15Bw5rpdWo= X-Google-Smtp-Source: AK7set9D0nBE5noXUCLEXVe0x3PFqPttaMrOQFEUQBZ3mriIv8PflXunfUwNXY0BUU7ieLPyfIFgwg== X-Received: by 2002:a05:6a21:789c:b0:c7:13df:e530 with SMTP id bf28-20020a056a21789c00b000c713dfe530mr3103587pzc.6.1676936166422; Mon, 20 Feb 2023 15:36:06 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:05 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Date: Mon, 20 Feb 2023 15:35:43 -0800 Message-Id: <20230220233556.168553-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use dynamic log type for power library. Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 9e853addb717..39e1e6680dea 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 1408722b2c2f..7d4345acceca 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -36,7 +36,7 @@ extern "C" { #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ + /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index 969a9e5aaa06..efc326d520ca 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -17,7 +17,8 @@ #include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX(guest_channel_logtype, guest, INFO); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype /* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10 diff --git a/lib/power/power_common.c b/lib/power/power_common.c index 1e09facb863f..bf77eafa886b 100644 --- a/lib/power/power_common.c +++ b/lib/power/power_common.c @@ -12,6 +12,8 @@ #include "power_common.h" +RTE_LOG_REGISTER_DEFAULT(power_logtype, INFO); + #define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver" #define POWER_SYSFILE_GOVERNOR \ diff --git a/lib/power/power_common.h b/lib/power/power_common.h index c1c713927621..63a3a443509e 100644 --- a/lib/power/power_common.h +++ b/lib/power/power_common.h @@ -5,11 +5,12 @@ #ifndef _POWER_COMMON_H_ #define _POWER_COMMON_H_ - #include #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype #ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \ diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c index 6a8109d44959..db031f43105a 100644 --- a/lib/power/power_kvm_vm.c +++ b/lib/power/power_kvm_vm.c @@ -8,6 +8,7 @@ #include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c index 63a43bd8f5ae..db0e7705a9ef 100644 --- a/lib/power/rte_power.c +++ b/lib/power/rte_power.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h" From patchwork Mon Feb 20 23:35:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124233 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 0E82941CF1; Tue, 21 Feb 2023 00:37:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 973A74314B; Tue, 21 Feb 2023 00:36:24 +0100 (CET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 63DA043129 for ; Tue, 21 Feb 2023 00:36:08 +0100 (CET) Received: by mail-pf1-f178.google.com with SMTP id f11so1443812pfe.2 for ; Mon, 20 Feb 2023 15:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W35+k0/nxGmPH0dP92jKXi26qn3G0Y4hBcnCM7qeAAg=; b=aSvfTZBh6Oy1loMaPJBjzx9EYcwxHnj58u5kUcnWqVokEGK2HsE/x3Yqy2uofc4/KF YKzaPA9IM72NCv6WJb4kCXJuBgziV7IH5Erj5Gz5Km1H8NsVfoekyhYCyu/Q4FNx0IUl o+dnV9LL1Sf9C0I78/bcjKsjz16AIaqkgOWBbFBSfjrKotR9j7Ey7TryAWPaPtdDEFQ+ z2UqTcJ7Pv3tCvUzM+sVZrEODUZL8+MQChGJpwQ0yOzVcB6dbAI4tRVJiaj/qZFNE/Ct s5yixKJLyyn6BH7WW8Li2yAj2NCEBhFcrZcw5qqHnalS9x41Ey86MD6cYMXEhy1xWGvD veSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W35+k0/nxGmPH0dP92jKXi26qn3G0Y4hBcnCM7qeAAg=; b=WdLjnzVM0ghhoy8vVuNGHypoaCN7goitbDPXbYwxbwhTruTjJgjnV4jPnNUwyVfNOg 6Ia5TlZ+yAFA9oBCOC7BRSftzP0t0icG3vA+swy3SX2c9bBCCFzlvnFVf2QCWe60equf GiFJJc8UdbKc8CuDzDf6HlqTXmouYYY5ydbOOVp+yCXoi7ikPxoK3PI/bZCidKDZK8yt 36vzEg53/elol6qjLlAE8g8J3snhZTXRE98v01V4UjYnbfz6rEKo3QV9HWG67xeNTSBv 6v98TyGTPipNpU3OKG5i4LOXBlmg8mzU0ePuLD/GcGLycsISGrp/XjaBFrDTUBnle8OZ gOkw== X-Gm-Message-State: AO0yUKUxYlLVA4AvqcykSlZVFoLJpo3ZxDqTANvyOTj+0rOEqww5ZFhh W1emV1on6zlKBni5MhqkJRC+1M97IMCfuc42Dvg= X-Google-Smtp-Source: AK7set+j8fcRGk5+QxTlrrW0iiMa5gh2nrCSDHXZzrb5SS0093lFWSDl9m/MBjOxN3s2y4r0oP7rqQ== X-Received: by 2002:a62:184f:0:b0:5a8:b705:4dd3 with SMTP id 76-20020a62184f000000b005a8b7054dd3mr4363779pfy.13.1676936167225; Mon, 20 Feb 2023 15:36:07 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:06 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 10/22] ring: replace RTE_LOGTYPE_RING with dynamic type Date: Mon, 20 Feb 2023 15:35:44 -0800 Message-Id: <20230220233556.168553-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The logtype for ring only used in library. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 39e1e6680dea..5f15e312f15b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,7 +349,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7d4345acceca..31a2ee2f6b6f 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -28,7 +28,7 @@ extern "C" { /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ -#define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ + /* was RTE_LOGTYPE_RING */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c index cddaf6b2876f..8c5f2575d6ef 100644 --- a/lib/ring/rte_ring.c +++ b/lib/ring/rte_ring.c @@ -26,6 +26,9 @@ #include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT(ring_logtype, INFO); +#define RTE_LOGTYPE_RING ring_logtype + TAILQ_HEAD(rte_ring_list, rte_tailq_entry); static struct rte_tailq_elem rte_ring_tailq = { From patchwork Mon Feb 20 23:35:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124234 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 8E8D541CF1; Tue, 21 Feb 2023 00:37:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AD18B43150; Tue, 21 Feb 2023 00:36:25 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 04FA24312B for ; Tue, 21 Feb 2023 00:36:09 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n20so1396549pfu.12 for ; Mon, 20 Feb 2023 15:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UMIvo3eH3gIf7bmSK7HiVVxlasm2kXrm7AwYySPnJ8E=; b=zmfGoKHvyZ/LrfCWuy7u8YvmYLMomfT2+wYYCL6MaHgOEpsarPXd1hdIT5W1xOphnr JMoc/k9ynuZMIl5H/s0F0jzu8VHtT8OKaG+HFd9dsIiTi6YaZFMRrWYuiO2TlHzBU/eR xxSrhSWKk9emqv7UpWcZpAnn1PGOhwDvKzYgqfUUxk5bxWL8q+5iGj8HdX15pPFUj91/ jZcRcB2K/PjHYajo/mil3zC2EqEeBlPKN/7Q1+nn0HIEHl26p5ByTHg3QrwFw1ByP7mu ICdNyEK/YR4LRZ/XUjMHAmSB9bvf2OZ8NRBtJgNVbFzPqvp3zhwe572lQgDG3XadzPlQ 6b5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UMIvo3eH3gIf7bmSK7HiVVxlasm2kXrm7AwYySPnJ8E=; b=fCpRURnrN44nTXE6Szr4Z8EbTDoGRgSvZ3RtxrDUyR5DkGYgwmagNjhD4gpbYDc+E9 7t8lUct+92GUEL8wFgvv8PXw3chntFaUTylmdwizt8U4wUFI2zovANv6MFGUj7pOJ2bF CnJNhTfJi9/vYRgcGJyueytWdpW3CXC4xqIA1OrxXzEYSKLSwLgdXF48m7R+jbZZjYZ8 jJVUfVGvJ3WBKo9J8HXAxInsHAzmivTPW8yUwXpxn/lTmP919Ine2x9+E6sZUruSlpIJ jnpVjkNlDykWusXATwo01bFITFD3fbK/9X6OSkYWrb8j0dlN88meKRbdnaqtPaTw7v6X iNcg== X-Gm-Message-State: AO0yUKWxpVz2fEOYOxLdbdwFreSalXWjIHX+1VPqxGghYt4kIOLfiLcA 2dD1fUxl4Aods39Tlusip88+936oICAQVgggMqg= X-Google-Smtp-Source: AK7set+pxauaDKIt7mVVCGZR2kJsTzsES0oFcoXbGWDroWrFay/4x9cC+2GlIPzaVb7yIQntpCHJdA== X-Received: by 2002:a05:6a00:51:b0:5ad:9f47:8ae1 with SMTP id i17-20020a056a00005100b005ad9f478ae1mr2599807pfk.3.1676936168236; Mon, 20 Feb 2023 15:36:08 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:07 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Mon, 20 Feb 2023 15:35:45 -0800 Message-Id: <20230220233556.168553-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Convert from RTE_LOGTYPE_MEMPOOL to logtype_mempool. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mempool/rte_mempool.c | 2 ++ lib/mempool/rte_mempool.h | 8 ++++++++ lib/mempool/version.map | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 5f15e312f15b..4025d2039d55 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,7 +349,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 31a2ee2f6b6f..9f86bfdd0198 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -29,7 +29,7 @@ extern "C" { #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ /* was RTE_LOGTYPE_RING */ -#define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ + /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index cf5dea2304a7..b609a94fdf9d 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -31,6 +31,8 @@ #include "mempool_trace.h" #include "rte_mempool.h" +RTE_LOG_REGISTER_DEFAULT(rte_mempool_logtype, INFO); + TAILQ_HEAD(rte_mempool_list, rte_tailq_entry); static struct rte_tailq_elem rte_mempool_tailq = { diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h index 9f530db24ba1..db01acc19b02 100644 --- a/lib/mempool/rte_mempool.h +++ b/lib/mempool/rte_mempool.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -175,6 +176,13 @@ struct rte_mempool_objtlr { #endif + +/** + * @internal Logtype used for mempool related messages. + */ +extern int rte_mempool_logtype; +#define RTE_LOGTYPE_MEMPOOL rte_mempool_logtype + /** * A list of memory where objects are stored */ diff --git a/lib/mempool/version.map b/lib/mempool/version.map index dff2d1cb5555..eb2c12127560 100644 --- a/lib/mempool/version.map +++ b/lib/mempool/version.map @@ -57,4 +57,7 @@ INTERNAL { # added in 21.11 rte_mempool_event_callback_register; rte_mempool_event_callback_unregister; + + # added in 23.07 + rte_mempool_logtype; }; From patchwork Mon Feb 20 23:35:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124235 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id C110641CF1; Tue, 21 Feb 2023 00:37:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D28CD43154; Tue, 21 Feb 2023 00:36:26 +0100 (CET) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id 3DC2643130 for ; Tue, 21 Feb 2023 00:36:10 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id k29so1796470pgm.3 for ; Mon, 20 Feb 2023 15:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bxb5uefAC8sqO7rt+ILDAJRxu/qHVtoXVH3T56wvEmo=; b=DkcWRuLhIsO4fP8sjxymufYWwOFvFS1ve/RZaUZh6zrR7cargWIjYoEn7N5Vwu0Jj8 kxmWmfZD0IeS4Uc0kaOOR58AuJHYl7T8vSYUMwaOJ1w0mDzeokViDmRKhnW3PHirO4s3 9XSd0WofWWkL8aHuHkSy9qrDHR2AMvZR1YxYObeYg/C9AjZoC+9sxUS6ebDAdt/wXL1E MFuZWBbVcPJQtgUJBUvhSmT70h6bxcStLFIvD/SE9ejUYUJp4YTHqjwqnvGWCkabAlPb VClB6avJ/k2Xyy9wpDgSiuNcdmVGTr+zMphxEOhcag1BKKRbt89d0CTcKqUFF5d8Rxp6 Ox1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bxb5uefAC8sqO7rt+ILDAJRxu/qHVtoXVH3T56wvEmo=; b=S/Zh2KgIMOhUMdihY0g5sE/y4ew2r740FY0AV2AcFE0/STIvYdZd3Qd3pA4osuiajq 07DtKN2IrcmoIYJ0nXB8v2tGxg1rcoIpHdLznGjkBsWM4zOfiVWm/LEmH17bDkl34jvS uZ2OJNpOlMhU9X5DAUcdzWwZH7dDClP71SPHfsiPF9zvcenPIXEJ8w4+WLwe1z9zddLd e/V6ceDOZlDfYbeOmnYgvf5lAAyFhuCyma9gTBTSzUWuErGHWhTU2B8OqXg2yTPkHQGh NdfZPkNAIpwLG+/SU5kqNY3eWdaoUTCwHCbFGjwfpuVn/vvyeO6fxH/OeYOraOFpz9BW KVkQ== X-Gm-Message-State: AO0yUKVKSiV5nr809/P4Xcrn2YbXpY2RVBHGb54VGWOfwyuAfnLV5x4o zgNmoO++UMQhKUAWN0WNYRYhDVO9HPB6cG01b+o= X-Google-Smtp-Source: AK7set9vy95L9bFz8omh5pjQB1xqSV7dTboJa2ctS+l/iHShhyImxW9NW3T/SYEWD9mzvI9QKdMfCQ== X-Received: by 2002:aa7:96ee:0:b0:5aa:9ef7:4f7f with SMTP id i14-20020aa796ee000000b005aa9ef74f7fmr1989437pfq.9.1676936169096; Mon, 20 Feb 2023 15:36:09 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 12/22] lpm: replace RTE_LOGTYPE_LPM with dynamic types Date: Mon, 20 Feb 2023 15:35:46 -0800 Message-Id: <20230220233556.168553-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6. For rib and fib libraries give them own types as well. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 4025d2039d55..6e2007e6ed4f 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 9f86bfdd0198..115a48bf05f5 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -33,7 +33,7 @@ extern "C" { /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ -#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ + /* was RTE_LOGTYPE_LPM */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ diff --git a/lib/fib/fib_log.h b/lib/fib/fib_log.h new file mode 100644 index 000000000000..c731c820f621 --- /dev/null +++ b/lib/fib/fib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c index 8af4c4091908..5b1815881415 100644 --- a/lib/fib/rte_fib.c +++ b/lib/fib/rte_fib.c @@ -16,6 +16,9 @@ #include #include "dir24_8.h" +#include "fib_log.h" + +RTE_LOG_REGISTER_DEFAULT(fib_logtype, INFO); TAILQ_HEAD(rte_fib_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib_tailq = { diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c index 4b8e22b142b9..762d195fb798 100644 --- a/lib/fib/rte_fib6.c +++ b/lib/fib/rte_fib6.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -16,6 +17,7 @@ #include #include "trie.h" +#include "fib_log.h" TAILQ_HEAD(rte_fib6_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib6_tailq = { diff --git a/lib/lpm/lpm_log.h b/lib/lpm/lpm_log.h new file mode 100644 index 000000000000..a0621b70a5fe --- /dev/null +++ b/lib/lpm/lpm_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int lpm_logtype; +#define RTE_LOGTYPE_LPM lpm_logtype diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c index cdcd1b7f9e47..0ca82147866a 100644 --- a/lib/lpm/rte_lpm.c +++ b/lib/lpm/rte_lpm.c @@ -18,6 +18,9 @@ #include #include "rte_lpm.h" +#include "lpm_log.h" + +RTE_LOG_REGISTER_DEFAULT(lpm_logtype, INFO); TAILQ_HEAD(rte_lpm_list, rte_tailq_entry); diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 8d21aeddb83c..873cc8bc267d 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -20,6 +20,7 @@ #include #include "rte_lpm6.h" +#include "lpm_log.h" #define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24) #define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256 diff --git a/lib/rib/rib_log.h b/lib/rib/rib_log.h new file mode 100644 index 000000000000..f3ee513ca854 --- /dev/null +++ b/lib/rib/rib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int rib_logtype; +#define RTE_LOGTYPE_LPM rib_logtype diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index b0794edf66f5..5597c8b899c8 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -15,6 +15,9 @@ #include +RTE_LOG_REGISTER_DEFAULT(rib_logtype, INFO); +#define RTE_LOGTYPE_LPM rib_logtype + TAILQ_HEAD(rte_rib_list, rte_tailq_entry); static struct rte_tailq_elem rte_rib_tailq = { .name = "RTE_RIB", diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index 19e4ff97c479..917bede27d24 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,6 +16,8 @@ #include +#include "rib_log.h" + #define RTE_RIB_VALID_NODE 1 #define RIB6_MAXDEPTH 128 /* Maximum length of a RIB6 name. */ From patchwork Mon Feb 20 23:35:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124236 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 08A2541CF1; Tue, 21 Feb 2023 00:37:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5D21543160; Tue, 21 Feb 2023 00:36:28 +0100 (CET) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 4417343133 for ; Tue, 21 Feb 2023 00:36:11 +0100 (CET) Received: by mail-pl1-f175.google.com with SMTP id p1so1105561plg.7 for ; Mon, 20 Feb 2023 15:36:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M8pRnn6UCXMDXQ5HMMtTZAPC9+D5OPOOwBhGsqw2t6A=; b=JuoAJen+HBY+B3CNNVSpIDVDiNwcF1JPfXt+e9tTlpqY/Rc0ynrr6/JIMYxa3Sm5co SWoz2tps2cAPk8aozDTEqQ6nwE5vBXa/vsS8R/bFAbob/4+1TO1N1qJPXNLBwVsvskfo 7EKWGDMyjzLkM0crf+XEt4a2C9HxtJViLqNE8wO8r2lOGgf1O8XdGe0GOL4soHTlhm2B gYJfWvqCDg2Kpu1mRO/jKZLZFZN27v/qAev88FREjgqxfj/IqtkKLuZgGryOHe4ZwxHR DG0Y8HWwZRpQzELOkDRu5rILY3NMc0wK1q2Afhh4NgEUloxriH6bsOGH29AwPhNTZ3nJ mrVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M8pRnn6UCXMDXQ5HMMtTZAPC9+D5OPOOwBhGsqw2t6A=; b=sX/RwIjSt4BRbMaMav9TeXzq8zrDP8sww+K20jQUtnyGGGDvHj+jgBJtrNMYLdx6ju NEN8+srlQDFhzFWNnq24vMJLRrQclZ0JOMFvlVUzotYjxfc6oZYJrQpxEPyZFgVIrIoz hAPbLcoMILHxJPR/aCrqZPmTB5fqPVQq+QBb2W4ur3lBEBntKgSqK288Z/zSUUfbDHUC yMbGzd2Dd4UPCL6BOWrQgowB+vXGvklUVlPvIY/Tjs+FsW4ri0m9EELUf4W+13p9fwD1 gEFSDjfhzhpwx5DBi2th2CzDWMRzdsy0kdxFZ+qT5eP8WTOcidGwn4BIa/jTxQtG/Cc+ +CaQ== X-Gm-Message-State: AO0yUKWker5uVRNbEAL/85fn2hMv7qzCZX9el5Q7yC5/x4Qj6mFqJIX9 Xcg5GxMqXP//1bMHFbJQU4mSBmOnxLbxXgqXAHg= X-Google-Smtp-Source: AK7set9s/UI1cYY8Lv1b3xM4pw2gmouCHKauzW+NEWV8Ncg+Grq89cz0o/jeDXH80LllnYEEqJvbYA== X-Received: by 2002:a05:6a20:699a:b0:bd:b061:9527 with SMTP id t26-20020a056a20699a00b000bdb0619527mr2161676pzk.4.1676936170159; Mon, 20 Feb 2023 15:36:10 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 13/22] kni: replace RTE_LOGTYPE_KNI with dynamic type Date: Mon, 20 Feb 2023 15:35:47 -0800 Message-Id: <20230220233556.168553-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Even though KNI will eventually disappear, fix the logtype now. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/kni/rte_kni.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 6e2007e6ed4f..70d5bb7b1951 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 115a48bf05f5..dc2454a0d9de 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -34,7 +34,7 @@ extern "C" { #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ /* was RTE_LOGTYPE_LPM */ -#define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ + /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c index 8ab6c4715314..9c37bcabcadd 100644 --- a/lib/kni/rte_kni.c +++ b/lib/kni/rte_kni.c @@ -23,6 +23,9 @@ #include #include "rte_kni_fifo.h" +RTE_LOG_REGISTER_DEFAULT(kni_logtype, INFO); +#define RTE_LOGTYPE_KNI kni_logtype + #define MAX_MBUF_BURST_NUM 32 /* Maximum number of ring entries */ From patchwork Mon Feb 20 23:35:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124237 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 7190041CF1; Tue, 21 Feb 2023 00:37:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A01443166; Tue, 21 Feb 2023 00:36:29 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 2693C43137 for ; Tue, 21 Feb 2023 00:36:12 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id e5so4191315plg.8 for ; Mon, 20 Feb 2023 15:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=h8xeCiYAn70XfFwWvsKqKNUeO1NKeHChTpCpY1GleV4=; b=N5ywaz2yV+ySClKjdcjIWUWJkb/yoDbTxdLpVKHcxt4mxN+KmkugVGEk5kuASwWw3N uLbrjiy5XCZsu53iXPMwsFOeidb72dOj0qlZTPPes+7HfkxDU5Dy4bn1TeSAZxav9X4+ S/8u/cMiw1HpJzXhrvkravmyFDgt+l+L23gNPNZv70w6PoNwlqwjWhRQXea+eE6Zx99O aQtUNx0m/W4hTlZiYHPYcTFCYwOTa3ARCO9wWggxD6QTssVC8UtTzw50qYw7r5Qt8kh2 /tv/lDgZ3lN5aoR6gHgf6pbzT2gFpiG2HcmFEWOdwHisnTcWBCeZCEijR8yizEMg4zVd bLfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=h8xeCiYAn70XfFwWvsKqKNUeO1NKeHChTpCpY1GleV4=; b=pv79EHukiR0V7bXJqD664Ig9tzP3HV+Qb5fQzvIkI69IiWbQIGKvEG20CTGHvb0kJ5 wPS93lsM4kw9unHAwfpCZlnanRLMJoOcanLJw0t8+5/Zvh0q6TOhXYHMrhBEPaQdxpl/ SaNkBMy/Pg53/a1s4PJGfCLndSi/zZxVbQHB8GZL71get8qjR9z5x1WPMHqUlHUADhSx ZFBIAMsovoD0kqMVUynQQJng8SbIsMp2N7Lhc73Gee1wg5QxYQSTi23pn8OU6AFvfA2U pjTapikSUGdKkzd9bJorkhUOhRONHZI2gzu2XNvbRrDkKQtPVUP9+1Zk56Mf4AbTUtem oITg== X-Gm-Message-State: AO0yUKVfOw4vEvf618L+haLMoSduyuw2TJpC+iJia6AZqAO1I5HKliyq ATtupZ45wx4ooDRwtp35jNrI7DbcpeP6qkzZeCw= X-Google-Smtp-Source: AK7set+JWpVnZT4BwrwDiiYMdIul9zl7KmTWGaMEyW4qO4iPQn7Cjq1oRPztZAwcDkQbsNdNGZAfiw== X-Received: by 2002:a05:6a20:4426:b0:bf:c0e8:fbc5 with SMTP id ce38-20020a056a20442600b000bfc0e8fbc5mr2977701pzb.54.1676936171045; Mon, 20 Feb 2023 15:36:11 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 14/22] sched: replace RTE_LOGTYPE_SCHED with dynamic type Date: Mon, 20 Feb 2023 15:35:48 -0800 Message-Id: <20230220233556.168553-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Also can remove unused RTE_LOGTYPE_METER Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++++ lib/sched/rte_sched_log.h | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/sched/rte_sched_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 70d5bb7b1951..d4b7088b5cbb 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,8 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_METER, "lib.meter"}, - {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index dc2454a0d9de..f185fcbc5a94 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -37,8 +37,8 @@ extern "C" { /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ -#define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ -#define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ + /* was RTE_LOGTYPE_METER */ + /* was RTE_LOGTYPE_SCHED */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c index 947e2a059f6f..cce0ce762da8 100644 --- a/lib/sched/rte_pie.c +++ b/lib/sched/rte_pie.c @@ -6,6 +6,7 @@ #include #include +#include "rte_sched_log.h" #include "rte_pie.h" #ifdef __INTEL_COMPILER diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c index 19768d8c38b0..27e98e46df7a 100644 --- a/lib/sched/rte_sched.c +++ b/lib/sched/rte_sched.c @@ -16,9 +16,12 @@ #include #include "rte_sched.h" +#include "rte_sched_log.h" #include "rte_sched_common.h" + #include "rte_approx.h" + #ifdef __INTEL_COMPILER #pragma warning(disable:2259) /* conversion may lose significant bits */ #endif @@ -3002,3 +3005,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint return count; } + +RTE_LOG_REGISTER_DEFAULT(sched_logtype, INFO); diff --git a/lib/sched/rte_sched_log.h b/lib/sched/rte_sched_log.h new file mode 100644 index 000000000000..fde051f49d62 --- /dev/null +++ b/lib/sched/rte_sched_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype From patchwork Mon Feb 20 23:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124238 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 4DD9D41CF1; Tue, 21 Feb 2023 00:37:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BDE4643168; Tue, 21 Feb 2023 00:36:30 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 0AA854313B for ; Tue, 21 Feb 2023 00:36:13 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id ky4so4318776plb.3 for ; Mon, 20 Feb 2023 15:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kFRl8j+YQC8GSnvt8uJaAlHH4NW76fDU6O3JskDGXTA=; b=S/6uw6oqh3NnUi3seyVbtuGj4y8jW5eOrC7vlXjrJs/fvWOk8DUHIhJs8eM4k050ip 570BiYQAPqMbrnRkj3Ru8dSLUBeUeA+jt4P7X54C2DEmbNLYxl8nVDabeq4wIq9itvFZ DiLLyDbF2edY7CuZAkoEC2vCHwv9ipbScCTvad0/r7ESQYZaNiHwBOXdnMp5UUjkYJWJ kv2mgobWBP3HM3WQEm9Lye8cyekPHa8G8VrMVmx6wm/bnLcAVeS0NYyqyBgMtWVGx0Ld KYWyMk/8c7EOSzig4QwHygpELK0tUmVHo5TD1tOKHdlJTt0ppKHIwF8oTleEu/vQt5LT qsEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kFRl8j+YQC8GSnvt8uJaAlHH4NW76fDU6O3JskDGXTA=; b=wN2jSob6JO93sU6R+7YzxIA9O97zqgPcFVdxsxhYTJQN5NtRnujht2pmiVNEU45h3K p8LEMFqPSi6lK21367c53v20d57f+63+F8X7VE8A3xusUDpeOw6snHliCDVWlWC5xP/Z EtzVn33oER/CgL24gGPZkdT9HYZOaNR5bt6vAP9wnkSFsrmEp7q85mhFn69UZTjLbGW7 v8CBh9IBn5zpZPvJOwEyYoWNnanphE2tdQLFduud42HBofiDlZaQ7V4RzDH9Rko4S9T2 Nz0/PcEly0fIOp4VDEESJSOSq0Xy/g1mj7xppgA08lvmsKl9wnkHCUHvR8Vi1MDeoDb5 j40w== X-Gm-Message-State: AO0yUKXYK0Rdu4aooC4AXtMm+NnkTPiYEONE1d3piE+011QsaHbPxYGt u89UcfUdbe5m7RxhTr9Ro6cK3oG7dor/HMb5P4E= X-Google-Smtp-Source: AK7set9w6ZC3YGzPRiZMPe5QQHW/QLtCHoI5DNKTg+jrATL8uRyf1GR3gUNCyGrhpokI6nxq1D3+lg== X-Received: by 2002:a05:6a20:12c8:b0:c7:850c:23f1 with SMTP id v8-20020a056a2012c800b000c7850c23f1mr15761836pzg.23.1676936171948; Mon, 20 Feb 2023 15:36:11 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:11 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , akhil.goyal@nxp.com Subject: [PATCH v8 15/22] examples/ipsecgw: replace RTE_LOGTYPE_PORT Date: Mon, 20 Feb 2023 15:35:49 -0800 Message-Id: <20230220233556.168553-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Looks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using RTE_LOGTYPE_PORT here. Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload") Cc: akhil.goyal@nxp.com Signed-off-by: Stephen Hemminger --- examples/ipsec-secgw/sa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 7da9444a7b8a..67327fda8dbc 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1127,7 +1127,7 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) if (inbound) { if ((dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware RX IPSec offload is not supported\n"); return -EINVAL; } @@ -1135,13 +1135,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) } else { /* outbound */ if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TX IPSec offload is not supported\n"); return -EINVAL; } if (tso && (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TCP TSO offload is not supported\n"); return -EINVAL; } From patchwork Mon Feb 20 23:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124239 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 98B3641CF1; Tue, 21 Feb 2023 00:37:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA2254316A; Tue, 21 Feb 2023 00:36:31 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 8E40B4313B for ; Tue, 21 Feb 2023 00:36:13 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id x24so1478833pfn.7 for ; Mon, 20 Feb 2023 15:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XyBK7Y4Qa7SsWybX079Rpa71uKduJ/PSYw3ilBvphh0=; b=H8LUagqawTuv042RYGn1LQU7nex2yhxOvow4eDhQkKYNoeewsMO63hnkrI7Sb82l2y QXeeu3qKgvpS2lfe3JUgEDdKKgygPI1/61TbVu+vtwqhVRSoaV0IQTSqv5A30vPkRhyl rE5UaHBB9vZoHy2vZfDne2JwRneCqnfEculf3UiZDQmEZwI+DYdS8gldH6aQbpZq3Z0N 5/1G53hrIxGw5gFFeC/a3AWdTf7WuGLQLs60QYdUBbCBz4igrmuZ053lOGgh1jWLFMoY ApAscyKxnyUwCM8WppQ42/iacUI9jI322rtxGlYwJi0nZg8QWM73NJAOO0J3hmdOUDIR fMCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XyBK7Y4Qa7SsWybX079Rpa71uKduJ/PSYw3ilBvphh0=; b=HTFljLdca3HkOoDX2nuLPI6h30218FPYORDxis2xHpNBdx+pW4ACa5BOVeBqD63bKe ndxs7XGKgFrGgiWFQK0LRltqhLVF/PvS4VjMIeFLu0rU9M4KpR8nWWjy3F5ESqNnf/xG omx0eD1tZPlGDSUctVUceUgXBasuVSkUUPFf/zXDk/csSPPtBtDpLIN+oMcjF5CO7YPm 9q+qonoHrFqkVx8F1XQaot8KuXUZeJMT+JBnR3YBvE737x0jQm554pfzJeBFizWzzV+C zh0DMHAn/rZIEjpXDwzpGBMEYJxQCsyrAQqeXXThyq47q4UG6M0KfHTVW7VwUUYFPJaj A26A== X-Gm-Message-State: AO0yUKWUQG5SuBQ1gQHKK16gMbz43tMhswPr2hPQfoDHROZ87p0DTxiz zr6Zwb0NsTeIm/nyN8HijDe2mAg8YP3anXdbVtU= X-Google-Smtp-Source: AK7set+eRs6C9fTKcruK8zBdzeFqO0e7nO6t4PkE7+0mmSONd+P7lIOn5gdURNWNCc6Fo16seJ95sw== X-Received: by 2002:a62:1bd6:0:b0:5a9:cebc:90ee with SMTP id b205-20020a621bd6000000b005a9cebc90eemr3218700pfb.15.1676936172768; Mon, 20 Feb 2023 15:36:12 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 16/22] port: replace RTE_LOGTYPE_PORT with dynamic type Date: Mon, 20 Feb 2023 15:35:50 -0800 Message-Id: <20230220233556.168553-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split up the single static RTE_LOGTYPE_PORT into separate sub types for each component: port.ethdev, port.evendev, ... Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/port/rte_port_ethdev.c | 3 +++ lib/port/rte_port_eventdev.c | 4 ++++ lib/port/rte_port_fd.c | 3 +++ lib/port/rte_port_frag.c | 3 +++ lib/port/rte_port_kni.c | 3 +++ lib/port/rte_port_ras.c | 3 +++ lib/port/rte_port_ring.c | 3 +++ lib/port/rte_port_sched.c | 3 +++ lib/port/rte_port_source_sink.c | 3 +++ lib/port/rte_port_sym_crypto.c | 3 +++ 12 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d4b7088b5cbb..7f1d2c8a256d 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index f185fcbc5a94..b11aec69af78 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -39,7 +39,7 @@ extern "C" { /* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ + /* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ diff --git a/lib/port/rte_port_ethdev.c b/lib/port/rte_port_ethdev.c index 0da7890261e9..6685d304a6e9 100644 --- a/lib/port/rte_port_ethdev.c +++ b/lib/port/rte_port_ethdev.c @@ -10,6 +10,9 @@ #include "rte_port_ethdev.h" +RTE_LOG_REGISTER_SUFFIX(port_ethdev_logtype, ethdev, INFO); +#define RTE_LOGTYPE_PORT port_ethdev_logtype + /* * Port ETHDEV Reader */ diff --git a/lib/port/rte_port_eventdev.c b/lib/port/rte_port_eventdev.c index fd7dac9a5661..04447bd7f7bc 100644 --- a/lib/port/rte_port_eventdev.c +++ b/lib/port/rte_port_eventdev.c @@ -5,11 +5,15 @@ #include #include +#include #include #include #include "rte_port_eventdev.h" +RTE_LOG_REGISTER_SUFFIX(port_eventdev_logtype, eventdev, INFO); +#define RTE_LOGTYPE_PORT port_eventdev_logtype + /* * Port EVENTDEV Reader */ diff --git a/lib/port/rte_port_fd.c b/lib/port/rte_port_fd.c index 932ecd324e05..b2412e7706ee 100644 --- a/lib/port/rte_port_fd.c +++ b/lib/port/rte_port_fd.c @@ -10,6 +10,9 @@ #include "rte_port_fd.h" +RTE_LOG_REGISTER_SUFFIX(port_fd_logtype, fd, INFO); +#define RTE_LOGTYPE_PORT port_fd_logtype + /* * Port FD Reader */ diff --git a/lib/port/rte_port_frag.c b/lib/port/rte_port_frag.c index e1f1892176c4..9adcbba47da1 100644 --- a/lib/port/rte_port_frag.c +++ b/lib/port/rte_port_frag.c @@ -7,6 +7,9 @@ #include "rte_port_frag.h" +RTE_LOG_REGISTER_SUFFIX(port_frag_logtype, frag, INFO); +#define RTE_LOGTYPE_PORT port_frag_logtype + /* Max number of fragments per packet allowed */ #define RTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80 diff --git a/lib/port/rte_port_kni.c b/lib/port/rte_port_kni.c index 1c7a6cb200ea..d4ac08b4cff0 100644 --- a/lib/port/rte_port_kni.c +++ b/lib/port/rte_port_kni.c @@ -9,6 +9,9 @@ #include "rte_port_kni.h" +RTE_LOG_REGISTER_SUFFIX(port_kni_logtype, kni, INFO); +#define RTE_LOGTYPE_PORT port_kni_logtype + /* * Port KNI Reader */ diff --git a/lib/port/rte_port_ras.c b/lib/port/rte_port_ras.c index e5de57da42ea..5a610b1ba5b5 100644 --- a/lib/port/rte_port_ras.c +++ b/lib/port/rte_port_ras.c @@ -9,6 +9,9 @@ #include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX(port_ras_logtype, ras, INFO); +#define RTE_LOGTYPE_PORT port_ras_logtype + #ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094 #endif diff --git a/lib/port/rte_port_ring.c b/lib/port/rte_port_ring.c index 52b2d8e557f0..32a90e836579 100644 --- a/lib/port/rte_port_ring.c +++ b/lib/port/rte_port_ring.c @@ -10,6 +10,9 @@ #include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX(port_ring_logtype, ring, INFO); +#define RTE_LOGTYPE_PORT port_ring_logtype + /* * Port RING Reader */ diff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c index 8a7d815ef323..6e0a8aba5419 100644 --- a/lib/port/rte_port_sched.c +++ b/lib/port/rte_port_sched.c @@ -7,6 +7,9 @@ #include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX(port_sched_logtype, sched, INFO); +#define RTE_LOGTYPE_PORT port_sched_logtype + /* * Reader */ diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c index 7d73adc1e79e..e9cdadbceb8f 100644 --- a/lib/port/rte_port_source_sink.c +++ b/lib/port/rte_port_source_sink.c @@ -15,6 +15,9 @@ #include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX(port_source_logtype, source, INFO); +#define RTE_LOGTYPE_PORT port_source_logtype + /* * Port SOURCE */ diff --git a/lib/port/rte_port_sym_crypto.c b/lib/port/rte_port_sym_crypto.c index 295984d025cb..77a2f04d65f6 100644 --- a/lib/port/rte_port_sym_crypto.c +++ b/lib/port/rte_port_sym_crypto.c @@ -8,6 +8,9 @@ #include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX(port_crypto_logtype, crypto, INFO); +#define RTE_LOGTYPE_PORT port_crypto_logtype + /* * Port Crypto Reader */ From patchwork Mon Feb 20 23:35:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124240 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id B73AB41CF1; Tue, 21 Feb 2023 00:37:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E54B24316E; Tue, 21 Feb 2023 00:36:32 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id BC4944313F for ; Tue, 21 Feb 2023 00:36:14 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id fd25so599601pfb.1 for ; Mon, 20 Feb 2023 15:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oVUrp0GCMkTK1yUJ+jrtCRyLKPkzZ/+SmyGcwBFg3qM=; b=0RHwuBA3Jj5lAGjmkgqZcLw3soBljqMRbZB82kHVkBa+sDd2Y+C/uLe48EnZLtC5d7 Bph61Y9Hw+8LIkNOVd+6+TUMRBvnsKMgoo9LHPbTVpo7r+tYIqf6eoZ8zRtfcqDPe3lg M7/nkIkrMmOi7D30rK2vZC9F06P6asvAzqdTlSs1cbgcYAE1SOtIPVJZRwpE3i1aY0g+ b/jv+hcMASzwlox9/IpkA49crbjnR5rtjB4n1fqSjGyLsQ2uw4evyLQ8HRbQEBsQACEV hUQ+CCqNuXrYBfL/U+VHl0myIM/+gartcHbfZvt2FtCqueTjTzOyPjsozF08B4kqEkg1 F9oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oVUrp0GCMkTK1yUJ+jrtCRyLKPkzZ/+SmyGcwBFg3qM=; b=oaRgLSjCA+vdq9sjfnNRMnthH9wzJXZJEEr65rGXSI1Wvib9ptEBifJ3eFY7sUZkea 4XaGUYbEG8oAcFQ/f8mC5V8/PWRS+CTHbRQDABjg+/+UFHhByV1PFM50hQuvU4OBxbil nkeOJ1q+WSQvoI7hogpijX6800zvU8szw1aQvyEgKEehB+uhyAvNuXtZuI6+M4AMt5Wj Lm5wnyivv7FT4B4Q4gzVi+K16P16+DpnQxAiZ6HcEsqZK7mCfPerDwCEPSBnRz9PuvWg rzyNftGwPIqg4Q2/jGi3gs9+u0zwJod43cvI2I5rvZROnKZcZ9+DmG/IZ+ENtCogx/uf pOFQ== X-Gm-Message-State: AO0yUKUs13+6roie9zcyi6dJxjfXvVF1oSqY6DQxGbjQ/UxnLFFZSsxu +0YqEB2cFUk+Le7fC7Hn0StsEVnilj9f6gEPe78= X-Google-Smtp-Source: AK7set8MZ3GUdcaUP8SVEZj9vJ1MoJ7XGt1KmKA0jfonw7z6zUyZQGNtNeGWktQcq7ouohZD5wnrPw== X-Received: by 2002:aa7:9eca:0:b0:5a8:ac19:8f42 with SMTP id r10-20020aa79eca000000b005a8ac198f42mr2198083pfq.14.1676936173693; Mon, 20 Feb 2023 15:36:13 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:13 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 17/22] table: convert RTE_LOGTYPE_TABLE to dynamic logtype Date: Mon, 20 Feb 2023 15:35:51 -0800 Message-Id: <20230220233556.168553-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use logtype suffixes for various components of this library. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/table/rte_table_acl.c | 3 +++ lib/table/rte_table_array.c | 3 +++ lib/table/rte_table_hash_cuckoo.c | 3 +++ lib/table/rte_table_hash_ext.c | 3 +++ lib/table/rte_table_hash_key16.c | 3 +++ lib/table/rte_table_hash_key32.c | 5 ++++- lib/table/rte_table_hash_key8.c | 5 ++++- lib/table/rte_table_hash_lru.c | 3 +++ lib/table/rte_table_lpm.c | 3 +++ lib/table/rte_table_lpm_ipv6.c | 3 +++ lib/table/rte_table_stub.c | 3 +++ 13 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 7f1d2c8a256d..d640ed3c88b9 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index b11aec69af78..934bddff9dfa 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -40,7 +40,7 @@ extern "C" { /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ + /* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c index 53fd5c66adb5..f44a25a89405 100644 --- a/lib/table/rte_table_acl.c +++ b/lib/table/rte_table_acl.c @@ -11,6 +11,9 @@ #include "rte_table_acl.h" +RTE_LOG_REGISTER_SUFFIX(table_acl_logtype, acl, INFO); +#define RTE_LOGTYPE_TABLE table_acl_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ACL_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c index 54a0c42f7dd2..a7849beaecd6 100644 --- a/lib/table/rte_table_array.c +++ b/lib/table/rte_table_array.c @@ -11,6 +11,9 @@ #include "rte_table_array.h" +RTE_LOG_REGISTER_SUFFIX(table_array_logtype, array, INFO); +#define RTE_LOGTYPE_TABLE table_array_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c index c77eccf52722..12db0b84142f 100644 --- a/lib/table/rte_table_hash_cuckoo.c +++ b/lib/table/rte_table_hash_cuckoo.c @@ -10,6 +10,9 @@ #include "rte_table_hash_cuckoo.h" +RTE_LOG_REGISTER_SUFFIX(table_hash_logtype, hash, INFO); +#define RTE_LOGTYPE_TABLE table_hash_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c index 70ea84fa2e51..147ecdf082cb 100644 --- a/lib/table/rte_table_hash_ext.c +++ b/lib/table/rte_table_hash_ext.c @@ -11,6 +11,9 @@ #include "rte_table_hash.h" +RTE_LOG_REGISTER_SUFFIX(table_hash_ext_logtype, hash.ext, INFO); +#define RTE_LOGTYPE_TABLE table_hash_ext_logtype + #define KEYS_PER_BUCKET 4 struct bucket { diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c index 04d7fd64bd97..09fef5f14ce7 100644 --- a/lib/table/rte_table_hash_key16.c +++ b/lib/table/rte_table_hash_key16.c @@ -11,6 +11,9 @@ #include "rte_table_hash.h" #include "rte_lru.h" +RTE_LOG_REGISTER_SUFFIX(table_hash16_logtype, hash16, INFO); +#define RTE_LOGTYPE_TABLE table_hash16_logtype + #define KEY_SIZE 16 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c index 88d8f69c72ed..1abc459eee87 100644 --- a/lib/table/rte_table_hash_key32.c +++ b/lib/table/rte_table_hash_key32.c @@ -11,7 +11,10 @@ #include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 32 +RTE_LOG_REGISTER_SUFFIX(table_hash32_logtype, hash32, INFO); +#define RTE_LOGTYPE_TABLE table_hash32_logtype + +#define KEY_SIZE 32 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c index 035d24276946..d4ccccbcdf9e 100644 --- a/lib/table/rte_table_hash_key8.c +++ b/lib/table/rte_table_hash_key8.c @@ -11,7 +11,10 @@ #include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 8 +RTE_LOG_REGISTER_SUFFIX(table_hash8_logtype, hash8, INFO); +#define RTE_LOGTYPE_TABLE table_hash8_logtype + +#define KEY_SIZE 8 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c index c31acc11cf23..d0d2c8ba44df 100644 --- a/lib/table/rte_table_hash_lru.c +++ b/lib/table/rte_table_hash_lru.c @@ -14,6 +14,9 @@ #define KEYS_PER_BUCKET 4 +RTE_LOG_REGISTER_SUFFIX(table_hash_lru_logtype, hash_lru, INFO); +#define RTE_LOGTYPE_TABLE table_hash_lru_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c index 9de9e8a20d77..4a5c4a343c77 100644 --- a/lib/table/rte_table_lpm.c +++ b/lib/table/rte_table_lpm.c @@ -13,6 +13,9 @@ #include "rte_table_lpm.h" +RTE_LOG_REGISTER_SUFFIX(table_lpm_logtype, lpm, INFO); +#define RTE_LOGTYPE_TABLE table_lpm_logtype + #ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536 #endif diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c index 8fde2c012f7c..236eac4238d9 100644 --- a/lib/table/rte_table_lpm_ipv6.c +++ b/lib/table/rte_table_lpm_ipv6.c @@ -12,6 +12,9 @@ #include "rte_table_lpm_ipv6.h" +RTE_LOG_REGISTER_SUFFIX(table_lpm6_logtype, lpm6, INFO); +#define RTE_LOGTYPE_TABLE table_lpm6_logtype + #define RTE_TABLE_LPM_MAX_NEXT_HOPS 256 #ifdef RTE_TABLE_STATS_COLLECT diff --git a/lib/table/rte_table_stub.c b/lib/table/rte_table_stub.c index 23d0de5c79b0..e74044032f7d 100644 --- a/lib/table/rte_table_stub.c +++ b/lib/table/rte_table_stub.c @@ -8,6 +8,9 @@ #include "rte_table_stub.h" +RTE_LOG_REGISTER_SUFFIX(table_stub_logtype, stub, INFO); +#define RTE_LOGTYPE_TABLE table_stub_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_LPM_STATS_PKTS_IN_ADD(table, val) \ From patchwork Mon Feb 20 23:35:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124241 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 5169241CF1; Tue, 21 Feb 2023 00:37:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16B3243171; Tue, 21 Feb 2023 00:36:34 +0100 (CET) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id 5FCE74313F for ; Tue, 21 Feb 2023 00:36:15 +0100 (CET) Received: by mail-pf1-f177.google.com with SMTP id n5so1568538pfv.11 for ; Mon, 20 Feb 2023 15:36:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=; b=0tPIbB5DNot4AfGT15SPp5Ow7IgHVAUbaYQVp0I2NqgMIxr3drtDhS1dfQUsi+fZF4 CtLZebEb9qwwfj34LejIJxHNmHA3g/bNHHoiloyAP7nU5eHsjSTWzqCUYFNywp7RMB+K EdWyiljN6laNw9eOLPdXYLE2jB/U8Vxx7H94w3sOQGx5ixpRHrjtQPKDtU/teyin4V3S Oes9rP0BukAUDzi0WK0qoL5EX8ilJq3bEGSFms7uulrWZNtnyt8cJd0nmVCKS6WIfQ8Z 9pf2GaF8OKwhoOVCP+o4hMRcqZlKuwzkMM7pfJ3TSUd4sP8qu2Ao7Q8LDq735oDVzNzn QBIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=; b=DGeazG/px717bIGJAAZtzH1TY95pEzqynr43omwnBtA4ppOZ13PUzjgUHNmprknKL1 5WVFmFZfv5FFJ8TlEf+DQoKWqaNCZt4HZNUmxuendcsvGIfVoRnk7UQiS4TgBmGqHBBd 9ANKD94Snn9BS5pmlyiyTBTZq1Eh4jzX0NOr7pmX9QSYnzZpSzdQREHUfpT5H0jbJ/Il QPVfRhcFkSc671lDRkh6mdapM7gK16SR/lzY+Dwm5Wc6DrfFsL80vrYl7nV/ASbolg2O MAaaH7HvSEUWFVBA2FmHOLdxgDa749Mesjmy2YYayJ9RPHsfeUmIPm+hO1LO2BaabdCD CMmw== X-Gm-Message-State: AO0yUKXu1SnMPZZRiAbOD6WmMiA+JvUwbHEbYZ5XHQCUT5qMhv9AlK2h L+LwMf+VvHf4HRW/B1yUf5qz13h5wVqOmNIv21E= X-Google-Smtp-Source: AK7set/sMQ9qkf1M3UMZFAfQD4RteooZmP5qJ8hzdah1hGQTvc7rI5j3xUKGQ+stRYmrXhHIifwtkw== X-Received: by 2002:a05:6a00:4194:b0:5a8:cc39:fc58 with SMTP id ca20-20020a056a00419400b005a8cc39fc58mr3610533pfb.6.1676936174531; Mon, 20 Feb 2023 15:36:14 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:14 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 18/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Date: Mon, 20 Feb 2023 15:35:52 -0800 Message-Id: <20230220233556.168553-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Instead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog. Signed-off-by: Stephen Hemminger --- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index e66f06b84d0a..dff9bddfb948 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -346,7 +346,7 @@ setup_acl_pipeline(void) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss = NULL; table_params.action_data_size = 0; - RTE_LOG(INFO, PIPELINE, "miss_action=%x\n", + printf("miss_action=%x\n", table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs), @@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret = parser(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret = parse_cb_ipv4_rule_del(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule " - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + printf("%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], mbuf); } @@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets for ACL test, " - "expected %d, got %d\n", + fprintf(stderr, + "%s: Unexpected packets for ACL test, expected %d, got %d\n", __func__, expected_count, tx_count); goto fail; } diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index 7adbbffbf55d..960f730cf20d 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include "test_table.h" @@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p = rte_pipeline_create(NULL); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: configured pipeline with null params\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_1); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with NULL " - "name\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with NULL name\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_2); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid " - "socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", __func__); goto fail; } if (rte_eal_has_hugepages()) { p = rte_pipeline_create(&pipeline_params_3); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with " - "invalid socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", + __func__); goto fail; } } @@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; - RTE_LOG(INFO, PIPELINE, "%s: **** Setting up %s test\n", + fprintf(stderr, "%s: **** Setting up %s test\n", __func__, pipeline_test_names[test_type]); /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } ret = rte_pipeline_free(p); if (ret != 0) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to free pipeline\n", + fprintf(stderr, "%s: Failed to free pipeline\n", __func__); goto fail; } @@ -245,7 +245,7 @@ setup_pipeline(int test_type) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count) int ret; int tx_count; - RTE_LOG(INFO, PIPELINE, "%s: **** Running %s test\n", + fprintf(stderr, "%s: **** Running %s test\n", __func__, pipeline_test_names[test_type]); /* Run pipeline once */ for (i = 0; i < N_PORTS; i++) @@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret = rte_pipeline_flush(NULL); if (ret != -EINVAL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: No pipeline flush error NULL pipeline (%d)\n", __func__, ret); goto fail; @@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0] = 0xadadadad >> (j % 2); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + fprintf(stderr, "%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], m); } @@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets out for %s test, expected %d, " - "got %d\n", __func__, pipeline_test_names[test_type], + fprintf(stderr, + "%s: Unexpected packets out for %s test, expected %d, got %d\n", + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; } @@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table = 0; if (check_pipeline_invalid_params()) { - RTE_LOG(INFO, PIPELINE, "%s: Check pipeline invalid params " - "failed.\n", __func__); + fprintf(stderr, "%s: Check pipeline invalid params failed.\n", + __func__); return -1; } From patchwork Mon Feb 20 23:35:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124242 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 8F57B41CF1; Tue, 21 Feb 2023 00:37:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BCF843177; Tue, 21 Feb 2023 00:36:35 +0100 (CET) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 9C88D4313C for ; Tue, 21 Feb 2023 00:36:16 +0100 (CET) Received: by mail-pf1-f182.google.com with SMTP id a26so1445911pfo.9 for ; Mon, 20 Feb 2023 15:36:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eECXXGmntrXbA8+7KcILaCKIy+GGF4blhlaA75UYdDk=; b=6i1veO/cWuO/qnOMnCwY8PBd6jl3srxK7I5lTiuuYrZLoRDB5W2BevpNulK3yr13ze /TiGDnSXtlYZs7ZNPi7vApiPk42O46dg07gVEI93gJH8GCJOS/42hI0sUKPKrrpRxHD0 94oybFvrPvyxJkabUF994r72RW1p0BP0QYuqS063tWLHW7MXNrsQQrRm1WgAXIYXMLIf fyNa8lA8Ad3gaWHueY7Goe6UkfV0eP3du6f4hfXYgzEhNs5Z1uifdU3XAyxULq0H/xHN jGJlPb/TqO/7MW4gakr5DYA4RCQWpP7Cw0+5eOv1jhs+bkfAYMjZZYJGjph1Jq/TUO5j z8fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eECXXGmntrXbA8+7KcILaCKIy+GGF4blhlaA75UYdDk=; b=zH9NXR3oKqfJxI5Vx5adM2ukMkhYezYGjwb7vrEmhQ/nM3v1sjWvy/CF8sUgsCRJk7 FUOuqY9fjlqjHMi4GL/iNUOTadJq/ery9zlUgcviv1f9+SuChU9U/oi6mCbQLdXHNOsD IKrAVIYJqg3FYoyHqBPLXcBB7hlS2omPYVHYFISB2QHZnMatNZjQZhb7Gv/FvkVjtNFE Wso6bdpqw7P1MAY9xv0HYgzy0aDIfSuWLBR5acjMHmBuYDs691T/pAmc1qaEuaIVSoL+ Dr51oL0SveSi/0eFs0UnRpkVldHud3ZvTjknMxgD28DjGuWe4dpwnintz63oy1JyfrMK HaTA== X-Gm-Message-State: AO0yUKWzYtjXnzbsvJVdxd0Toblhc4igdFbHgb2RPA/sAo0xq1xz7oyR ktwvF+0KDX2GjKU+41UaCQ70R335PKFqdTk5F68= X-Google-Smtp-Source: AK7set+NIjNUXA0dBxNMD1aVI3lsh8uqNXz41ZT6QNqh8SDOLZFtMUxNIOXWGgduJ9czUFo9LyZngQ== X-Received: by 2002:a62:79c5:0:b0:5a9:4af:b05b with SMTP id u188-20020a6279c5000000b005a904afb05bmr1614801pfc.12.1676936175516; Mon, 20 Feb 2023 15:36:15 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:14 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 19/22] pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type Date: Mon, 20 Feb 2023 15:35:53 -0800 Message-Id: <20230220233556.168553-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use a dynamically allocated logtype. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d640ed3c88b9..a3498d1a2faf 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 934bddff9dfa..7473fd53505a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -41,7 +41,7 @@ extern "C" { /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ + /* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c index ff86c7cf96bf..30919cd9fe30 100644 --- a/lib/pipeline/rte_pipeline.c +++ b/lib/pipeline/rte_pipeline.c @@ -12,6 +12,9 @@ #include "rte_pipeline.h" +RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO); +#define RTE_LOGTYPE_PIPELINE pipeline_logtype + #define RTE_TABLE_INVALID UINT32_MAX #ifdef RTE_PIPELINE_STATS_COLLECT From patchwork Mon Feb 20 23:35:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124243 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 1E88A41CF1; Tue, 21 Feb 2023 00:37:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B9BC43179; Tue, 21 Feb 2023 00:36:36 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 3142B43141 for ; Tue, 21 Feb 2023 00:36:17 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id fd25so599668pfb.1 for ; Mon, 20 Feb 2023 15:36:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=vBkc4YJNUrlP1wsMTIgrmdYDirgd14vI7/3Q3i10dh0ATeoC9Vs8Rn3XMfJ8l4RCOX /pMCa0D1L960gu7WE190ADnu8ZLQzu2K2uo8XnLISC4caFR6/wy1qW9Z18JkKPAFJsLE 1KuFk+HQZ0T+juMoaUkExpfUGuONw0kBgvaNyh9C50oJmVHW7fA/9MOwlLNdX9CEeze+ cLQ8ohVnjzD/k65Mzzfj54ef0YMZBaE7Qtq3ZtVwY5GLtW/wkdGhN+VkNBD4p6mMqVGx DrsugRlViUWMhci9JXEGEuib8mAiPSV4MM8ytpr3ei1eooAzLLYa1pSfOkgXYArDxwco VeRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=uK0BM5LVFzGbDy81Q8tuc0kzbzjEKkTOG011ipvxiSkvC95B/1Poag8rPF0Bo9YYf/ kaefcHksyPnJhGUcUVm3WuE/4CwS+Vt7YTWuA49RLuOeAl/TLB6GDsAMFqoeIwv9cI2p 2XhqDS9vETDpVEqDFh5AworI0PS7CYlWLsx1p8MalZeTSjTIeE4VrgehfyHZeuMR7Ti0 Uo4Q3DGEvi26wEoHJlKb63xerJlmhW0zSyKq766j3WeR0le5epTeuoXAN6bqXQypHs0n 1EOnN2Etg0Z6HuFjjEE7Rt83G6G9PLG4mLCt0PT3zVgiMSb3C0DzShxDckv/+4zoHhuD S2zQ== X-Gm-Message-State: AO0yUKVPMknoXtYZFjVJtUq8uTgDPftQjF6au7VCoSDBcOYdzO6CGqXD TOKJAo6fqyemWAy9iJudqgXy3vLeQ/smqEde1dM= X-Google-Smtp-Source: AK7set94BBxMJqRFJTZNnZ3MYMEq1nJXHjppdeYa8jr2v2PLejzGA27NE0LOlsG6H1SlrtE5C0lPug== X-Received: by 2002:a62:1d4e:0:b0:5a8:cec9:6ab6 with SMTP id d75-20020a621d4e000000b005a8cec96ab6mr2999980pfd.31.1676936176410; Mon, 20 Feb 2023 15:36:16 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:15 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 20/22] hash: move rte_thash_gfni stubs out of header file Date: Mon, 20 Feb 2023 15:35:54 -0800 Message-Id: <20230220233556.168553-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Having stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once. Signed-off-by: Stephen Hemminger --- lib/hash/meson.build | 8 +++++++- lib/hash/rte_thash_gfni.c | 43 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 28 +++++-------------------- lib/hash/version.map | 4 ++++ 4 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c diff --git a/lib/hash/meson.build b/lib/hash/meson.build index 2f757d45f9bc..e56ee8572564 100644 --- a/lib/hash/meson.build +++ b/lib/hash/meson.build @@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu'] diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c new file mode 100644 index 000000000000..7617b9d4f630 --- /dev/null +++ b/lib/hash/rte_thash_gfni.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ + +#include + +#include +#include +#include + +uint32_t +rte_thash_gfni(const uint64_t *mtrx __rte_unused, + const uint8_t *key __rte_unused, int len __rte_unused) +{ + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + return 0; +} + +void +rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, + int len __rte_unused, uint8_t *tuple[] __rte_unused, + uint32_t val[], uint32_t num) +{ + unsigned int i; + + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + for (i = 0; i < num; i++) + val[i] = 0; +} diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h index ef90faa302d1..86208eb45ebb 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,13 +9,8 @@ extern "C" { #endif -#include -#include - #ifdef RTE_ARCH_X86 - #include - #endif #ifndef RTE_THASH_GFNI_DEFINED @@ -38,13 +33,8 @@ extern "C" { * Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - return 0; -} +uint32_t +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); /** * Bulk implementation for Toeplitz hash. @@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, * Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, - uint32_t val[], uint32_t num) -{ - unsigned int i; - - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - for (i = 0; i < num; i++) - val[i] = 0; -} +void +rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], + uint32_t val[], uint32_t num); #endif /* RTE_THASH_GFNI_DEFINED */ diff --git a/lib/hash/version.map b/lib/hash/version.map index bdcebd19c29b..f03b047b2eec 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; From patchwork Mon Feb 20 23:35:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124244 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 2CC4F41CF1; Tue, 21 Feb 2023 00:38:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 67AC54317F; Tue, 21 Feb 2023 00:36:37 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 358B443141 for ; Tue, 21 Feb 2023 00:36:18 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id e24so1532745pfn.3 for ; Mon, 20 Feb 2023 15:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dfb1E0xn1XyQ4s+b+w1zmOSAvjvFm4bNTCC6e3Z0zDw=; b=GGRi1otNPAc7h1++LqtNU6XsSU/OVPmuf9TYgiyqm+PZYLI3rKKXQskHRhyWUMVnVt 5cqZavlrboKIu+6BaaQJa+BvCIY0jDVGAhfdHQa19HxHDJ1+2SzrhOs3dPNl2sYj5tZD PI6Ixqu5cAC4n37LFFg1JyExU/b5/0dnSP6Ozr70DkI+nKgLVjWUlkgGyObSMfQ+3dBD ea9IH9M3VlHSXXuFsGKkFiXzusZN3K41luti7PosQrY3LOdYTB8SxuCzkXnPNOQntY1f /1ywggjThY36gZJgXplSqsanLhrsDoW9y/1nHHeRxZxYA/Q/Hl9QKYRSMnASlEUqocnS LgYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dfb1E0xn1XyQ4s+b+w1zmOSAvjvFm4bNTCC6e3Z0zDw=; b=wtgLi3MSp7XL8jY09KPY6BaMoxMUK0MQBPcJNNRR1GaLCH+y6v7kWUFOfhSxag9hqM dO5wIHq7Q9R/5BY4KZV4gxrCyCATt9fU/DVbh2yv55h8U+Liconr7EK7h/fgsba+jcfN IYVP8+VSrAH/8cNCvd2C4DS/SCAx0mzbJawXMqft/VpkILnJxuANQyG4reczTIAB4D5r 2uLtRam95GIwDJpROI7HFYJ32aAhpJklo1QcgIlY2sRuoXYplWye3N9BFuHaRQIbkyoV HXNWGbIz2DvYQya+aZOzD5StEgxmSgcFuXkCkUkeNVA+e+J0vAvSR8CkghmYNcoRMGvO boxA== X-Gm-Message-State: AO0yUKVtVv8zkr7zzV46eqmysPpnSuam74ZjmrMTLRtkxZ8ty9TGtZ+i b7YYjiHR/tX67pP/zgVgI8eKPdVnUt7hxYq3aSE= X-Google-Smtp-Source: AK7set9oCxHH+yAcPMAflNxZXRBrprUXps5kvUDd2lnXLWUZ3AASxvQnhJWmhI1yBhqIHIkku2fPBA== X-Received: by 2002:aa7:9691:0:b0:5a8:b911:a264 with SMTP id f17-20020aa79691000000b005a8b911a264mr2413047pfk.28.1676936177294; Mon, 20 Feb 2023 15:36:17 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 21/22] hash: move rte_hash_set_alg out header Date: Mon, 20 Feb 2023 15:35:55 -0800 Message-Id: <20230220233556.168553-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of RTE_LOG(). Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same. Signed-off-by: Stephen Hemminger --- lib/hash/meson.build | 1 + lib/hash/rte_hash_crc.c | 63 +++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 46 ++---------------------------- lib/hash/version.map | 1 + 4 files changed, 67 insertions(+), 44 deletions(-) create mode 100644 lib/hash/rte_hash_crc.c diff --git a/lib/hash/meson.build b/lib/hash/meson.build index e56ee8572564..c345c6f561fc 100644 --- a/lib/hash/meson.build +++ b/lib/hash/meson.build @@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c', 'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c' diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c new file mode 100644 index 000000000000..c59eebccb1eb --- /dev/null +++ b/lib/hash/rte_hash_crc.c @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation + */ + +#include +#include + +#include "rte_hash_crc.h" + +/** + * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash + * calculation. + * + * @param alg + * An OR of following flags: + * - (CRC32_SW) Don't use SSE4.2/ARMv8 intrinsics (default non-[x86/ARMv8]) + * - (CRC32_SSE42) Use SSE4.2 intrinsics if available + * - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default x86) + * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8) + * + */ +void +rte_hash_crc_set_alg(uint8_t alg) +{ + crc32_alg = CRC32_SW; + + if (alg == CRC32_SW) + return; + +#if defined RTE_ARCH_X86 + if (!(alg & CRC32_SSE42_x64)) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) + crc32_alg = CRC32_SSE42; + else + crc32_alg = CRC32_SSE42_x64; +#endif + +#if defined RTE_ARCH_ARM64 + if (!(alg & CRC32_ARM64)) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) + crc32_alg = CRC32_ARM64; +#endif + + if (crc32_alg == CRC32_SW) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_SW\n"); +} + +/* Setting the best available algorithm */ +RTE_INIT(rte_hash_crc_init_alg) +{ +#if defined(RTE_ARCH_X86) + rte_hash_crc_set_alg(CRC32_SSE42_x64); +#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) + rte_hash_crc_set_alg(CRC32_ARM64); +#else + rte_hash_crc_set_alg(CRC32_SW); +#endif +} diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h index 0249ad16c5b6..e4acd99a0c81 100644 --- a/lib/hash/rte_hash_crc.h +++ b/lib/hash/rte_hash_crc.h @@ -20,8 +20,6 @@ extern "C" { #include #include #include -#include -#include #include "rte_crc_sw.h" @@ -53,48 +51,8 @@ static uint8_t crc32_alg = CRC32_SW; * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8) * */ -static inline void -rte_hash_crc_set_alg(uint8_t alg) -{ - crc32_alg = CRC32_SW; - - if (alg == CRC32_SW) - return; - -#if defined RTE_ARCH_X86 - if (!(alg & CRC32_SSE42_x64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) - crc32_alg = CRC32_SSE42; - else - crc32_alg = CRC32_SSE42_x64; -#endif - -#if defined RTE_ARCH_ARM64 - if (!(alg & CRC32_ARM64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) - crc32_alg = CRC32_ARM64; -#endif - - if (crc32_alg == CRC32_SW) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_SW\n"); -} - -/* Setting the best available algorithm */ -RTE_INIT(rte_hash_crc_init_alg) -{ -#if defined(RTE_ARCH_X86) - rte_hash_crc_set_alg(CRC32_SSE42_x64); -#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) - rte_hash_crc_set_alg(CRC32_ARM64); -#else - rte_hash_crc_set_alg(CRC32_SW); -#endif -} +void +rte_hash_crc_set_alg(uint8_t alg); #ifdef __DOXYGEN__ diff --git a/lib/hash/version.map b/lib/hash/version.map index f03b047b2eec..a1d81835399c 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash; From patchwork Mon Feb 20 23:35:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124245 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: 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]) by inbox.dpdk.org (Postfix) with ESMTP id 24B8041CF1; Tue, 21 Feb 2023 00:38:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84EFE43182; Tue, 21 Feb 2023 00:36:38 +0100 (CET) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id 65A3843141 for ; Tue, 21 Feb 2023 00:36:19 +0100 (CET) Received: by mail-pf1-f181.google.com with SMTP id d7so1484066pfu.4 for ; Mon, 20 Feb 2023 15:36:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VjyeyzgaeR0B6Nol1NDDKs8M1PoK+Yw48Dj8cOhVDkE=; b=21LBk7d98t+FiYopWKSLfkMXHLw9cm8myzLyuEshuPUF36oghan7vpWKm052DtIVnS D8F5sL+NY99tpcq+pA6pf2chrBBFAjqlQiKmkWDHM4lY40KXBPrQ/Ri3ZBuwiqLx5yM1 0Pm4d+B6hFSDpWf7dT7fhcfjHU+UbRHoWiM7L+MggeDIcaY6VQ28kPNVlPnKWYZ385no guXWOCY2P4PSp/JzJuEHQBU20QuWmgWtBLaod5GPH9WngvZ4NTjLu67dae3gu8m/vn5W IXlMxKjeu/TwFOF3n/MRKTlx2UGKjRN+Of9CFyBNdL+gjj4jbsbm/Htmkjkq5cl0EEy+ Lc5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VjyeyzgaeR0B6Nol1NDDKs8M1PoK+Yw48Dj8cOhVDkE=; b=2icmGs5QHNaEUXeJBedT5IjDU70HGImWKEfp4YM2kQMXaBCaJREL18UCk8UuaxdVKq qSFcLa48N5O7i1fj6Pckijkprp2WQlucQ5PL5ATzY8yY9e61zE6K3SdvAn6eYzCCCdsw mimHeMEPMbbUeQuk4Gb/gsGwWtPmt+pRB46z3y5hOhTGFn+ARP+tzV2EBRu239TH3kMS mmnzv3x4rh9oS+C0plKGupZ2bpn1/TbBOtXkj8yijxGg87O7QebHmSi/fqGa2NAbBvRB vjqkcAaEmXN/RwkmhFfQDn996mU9PnGUdbo5J179ZqvGH3/RAXjsf5lZ+Y8WcvL4OGwT 3WqA== X-Gm-Message-State: AO0yUKWZ0lWKykCruWXIvSHo/xn8ngx+qwDpQDj7PKsHdssXeF3EUZIj zgTtsrLrHIhuwaFlTw+Y8foFTO1e4NIvMV7qfjs= X-Google-Smtp-Source: AK7set/bQb10TnEzTX7XYw0sOpCqO7jdFWSZvfZY6eDmRo1QpTY7SC4v3MD/QodCY3sq8svwAWMsQA== X-Received: by 2002:a62:1605:0:b0:5a8:ba8d:8040 with SMTP id 5-20020a621605000000b005a8ba8d8040mr3478271pfw.23.1676936178346; Mon, 20 Feb 2023 15:36:18 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id q19-20020a62e113000000b005a8dc935ec1sm8215908pfh.62.2023.02.20.15.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 15:36:17 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 22/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Mon, 20 Feb 2023 15:35:56 -0800 Message-Id: <20230220233556.168553-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220233556.168553-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230220233556.168553-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use dynamic type for hash and add subtypes for crc and gfni. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_hash_crc.c | 3 +++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 7 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index a3498d1a2faf..704924e822d0 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7473fd53505a..29db07881a5a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -32,7 +32,7 @@ extern "C" { /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ + /* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 829b79c89a27..e2b07bfbad71 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -24,6 +24,11 @@ #include #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT(hash_logtype, INFO); +#define RTE_LOGTYPE_HASH hash_logtype + #include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */ diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c index 538b23a4030a..b4c4c191abdc 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -8,6 +8,8 @@ #include #include + +#include #include #include #include @@ -18,6 +20,9 @@ #include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO); +#define RTE_LOGTYPE_HASH fbk_hash_logtype + TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry); static struct rte_tailq_elem rte_fbk_hash_tailq = { diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c index c59eebccb1eb..7c544a669f8a 100644 --- a/lib/hash/rte_hash_crc.c +++ b/lib/hash/rte_hash_crc.c @@ -7,6 +7,9 @@ #include "rte_hash_crc.h" +RTE_LOG_REGISTER_SUFFIX(hash_crc_logtype, crc, INFO); +#define RTE_LOGTYPE_HASH hash_crc_logtype + /** * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash * calculation. diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index 0249883b8d07..c1fd2e34c9d4 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -13,6 +13,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO); +#define RTE_LOGTYPE_HASH thash_logtype + #define THASH_NAME_LEN 64 #define TOEPLITZ_HASH_LEN 32 diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c index 7617b9d4f630..f17ca222dc32 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -8,6 +8,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO); +#define RTE_LOGTYPE_HASH hash_gfni_logtype + uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused)