From patchwork Wed Feb 22 16:07: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: 124358 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 8458941D40; Wed, 22 Feb 2023 17:09:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 770D240693; Wed, 22 Feb 2023 17:09:26 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 74F7240689 for ; Wed, 22 Feb 2023 17:09:25 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id bh1so9289633plb.11 for ; Wed, 22 Feb 2023 08:09:25 -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=1VT3Lf6aG70swyvaQZ1+5xtAfTuMUtLdQj0tjtkO+SNBkLfINMomFdcBX7sgOBJkyf NjauCt7zYaEO1E6affyWWRoYqQcFfSGKvskHisj1ciGc18+Oyma+t9FGGXcmkgtrLz9G vg7uYZBN7Mk5vpWj3X4c75YfpGaI/Fxkm5z2K4xMoaLzl7dWQFvSfPHZ7kE0cPncZbFr k7r2I3kFgxhkZM0Ge1qyoO0rRWKzb7XTgMeqH7UKgJVMLkfal5HUo/SJct10YUpxPP8K 2VTkEpq5+q1y9lxWRAfNPYoficZaXxho+ZdR3KGbNHUiQfWKBqCiZ6GUfiJgcJcB0PDB xNGA== 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=wSgCXBFI1ojpNxdGxg748cyXpgRwjnTmUAFym4AM2/HYWghlhs6K6leXNFKxQOStYp Sb/V5gg0G8KNvC++SsPLIai7Hx5NtTeWYwJzbzSs/l/NTl2ZJ2M64zJl8F2HEZ8PDp37 HEjU5x1mYoSRXfkBPaMoaTVpllgjlkv+PGGPCKwRWwRnbOSry+I2s39sXGeB183v+h94 fXxoTldN/lxzUM1I+CWGsSBRXclUp1H8CTT/DvATELcFAOKt8svTWw5NGhLgtF7hZaDg GHNidxGyjgXrM6+JMNmfFRImN6CbUk3eJNia/yiwuv31zAArIjW4ATaxYUF3zlbfoWdQ hHKg== X-Gm-Message-State: AO0yUKXDIS950ReYutg4pcsOuV2jr5+afSOcdL7r80N+4jCnEyz3I8Hu DIJuD23BRn1+6wX9U5PCsk9mH3Kq9xeUvZbR0Ak= X-Google-Smtp-Source: AK7set9fU8sYkVCIPQBVEKx2uvPu4NPQh0XZ0wJsjgGuTvRmkr1h1G4g2EE9Hz0H0XY/B/KZoW6ARg== X-Received: by 2002:a17:903:41cd:b0:19a:a520:b203 with SMTP id u13-20020a17090341cd00b0019aa520b203mr12629897ple.25.1677082164206; Wed, 22 Feb 2023 08:09:24 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:23 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v10 01/22] gso: don't log message on non TCP/UDP Date: Wed, 22 Feb 2023 08:07:41 -0800 Message-Id: <20230222160802.123611-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124359 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 8E67541D40; Wed, 22 Feb 2023 17:09:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6E20F43016; Wed, 22 Feb 2023 17:09:29 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 32EF740689 for ; Wed, 22 Feb 2023 17:09:26 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id ky4so10471036plb.3 for ; Wed, 22 Feb 2023 08:09:26 -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=MprwvmOG9v8C7k1A4Ub0ZunODpAH17gyO5WYV2lGgWEvYyU45ZxoKWibSxE1tUJrCO 49oHqYq4KxiPXMNjo5zCnTGHCzmX/Ks0p2jLIlOFzt6WcwKAzVNYOXBbRfXt9vQ6RtLH KsvcS+R7EUBXAkYEx3CEwRuDFoA8qItbiqJo+T/vjwma2nVEQ6XYBsn3MHxNp7bBQNKJ EGntzO/kuV1f+8sGDz1fai2RLXwt+IPNKL9e5fVMoN4Wb/8BzXIMrLpDIYkMaWF3S4lo qM8b/qrYmpbvtxNa3IGuUhrMYP6G1mUFaCsO+6vrYLhLZH8JoDwDFccaeIrGIKWachBW TyVg== 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=SCKo1MIVzVfG2a5iqKeQPpPsXOTR7v8t+SCiHaRJf7tSu4VgNnvNKAsd0mvYP5fr8T YEMBht/NW7WQhbZF2TyF1T91ccPHmgPKU/YL3GxBybFdJZ5lLlMad0D/CrXGKITc0YMi zZ6UqbTklL3eM7djvFJM9bORmLamgTeKoiqKEAPQDyaIW0b9e2rEGPJbzLxl6PRcWD9l LYT6uZ9EjHrQu5XJnjn3vm9aHMhzlpORcMyPqcM9v/jYNgORK/s/kAMgOF/M3fbI42La Nz/yxcaoK/Xovluui97dQQ/vpswV21Bjq96/IU6kd1Kj4HhSz8xnJtd3MLEM5HD+jDQQ dNpg== X-Gm-Message-State: AO0yUKUhKkW1TQfKS5xSfTVmOSoiEX9P3pCGIhJ56i8GiO4wOLWsBnMx rr54aOy1XHhkLM7pVHdRzd1CguEMnIqOr7dur0g= X-Google-Smtp-Source: AK7set81WWsW/NVxXPnEn+WhQ1jetk3TZkidKG4Mrx38DBGaT0vQ6unh83LBdfq86JAKOilPhUPOkg== X-Received: by 2002:a17:903:7c3:b0:19a:821b:482 with SMTP id ko3-20020a17090307c300b0019a821b0482mr8070658plb.52.1677082165128; Wed, 22 Feb 2023 08:09:25 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:24 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v10 02/22] eal: drop no longer used GSO logtype Date: Wed, 22 Feb 2023 08:07:42 -0800 Message-Id: <20230222160802.123611-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124360 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 64C3241D40; Wed, 22 Feb 2023 17:09:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AC7F43024; Wed, 22 Feb 2023 17:09:30 +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 351E643004 for ; Wed, 22 Feb 2023 17:09:27 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id e5so10344467plg.8 for ; Wed, 22 Feb 2023 08:09:27 -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=VwSWh8DzpFXHAFs6Ih4lXv1DcvVmb4dPEYloYYhVYVnt4pOqlG6W3DkTy54f6prEeN CxRrHnhT15ogFZbylgLFDQizV6Cvj5ht/QLRKEfniRxzNR9+cLdxRMnwffx5QRgzZLRF 2bI4AIjoSfIZS2H01yPL4aADu39sot5VLlG9uf7/yheuWw96G+cHzZW7k8XvmRaGk9hZ Gmn+f726dLi4hNWAK+X9cNSlHOJH+PeV7SO8vo9SBNFEGuB87nuFnmrbE5Of4YSeG1R5 XAPAvTwZ8r+i5j0rA07x1qBDv/8CvoyYBdPB0AQipbbipvJ3rvw82i2TR+/0WVTyg1De 4JUg== 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=JzQOuKFT9kBbS3EYJwx8gZnmpuUomW9dU3DbQKH6/+ZgIUBbjjOcUW2cmFhxNew0ko Ew4kgnmvRmI32+rh6dlHxfxjgd8etoIOVuhDx8KTcTatpEW9Jl5i2+VHHpP3SGitfz+5 4lstDjHtbbkZaDYPCBH77dBxoonAzQ/D1tBkIv+h1jAA4/0E81tUcyiovwH+Lw9X3rm8 8rQVJXFU1eoywA3gxDupZLpCrPv9lv243Z2xBuzpabaGQYfObzGqhK0llVXpFfiSz3Ho w+pC3VLWHxwi28j7Ha/8m+8LgkHXBN2p7DWaozNj2J5VRrImK9l9LXBGkZ5sl5hZkDx/ EHNA== X-Gm-Message-State: AO0yUKU0SJvtVoA2YSDM3Gcy4sPpW3Pc2guKGZYQkRlhTHEfe350UJ9F h/Npa7Fa7k4H2L6bgqb+Z2smIYU8tpAK9vjKoIw= X-Google-Smtp-Source: AK7set86uEzvk9ro/WyFupkFsklswU5+y0V3yLm0/uwSlHXCjPbYzNRMdeb9dw54/GTuHv0b/65Yfw== X-Received: by 2002:a05:6a20:3c89:b0:bc:63d0:d9d9 with SMTP id b9-20020a056a203c8900b000bc63d0d9d9mr10222783pzj.47.1677082166047; Wed, 22 Feb 2023 08:09:26 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:25 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v10 03/22] log: drop unused RTE_LOGTYPE_TIMER Date: Wed, 22 Feb 2023 08:07:43 -0800 Message-Id: <20230222160802.123611-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124361 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 2E40641D40; Wed, 22 Feb 2023 17:09:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 536AF4302F; Wed, 22 Feb 2023 17:09:31 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 08FB643004 for ; Wed, 22 Feb 2023 17:09:28 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id il18-20020a17090b165200b0023127b2d602so8852213pjb.2 for ; Wed, 22 Feb 2023 08:09:27 -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=zc8DEPOWZXLuHDyg4FgVtpMQG8uA2JSGy6x3MtqjI0sJnvdXugE5OGuHrPlh5fkOyi FXsEneJZXFP/vgi5SgTESKpDZqZaYAE5fW8BwDJpIYW7Nyw0uEpMyJUrk+TxcgJgIuSd nMOd4b4b/r46KkzfTIrjp8fJZ5ePxpFdycB4vbCs/GTDSGiL8xnyVYIS2Qp8z0zyG4Dl YQC65BM81gzI1kLx5vJc4BSiF0fHbImYaT83BMDZtJhJ70VGc+aLHZLQ1scDIL/RTddf F5DRLg26DBsJyjgaRWxfk/H4jZlIt7mdOmtFgc6J3M9ypPGRMfDM8liSNlwQLQ6jFOfG pMlg== 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=OmuDq8B231S9+keuIavog3OEaUc05qZ3NDZnVnU2UIGOw0QTLBiwE3OkdaZNyG8iJE rNi5W1VrogNMFa7R0TSDQVM6wFZZ21EAtawTj3KmrtLNLMiYW7AqITcnc8D6IkQk3tZM OiHgiBpR2uqcNqez/cbxG+oYFIyF8PSePXpBpeN6D7KmnAHmqEc0AQTrFF2xygY2pryx bcv7WklCvZOTpTlPj+QMUe+AqYlIXjIszsFHDPasocIWXMF89tCRrxM0t7YrhMHuyNAW DW/lVXnN4Lg6kAnS783KMElBm4YdQrEsp8WRrx1be5fjBkBT+eYwG5Vf1NfOKjbS5nJ5 QXZw== X-Gm-Message-State: AO0yUKW+f55r5NuppCvVeHZkwkjzVe8UIzDtCTP5aeGjKIbkbDAVVCeJ irDeil8h48QrGl4DKhVLn3uGZFoqXhAfUl84nj4= X-Google-Smtp-Source: AK7set+BAgBGXiQIXiaTOY0ti9yelumzfaqIZcDakUB+RyhK0ge0X6Tdc1PFVJTHq9HkEs8MNH+c8g== X-Received: by 2002:a17:903:5cf:b0:199:1852:d2e with SMTP id kf15-20020a17090305cf00b0019918520d2emr9280936plb.9.1677082166958; Wed, 22 Feb 2023 08:09:26 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:26 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Byron Marohn , Yipeng Wang Subject: [PATCH v10 04/22] efd: replace RTE_LOGTYPE_EFD with dynamic type Date: Wed, 22 Feb 2023 08:07:44 -0800 Message-Id: <20230222160802.123611-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124362 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 0E5F541D40; Wed, 22 Feb 2023 17:09:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8ABDC4303F; Wed, 22 Feb 2023 17:09:37 +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 C5F7F43004 for ; Wed, 22 Feb 2023 17:09:28 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id e5so10344617plg.8 for ; Wed, 22 Feb 2023 08:09:28 -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=61SrSViEffNgPAyLZHlkc9jFldPCvzESumOZa3IPUAyKL7x2eaSWTn6wApRMrDg945 Wb8j/jNmk2kiJgtaH1HbmCgkRYriutG7eyoAJ4awmsXhgA3nJ1GfeQD4LFxrkprL6Fnh haE1vLrIRGFXRflYUx+iRg8EGtientz/IgeRUByPvz7i1eLrOJutkA9mfZfARRfT8KMk A+HzT0rT8GRY5y+CF+8gKsL8EeYfIqKEQtMC1ElCanpTGBIcUU35mx1hV+yyyvOxbuwb ZGS8dmseEYJaGztmpyqNYYDq6bajO/NE2kyseR7dF3SQFAtKfWGfK3OGma5oOn991kG4 v07A== 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=ZHEFCwwFnKjI3Fg6D+2CSvj98d/jyBYzjG9i4x2asw5Xgu8GkPP0T8viJeH0aoKrsC NVJpBkGftR22EYM2t5EZ4+t2Yk2Srxc85MfQGH7duR8m1dUWvM85Q05OiIbAqgs+qbta T5qMyVSt+MN/BeVYP3Rp5txtOF8aZQXXNVzLlEa4Oe1p8CCUN98xGtDxj0t1YDWfPdqi tPZuCyykH7oFZ8fbW+m7XesrTQG4K04s95xjEvwkrl/rCQJCAzZUP/VklAzhLp3U/wpt qWzjdTohxVs23gzWThDJFOoNuLwssC/She7ZPqjTeRndMyi2GkcX9iQL6QyO6K0S3Beg Nwdg== X-Gm-Message-State: AO0yUKWFRtl0bLUlNNktmG8HuD24X3eRw/aIbd8XlQZbxxyZDUyrTXnP QoDr2tqV4LBlLGY07BPi3SAeo5tr8z00jJolTDc= X-Google-Smtp-Source: AK7set/Eup/IWwMYs0Tuvvnh8wwhdYXbHzOh2PhkZ4pYHaO2xwMwoar5n3CXSUaIHL7PyxaZ/MBUKg== X-Received: by 2002:a05:6a20:d49b:b0:cb:bcbf:e032 with SMTP id im27-20020a056a20d49b00b000cbbcbfe032mr3070603pzb.30.1677082167967; Wed, 22 Feb 2023 08:09:27 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:27 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v10 05/22] mbuf: replace RTE_LOGTYPE_MBUF with dynamic type Date: Wed, 22 Feb 2023 08:07:45 -0800 Message-Id: <20230222160802.123611-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124363 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 2ECC041D40; Wed, 22 Feb 2023 17:09:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87C9343053; Wed, 22 Feb 2023 17:09:38 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 33B344301D for ; Wed, 22 Feb 2023 17:09:30 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id y2so5217585pjg.3 for ; Wed, 22 Feb 2023 08:09:29 -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=SEPKtjITarYqq5rINYHmIPPUnPM7dkloqT0sJawsn60UcThQZhIGc0T9pI6J/trBfD Tc92/SHAo3Qjx/xm39nmimBoTL+XakfBL9FpHkbdg2ZLClrLeLdFfPUsqYjF0n1Bm4Q3 rYZwB6NTp5Pk6jaCicyCtiX9sUXqWEUdaMJqMuUnG14a651WP1eVAizbhnUxo8JslAqV rTA3OVmJBkvwrTwpfZMfd9zz1CG9N3UKGg31SB7//6f5MkHCniEthLkE44f9G1lciLN7 X7ZSmfAcTaFEqo8mifIJCXCs+gAoih6cxWeKOezPJAXQSOp5M03gb59CaCs+YGKhCNOn +mYg== 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=g8K4FYAT7QHZ52k032uCSZdVicBh1JSRMS8NIbSi5ZCn2nWWpynpDplcFFqSBDm+SC 7aoxFmqz6ji7lkKAgCAnVC2iqt69ydGmbaHLYXQ8QfScPfyxeeu7oTNy2lbxaqxvUmho TmEwevPWsmf8pTd4luuCp0PM+Z/NZxcIjopgAV5q+6e1zEVgtkV63Ug9IJW0+I4RT1uq C3yoEcx1Ej5ZkUruZPr+VeOP+0RtpeWxm0Xm9w/GoboydO6gCjwTLHBT/duBXVWH4Rdb ibIlJE9ghwLgxtwe/EPlvaxCwA+LUnxc3q5YRf2AiEAyfiSG/1IH/DLKV7OfBMdZNyAC D4Xw== X-Gm-Message-State: AO0yUKWSe2agTTYWNo1/Y/b02ExGp7Dzx2mF/bweH3GZruw4FEoblRa7 plNq7aRhQGS0w7jaotbLop7CFTNGFxw2JQlxfTU= X-Google-Smtp-Source: AK7set8UXH/XIJ70LBUgB8g+KmZ6eYc3ZoluEYB9t4qj7/+rRTIr2F14ZRJazhB9llMU3t/vTw5ZAQ== X-Received: by 2002:a05:6a21:329c:b0:c7:2c6c:b37a with SMTP id yt28-20020a056a21329c00b000c72c6cb37amr11171968pzb.13.1677082168986; Wed, 22 Feb 2023 08:09:28 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:28 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH v10 06/22] acl: replace LOGTYPE_ACL with dynamic type Date: Wed, 22 Feb 2023 08:07:46 -0800 Message-Id: <20230222160802.123611-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124364 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 5492541D40; Wed, 22 Feb 2023 17:10:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 812E44305B; Wed, 22 Feb 2023 17:09:39 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id F24F24302F for ; Wed, 22 Feb 2023 17:09:30 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso9469525pjb.5 for ; Wed, 22 Feb 2023 08:09:30 -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=lnQCYg5L9hZ+8tIKsO3kdudsyVLZiL9S73eDeG5SrtjBrD2XMp2cn2A/wFWCE5Pik4 VhvtfNvUwJgE+tKChSY5e25Lo0x01oVAgki4mvajzYjh/AtFXBFxQoKENG2nssirAha6 ujfTi2Ye7kaqc1PGPQC1D13NICudQ6j/TjYoy1rHh8U8vagRu1y9Kme6sW4d6zteCCCC p60EioMFkkb8i0xkQcPzexPW9FqG27xXqarSlj4Do0ehEMGjEUjIP4YayI2u7484733f 3MgKN/JzsaKSEG9l1WgEbzRoHrthR7lOAlIMDGVHWThuPuQFbnnKqlCgYX/bo4Uk2FqF rB3g== 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=PqN/eQ+rbGbFcIyH0FuZymn5JoRaLQQAfxmJ+lbD0WR05Atdeu9ZMnW+/KGEo7LcBh rQ+N9Tx9pJvDSA9HpHe/xFzL/BqJ41N9XMSo6EcA46MhNDozbIV7DRiLjUSBVbH1lcsG Wnd4Y35jhGZ1EXWRT24LiRfcSjuk0jzeXgK1lq31KKYuotBpSRj0h95MWMiib3ezUvfa TG5or/uFVCpvxjjAUSvU4msFFQ96czeWSQ+pLVw70CaE4A7J1ZsRR7k9rJlIrRNfKnJq Lw+MNTr/j/JEBE21LAL9NPi23bp9PELVS8T0mlBfaCoglr7b81KdITPY0Gfw/opv/t2/ tAsA== X-Gm-Message-State: AO0yUKURaZ7Qmf+P4Xda7XLv/YZfeLF0yGcDE3UdFb6xCC2w7TTAyIrE n5ejKXSkM4nd//tbRFJ9OwJ4bmkaTHQlUo4mpE4= X-Google-Smtp-Source: AK7set8okKW+zDzc1V9uhOMP3ITzKSYecnnB6mfssdxZuMX6qPEjk3HXfSDolEaD2zzpawV3LL1FKg== X-Received: by 2002:a05:6a20:8e05:b0:bf:269e:9644 with SMTP id y5-20020a056a208e0500b000bf269e9644mr10427010pzj.45.1677082169884; Wed, 22 Feb 2023 08:09:29 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:29 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v10 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Date: Wed, 22 Feb 2023 08:07:47 -0800 Message-Id: <20230222160802.123611-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Acked-by: David Hunt --- 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 Wed Feb 22 16:07: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: 124365 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 8D1D241D40; Wed, 22 Feb 2023 17:10:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DD9043063; Wed, 22 Feb 2023 17:09:40 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id DF2A24303B for ; Wed, 22 Feb 2023 17:09:31 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id c1so9536202plg.4 for ; Wed, 22 Feb 2023 08:09:31 -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=70PEYa3Q8U1CBkQElySJC/pChA1cjBx/N2OIZOuPuJE/MlUf/XOwCnailIyVoyCXMk zLSq7501O9Rf9RN++EH8v5V+ztG5S7CWBQa/qXbqLMsc+g4lCOtt3hhJJGk//SbUi/z1 A613Cic4rRcOD4bzR56t/1xMo484hDdJ6CFODPWDBlgxy0NmEXMAMufejhSrY4Tmmr/R rZ9pH09USrf25LkY7Jq8dENx7R1RUVA/uBp6kO6xYywksDI8gpdEEaNszT59UW9FXU/7 mxPNWGsy1uJEdUU8kLKdcaVJvpaoozsCptEeW4ndqwV8RaOfkErDkASpotFm0Q8YQ08p kg+Q== 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=qD40TSv9+Q1zNDOcEvY5wDyyYw+K5LgqsHjPvcOO5k8vX1lz3HJWJKT4j3MxTAkArK o5nri+5lG80EJXoC0e+IrTDMnx8Nx8e/sP8bXIs51yYMoPsBwnHL4rWhKdd+h44FjTc2 rvmHp3JUkzCp1qvrN0GSrkwlkskCFLgJpAJWz65MIzC9Peui2zWN5bIAZ6YhY30Rtwxu 0gAE/tkTBzaXcWaMlm4cCmTVSv6Yw4t5ucBWWbohW8E6by/DATa5yHXXYBxq7dC0stqr WTDk1KEuD3felQ8k8Eo9kZ1K0i05aD56afrn1Ky6zMbyIUwPWFLOQpjBofVwKcZ03xxG oOAA== X-Gm-Message-State: AO0yUKUBVHgPdqrxN+XsrQ5w6iBQp3H2NWgZRokeGEPuXbUt8ovK7oH5 j5hsBvnj/9AOMQucWptd+YxbWcMa755T3hcgsDg= X-Google-Smtp-Source: AK7set9ra65OrqwyINrDstD34BH8Fh/oHOgkZ0NuzSTbKdPsTwcLDFShBlL7WfFP1n6sbNYw85WTQg== X-Received: by 2002:a05:6a20:8f10:b0:cb:a66b:3a88 with SMTP id b16-20020a056a208f1000b000cba66b3a88mr4822457pzk.1.1677082170858; Wed, 22 Feb 2023 08:09:30 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:30 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v10 08/22] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER Date: Wed, 22 Feb 2023 08:07:48 -0800 Message-Id: <20230222160802.123611-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Acked-by: David Hunt --- 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 Wed Feb 22 16:07: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: 124366 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 1FF8A41D40; Wed, 22 Feb 2023 17:10:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AABE14305E; Wed, 22 Feb 2023 17:09:41 +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 CB62C43014 for ; Wed, 22 Feb 2023 17:09:32 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id q11so9618765plx.5 for ; Wed, 22 Feb 2023 08:09:32 -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=mQzt32lkRUbgHrnrZdn2KYJIYTU21VGqnS+BDOQDKcxLmehvZTU2lw0jW3bMuukl0W busCg36wA+BH8nhPHQdlPlSd4RtvuShui+IgkDrWMKhs7OaWqQsR+ad/lo6DiXOQp1aw PFhyxH+kEy9IkFwS/gpGZe9Ald0bGJ18jCB60GiLBfhFNsKWYnPxQWGJgNOEE+fl+q2B rSEzHihFyheYrJ3lN52UUPWdrLd2EmNxJQGGAcuTbOai9GUtvk4fhw+QrN+yHCtguMLP SKoclb/J7Xtd0nIQosqW4y/aIR+TDj26GUTDK2jlheKMPyDJkCOQchwka6mei87YokMz R1ug== 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=OPh/LRYJbsBftszE74LRK2DPiLsHQf7DVw+2TbuU39dG09lERjUGmQ9rkcoSL07n0B V9x+efWeGAOnVtLKpM6WgUO/r2F/2S7pvYT0VaHc/js5rjQ4oourH8i6gt5S2WYFjSaL 5bo8rcn0h2GF1fHwy5MevkNagf7FBF5LFgsBPWAuSm927XGAcRMMo9MObjmknEudmDZL PdDQhDHEcahjG1JWv3vJjj2oShtBKlEHAwYrUV8+znNFqal8lrJmFDhV8zhNjqobyjua zLbIQLbjAFlH2fqZiVsUsMO0wxZ9uN+O8dULMJs9exbLitWXPdvFb0IPcCQJh19yg+wP aJnQ== X-Gm-Message-State: AO0yUKV5mvR6OpkN3pjf9kp6dmtq977/H5QnkRuhm81VChP2GmOG8Jrw xBikHzyZPzJf5PhJXLKv2cyMyT3J0SgUtyhosy8= X-Google-Smtp-Source: AK7set/RT6QToxj+nbHgjGBaEdNbxubVBCL7vexnn0R+i6v4BkLA2azaZDuKmpld9WzJMoHzYecHhQ== X-Received: by 2002:a05:6a20:6987:b0:c7:13bf:3fd0 with SMTP id t7-20020a056a20698700b000c713bf3fd0mr10052851pzk.25.1677082171788; Wed, 22 Feb 2023 08:09:31 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:31 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v10 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Date: Wed, 22 Feb 2023 08:07:49 -0800 Message-Id: <20230222160802.123611-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Acked-by: David Hunt --- 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 Wed Feb 22 16:07: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: 124367 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 C5D5E41D40; Wed, 22 Feb 2023 17:10:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D49F143073; Wed, 22 Feb 2023 17:09:42 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 8F38D43014 for ; Wed, 22 Feb 2023 17:09:33 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id il18-20020a17090b165200b0023127b2d602so8852538pjb.2 for ; Wed, 22 Feb 2023 08:09:33 -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=LDR+VtkPSxsa10EZxdgOn56U1tROfaBp0SoKFr/kqLIV+ayP6SJAUvwB+Kq7OiszAm SKXl+LDU2bpeRqxRTFmYTQ+CW7doVFeJa4V0uT6W4eBfh7/9w9VBXSp8yQQQB+DvPM3c 1LVkj8Htd1ruDbKv0vQya9ntq5ojO0EoXDD5wBDwH+6dKOHTFT4KCseftVIqLcReRpcZ 4uYgkOy6c4bA/jUDVhtyQpdlQjMxDh5tYhncZVO/+kIUX5ExCPT+o52lxCnLvuR9QEec XjlGz3UpTOz5nJ3RPVKbtlDRpuNuY+qBXVS4QaIBLsnlCJUz6P2ND4eJ0e1Ws12TgNXJ VQqA== 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=3UPi4Vpo1ZmvdKAVMDiCjJqbcAS5w30aiznoemCn6s07sicejIcpW+gFkOrPquoLdT 7R+yjVnh/2EJJYMi14s/ZgvYvSFuGjGcK4OQ/ZKoKH7rgpjfMsA++oKcjp9pq+1S8Wlr d8z25/K0xU7uZ66vSzENirqMA25h4iC1Ittl592J79PnjjyqJdh6LTLu8Ace50DZm8BI ve/meM/o4/wc5kN19uIy9LBLc5BNYnnixsvfUQQRsA4n85YGqfBMx5sRYVjiVgWjTeiS q7kR/aPW16mHh9mx+AK3JVjPB5eehCKMMxa63XHjMkGwJpt71gNaM/Q1Mw9WJSEmG3uW gPrA== X-Gm-Message-State: AO0yUKU1+/cnBao3oDZ8aVKri5KsdFdtLPEz12L+mwVSuggpQ2IFNx1H 0YrsEury702biSY1RCbP7dtga6gPrdDlF6q9wRY= X-Google-Smtp-Source: AK7set9nGjCgLqxgpZG8hSqJx/O43is/xXpCPtWUXAb2lvCvDuJMd5nToyOSSrpxBuF0Ut2PwQ3ZDQ== X-Received: by 2002:a05:6a20:a111:b0:c7:5f49:8d0e with SMTP id q17-20020a056a20a11100b000c75f498d0emr10348211pzk.36.1677082172753; Wed, 22 Feb 2023 08:09:32 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:32 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v10 10/22] ring: replace RTE_LOGTYPE_RING with dynamic type Date: Wed, 22 Feb 2023 08:07:50 -0800 Message-Id: <20230222160802.123611-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124368 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 183FC41D40; Wed, 22 Feb 2023 17:10:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E4F794307E; Wed, 22 Feb 2023 17:09:43 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 2F20D40689 for ; Wed, 22 Feb 2023 17:09:35 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id z2so9437425plf.12 for ; Wed, 22 Feb 2023 08:09:35 -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=1hyWcbxsEh5X34kjp8cclxtt0dKamZVhef9QyJ2uvH0xwoq+GpaCHUr6iBTE3q5OwH R8JX5T3Jz78CQQaXC4TFPNG9OX552MJ7Bx6i0lhu787YkSU4mw2QXCoj6t8NU+qsxC75 8QbjOSoHPXjsxz1XzySejCArJV9sxQGUcvYmoZBvCBEMlZAaT/NSemyZZ+irO1ncz9zS VAl6gxpcZkrCLL5h5//I6txKBI+RzHoRa5279GCv9kq4EqDeLN82H/C/fs87fEhHbeNV f0JC5nhFx+j6w5CgLGh6oYAA16p1I9y7t7gvFcmaNmHFoFGNcVP5K8AMx5txap+7mNcp QuVg== 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=Qgi9W/m5+APDqUiI8EnSAEwWpgEE0aWhU4CfezhqyxNCNl9GnTrTfapWGwZQmSWNp4 RKJZ4qRoswGwknddlVXx+MDBhq4mixbbsSOrSlW4ervBQAXtOE6KZfkiVsbwFOFaC17M n6EiByt8SSbaq5fGk7bWqaQjuIZgRpGr6QjCn6qsFdcJPdrOAFNc8vu+GR2Y+6LzUc2a +uwsUBgM0571J2mcFw7BSF3renXFaSgDG45r3rjlw6SfDHEff93zH4Kb1A3mRnICBpoB BwiQcB3d/uwVDtmitltC1R+ghVDgUViTwy0FqcgQ3a3nVQWqqUoD5Cu7YQk7c7gh32XT b5Rw== X-Gm-Message-State: AO0yUKXTqYoRA8caVoDebOFuvt4aqRjawiU8xnkaVxYiKnyM9ky6hWPu +gVVhJlm624sJC5GJleOQwscWG77Z31nSs/lJ/o= X-Google-Smtp-Source: AK7set8EliEVElMocevpcgn+omqmZzINgk82b9Ct5kJh7N4YXgl8KTNVOXl0qENXnRB/TcA7TOHEHg== X-Received: by 2002:a05:6a20:3a96:b0:c0:1faa:9b69 with SMTP id d22-20020a056a203a9600b000c01faa9b69mr616330pzh.58.1677082173790; Wed, 22 Feb 2023 08:09:33 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v10 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Wed, 22 Feb 2023 08:07:51 -0800 Message-Id: <20230222160802.123611-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124369 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 7743A41D40; Wed, 22 Feb 2023 17:10:42 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0942E43086; Wed, 22 Feb 2023 17:09:45 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 1A22E43039 for ; Wed, 22 Feb 2023 17:09:36 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id d1-20020a17090a3b0100b00229ca6a4636so9588246pjc.0 for ; Wed, 22 Feb 2023 08:09:36 -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=NhnkV+SzdYCWdNFUTKYOgQEzVyTa17g+mZttAf/8D2l7YLBUjlyVCBamDoaMvwXrq2 mmRbIWvu/CzasrlQ/OG/l+pX7teVyTjgiUgvfCgfHk2+jxkZDrqHjBBCGIsFIPfbG3PW Nclw5qBrN8L4iHr8vpTHUHl1X+OcRgi0d37sQqGI+AhiHBhQsJiDbs2f38alkGZdi/Lx RJq9I9uDgFXI96JuWr+GC3MpRbtzT7p/XBqVDe26Ijp8N1UMG/qu7cyENtANabQgzoDs CFFxn6eqc7QrrnKQQbuM508mFvm2wBQIk40bpc0Rft3j2UaENnsQ0aPp9mB1KrFyEQp/ bJ4g== 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=Yi9z/1F1qW1Peyfb29XA2JvO1+UpKIUshvIHr6UJv4myBvFokqiIQIlTykqkyvyMPG qBf1VPo2p/2JCINJDNFanRX4+kT6k9dt4Sful9lgvQuJx7xkheowJ/jkdmcIRWKQp/oY EWGFN6htwzDjCer91hpk8N6YmW0+1QXvWHodhPxEq5dI3ont5rBJ+PYogcGzjLpDPoZg tCPMe+hwudVGg4n8X3DvhizjI54FNjvEenaBIBHo62g0JBUlecRdMmpSbqF165YM/2xC yWmToYl8Vs9F0H1p7OOpYs7UUlY6hjcDmcUa4DhPqfYRDotPjCexoRlgsAXHPQnuZSPm HKeQ== X-Gm-Message-State: AO0yUKWOroUwZaZxSOa2fiRb7x1Zhc4oANZb+VCI7H4AiF91Qmb1pmxI lVClj83IgP/orre6UKQezh5ZbKmj8CZH2eZnmCM= X-Google-Smtp-Source: AK7set/hAqQYT4fS0IUjahTuKsFJ+gmIgOdK8lWzGEWGO4P/chIKYjfHuFA19pNSanQf0li1G1QKxA== X-Received: by 2002:a05:6a20:12c7:b0:cb:2727:4780 with SMTP id v7-20020a056a2012c700b000cb27274780mr12100371pzg.59.1677082175008; Wed, 22 Feb 2023 08:09:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Bruce Richardson Subject: [PATCH v10 12/22] lpm: replace RTE_LOGTYPE_LPM with dynamic types Date: Wed, 22 Feb 2023 08:07:52 -0800 Message-Id: <20230222160802.123611-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124370 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 CEEFF41D40; Wed, 22 Feb 2023 17:10:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8EB5543090; Wed, 22 Feb 2023 17:09:56 +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 C52BB43021 for ; Wed, 22 Feb 2023 17:09:36 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id q11so9619068plx.5 for ; Wed, 22 Feb 2023 08:09:36 -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=IjkWZ/6HZzSf/ZKrmMw7HtgfgOK6WCsCWpmGJYjD5915YMLlNwATyvSoBBuD+3Kp9C BoljxZzA92pw0N+O31jtaUXiH+z/8WHdb8Qr9nsLIPSVulWbIcBFkE8jGlbAohM/v/FS Ah9DSI1Itejbax34EvZkKLmi9tg8WQlasySnlxfu3Z3q/7zGZ+fBqTm7NJawhQeO0oFL +ISE95nSFOnKlwulAXNLAChc7idHXUi7IfM2tFNxeWc41A6DS/lvHXQOeDYmmUd/oMzh X2L71DoZqkXlL+igZDgJeR1ubk3YgcXBUmNvNZJfNgO2r+Nf2Z4YUxy9sWXj8fkUSBaI vh3A== 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=Jo48JLEAEdbwd/ZXpCzEURsA82fZEeL4+6I986ZjaWYwK3WDPEUKIjsRUPIIQMmnfO MjEzgtJveCuZ/RwD3IZp8LTbnYoeuAB06d5CUM49R1qD/FcVcvsTeFDbNiWC9UzNGpV0 om8AVKlWw8Im7TrgTPgFXi8sgqeFczHXpBXf1kVGIT7BRmaGJAa2vpHqixvnVs34PLvN PA+6LFz1on2WoA2+vDhNOlNPO2nYIOwbTWjld8fuDyVkaRH9VcFRGddJCKdUniPfGdUf dP9/AaHH6TcKGVZnyyGY7R93Zor820zqgoLEDqlHVhvgutjsEmFZh0BJuSmfySklLcIr LVWw== X-Gm-Message-State: AO0yUKXwRKfT5uCnBf+Sd5Z1m/MGVqIpVUlovVHH7gm6y/Piivb+j4aS Q5J4sGJX4Ii7GxTvtor6bkPhgtM/qalv+TrHXsg= X-Google-Smtp-Source: AK7set+jKsB8VWZz7qtBF8pMU5gnPdtbjEr/X6La1u889y1vQgkGb6QECz7HrakEUZI7cyICB3FXBw== X-Received: by 2002:a17:90b:38cb:b0:236:7416:7588 with SMTP id nn11-20020a17090b38cb00b0023674167588mr10377490pjb.25.1677082175975; Wed, 22 Feb 2023 08:09:35 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:35 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v10 13/22] kni: replace RTE_LOGTYPE_KNI with dynamic type Date: Wed, 22 Feb 2023 08:07:53 -0800 Message-Id: <20230222160802.123611-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124371 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 13DE641D40; Wed, 22 Feb 2023 17:11:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC006430A1; Wed, 22 Feb 2023 17:09:57 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id E02A943047 for ; Wed, 22 Feb 2023 17:09:37 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id i10so384208plr.9 for ; Wed, 22 Feb 2023 08:09:37 -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=jHW4LDceohDBZ6BCPM97TeoSZWJeSp0NgXsj2Hz9/p/R+5u+cs3UMans0+Q+iUO/uP l0S5fhIvFfrRt1bk6LFOHC8dsYJd1UuzTUGgGbWOjx1neXbTc5vQ8euqynEijhPoc/7t cEf+NIbHJdXIOm3E1M3fhGSSYk1STb3J8OscqQ9JtZh923ef0W3gGkQvbrGCfK+8anmc m3nXZwyzWAX2cmVGKLVUQ8+2kDTMz7gW1LvD0H4JB6Rsxa7vMqDHDYqvXTEbEF1f9BHv wu0+fpzoAuAF2wg6R2MKPHW0wduzX5wx9dtRgxmh1RAiuREw9TtaLuLCiPnMfK13SiZV xmug== 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=dxIpuTJNQr3Hem0vyQylIHQIDzcmZxQKCemnxD531fV9jk0WpCADN3CwrAlGPacfvf D580IB6C9JZ2u46ZrvK/nnVbej9TCvYQbc5spZM1biCYrPnecSzs5ClwFm5cVrhio+58 iO3kVKxZu56tFW75acwr0saaetZjK8y6OMfq2OukiuiXmc1qWwE8zHTkNS/UqOetxDvn wR5n3WnJBkegJQTlMNtEyAvZWz0B+93VVGPx9m2SCbOg8/JplPc8c9w+uouE2SJR35cS 6kKvv/XFRVrP0CySj9h6U1gvXmZbLRNpC/w6GbQaYf2F8/sRGnnPmKekLJBRG6eILzD1 Nnkg== X-Gm-Message-State: AO0yUKX/fVeJ5dhImFH37D9LH6/4RG2BOz9tejkdS9P5s+A5r2mLtw2q DvvyRdsn6kZE7vXofwqC8eA764g5nj2cJd5Fw6w= X-Google-Smtp-Source: AK7set/F1aVY7Pkvn8MyzQCs+21rpU2l1Wex10uHR52otJkcglQiB36Jr+VO1YFB3nwXvWiFOZHgFg== X-Received: by 2002:a05:6a20:3d1c:b0:cb:c276:5892 with SMTP id y28-20020a056a203d1c00b000cbc2765892mr3572785pzi.8.1677082176882; Wed, 22 Feb 2023 08:09:36 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v10 14/22] sched: replace RTE_LOGTYPE_SCHED with dynamic type Date: Wed, 22 Feb 2023 08:07:54 -0800 Message-Id: <20230222160802.123611-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124372 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 CECEB41D40; Wed, 22 Feb 2023 17:11:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 169FA430B5; Wed, 22 Feb 2023 17:09:59 +0100 (CET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id A112043056 for ; Wed, 22 Feb 2023 17:09:38 +0100 (CET) Received: by mail-pl1-f178.google.com with SMTP id i10so384281plr.9 for ; Wed, 22 Feb 2023 08:09:38 -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=zlpEUyUD9dpt/sDDip1P6d7FnmLU8yWs6o8eESEj7/H7PQQf9X5ihp9QrV/IxENENr YvWhyc4vbYVOxF6KwPe7njyr4dmDxNXPBhcic6aH3jaqGB1NILu6Lk1dtCHGO/scbKix bcLb6KFJx5mKJFlu0oO1IErFJsjUZqNvUECvw4bMp2RPd5aMBZmFJBrFd2i81Pa9PzvE GAMpQ9NaCbcQdaEYbxMh6urKXqVhXSl7Wzx1rWoicRGXXDuvEUjX+qiQ/zt+iDT/GoAu QY/CpRBm5+wRJYb9ULXydNhMzuf1vAriK8fKsR8O6U/hkNXW3+t7gyj9n69ciJ645TsO jezw== 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=iGkDIoeDnnOVh+atlwzvGlXqEsjqbkIDNFcO3SVsnT6hikt67/WPa3FsqkDsoqDTRb qtNNXVgokLOOZTOXlwYKqgmv1QXSvLEZchyztO+af6NNajZainiKm8iLDnS9oVrEO5Xb bog+rK31ki5UMmVEeZHpYiGja7i1EE54twKS3/PtQI2tuy0Z4R3ZCNv0/ITuH+kUpGEC CJgXhI1ANwwK7gISCnX69UaZ8qj+eNRvcRzEiEp54L6nzuMXqSwgxsNPRCRbpwsAoal+ oTVCrLx0L1WSJL6AF7OqOCC8LO1wos0rdjPz5oAmUd3FvYCSipoQprGkdkJj1nGxVJ1Z ZCMg== X-Gm-Message-State: AO0yUKWSeFTIpiQhQ9D064CJN3pvJSbNH+7ZkU5rHc+dJnmASmH9zgkw 3vuEFj1/vWm421XuQAxVKReihHDo316JpBee1mc= X-Google-Smtp-Source: AK7set9ZxEYIfHd1B2xazs1F53HGadzvCOtuQ8y8/eEDX8VGdCBAYEqZzmwpwwGDClX4kRNchlgXMw== X-Received: by 2002:a17:90b:4f4e:b0:22b:fd64:c48e with SMTP id pj14-20020a17090b4f4e00b0022bfd64c48emr8001132pjb.14.1677082177809; Wed, 22 Feb 2023 08:09:37 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:37 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , akhil.goyal@nxp.com, Radu Nicolau , Akhil Goyal , Boris Pismenny , Aviad Yehezkel , Declan Doherty Subject: [PATCH v10 15/22] examples/ipsecgw: replace RTE_LOGTYPE_PORT Date: Wed, 22 Feb 2023 08:07:55 -0800 Message-Id: <20230222160802.123611-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07: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: 124373 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 13BEF41D40; Wed, 22 Feb 2023 17:11:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 29641430A7; Wed, 22 Feb 2023 17:10:00 +0100 (CET) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 9E5764305E for ; Wed, 22 Feb 2023 17:09:39 +0100 (CET) Received: by mail-pl1-f182.google.com with SMTP id z2so9437770plf.12 for ; Wed, 22 Feb 2023 08:09:39 -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=adJCoZHgQy4pO/L+FLZBsZJ6b6HNDC7c2Ez+63UHPlZ+Kynb7qHUbJjgdFNHK31u55 dFCJGFy0gt3WUr98QutUL85VfUcfHN48Xx9nDpY3Ajwp2UgL64jKbg1f5YzZ7u6Qglep KkFuRH1kwjipI0Fh5Kb4sfwTYBfq2w1I3yOLBaP8scZNhQ8/xeKnMLsLYBAnfSOFE2RC mwm0FpbF2lQDD2XShWApVNdUDksDm+Ej5Hg0e5epffVGsY8tq02Fv81a0wtHY+r4sTXW IlJwfnoSXYD95U8a/lnCL1fDDZwnQ+zRxZP2aGtIQoz66wdE8LA919DFaWpAtt6sBYtA oTZg== 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=x4bYjV7ivbj5BJkwTz/GqSZySnsjbdw6dM9K+oFdBRK8UvzVYMTv0YFJQ5TUcPz7oe HDom+PPctjR73Qm30C9NIQ4PevSb++12Nfpkkwb5LV5OkQXeDbskMf22yJVJUq6bX+cl XTGFfHGE/pTH2Q64YV3S7On1QUUlRQ8x9x1I9E0HmxczfDP100LaxQrwgQnaMaos8eiB qTy8XTAdoy77RWccOADkAdhG5wkN55c5vNkKU7tqM00Bd4Opb44LumPSAhQ8GQGxGsbx /S2wi/70JjUvl1xshL+SkQcx8/xf9fW0onvJMNYUmzCJ74RHooG6IO4U8JA8OlosHIGo TUiQ== X-Gm-Message-State: AO0yUKUX5RxJsLZ0HYMOoX+kCsB5ssP44EKmh5R+WZ4l42YyJ9enq1zr 8eD0awWsmZjBvWPx/EEHBkB1xZjwT74ojERW7RE= X-Google-Smtp-Source: AK7set+E2lyBaPIoGoDL4ef2MkVb3wcZ45VoPNQqyL9ETtlcAlou/eWUVRl/fb3eXXdQwqi7tYyn2g== X-Received: by 2002:a17:90a:de94:b0:233:f772:1144 with SMTP id n20-20020a17090ade9400b00233f7721144mr8063615pjv.12.1677082178840; Wed, 22 Feb 2023 08:09:38 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:38 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v10 16/22] port: replace RTE_LOGTYPE_PORT with dynamic type Date: Wed, 22 Feb 2023 08:07:56 -0800 Message-Id: <20230222160802.123611-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124374 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 C353141D40; Wed, 22 Feb 2023 17:11:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 455BC430B1; Wed, 22 Feb 2023 17:10:01 +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 E2CAD4305E for ; Wed, 22 Feb 2023 17:09:40 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id s5so9220794plg.0 for ; Wed, 22 Feb 2023 08:09:40 -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=2LgAWuUujnsT6QyoZ1/4kAOxfahiz9G4OaGEGZn7QvF7Vklr6o1hlkWgTS2Q8sr0ts w+0jE4AO//xC9bO7crL3ROq6/v/zbIrewbGMDGU5eEnPtvl51QQdu5JmQEBiuslbxM81 S3cgeuStyNzciN6r13lR1Iki1WldFyungMAnHix09T9XyhZ8Q4LUIejSImUR/SnRiuTD F1JW/OxQK+YcX9KwwG86G9b6l/Csgmy8cCFu2IAEbqw714YpSHMSrv5uSGVVMxQmxAKO deCqN0Ivnq96m/QbGRgXsuOrI5OttkSXbHydLxD3OJG2BebHM7+nL3xFct2xSWe/4hGz MsIg== 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=dzfCak1hvNC6eQc1R3jGjNLxKdaALmpX00dys0XOHp8ocofpYjGlpwHwTZz/N0JJ0G F5nMQcZNvUPPW5JXYuExDpDDffaEYXBm2W1OPC7KRrFxRrRQpvT9EbRKNgDMf6wm2w6Z 9X87Hmfv+qzoWpLNLO0xjmESiUsfTyXjdU/JqqIskppsBnpFj65Jaoolqw88oeiqn8XA b9Mo2g7t04G9XiPwsNaAG2VakQJ5X74LF8PkymU01qcNXTUjlnUSB8iucrXZ8K8AIq6K meBjTkLIhfSa9zWR5nzJaL9FO7hVr7q+ugVsRYHJAlQ8Wbc5Fs5zgT6oMFaJc6jonE6p x2CQ== X-Gm-Message-State: AO0yUKXIfuy0nONba/IVB2KX5LdeSdSpGxN08IDjd1dsUFTMtUlKpcN/ thnq3dmHusEe3xoeyMMr3sKYFhI4AVACvWo/hq0= X-Google-Smtp-Source: AK7set+BpRLItBbxtzmi2U8gdzuYeeE4+HGNU5B6yPrl5GTE1mLtSAFFL5PQ2GTnpKvEOpRMAMCZbA== X-Received: by 2002:a05:6a20:429a:b0:c0:c9b8:64 with SMTP id o26-20020a056a20429a00b000c0c9b80064mr11323031pzj.17.1677082179881; Wed, 22 Feb 2023 08:09:39 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:39 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v10 17/22] table: convert RTE_LOGTYPE_TABLE to dynamic logtype Date: Wed, 22 Feb 2023 08:07:57 -0800 Message-Id: <20230222160802.123611-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124375 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 B980641D40; Wed, 22 Feb 2023 17:11:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 382AB430C1; Wed, 22 Feb 2023 17:10:02 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id B3E664306A for ; Wed, 22 Feb 2023 17:09:41 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id nw10-20020a17090b254a00b00233d7314c1cso9470177pjb.5 for ; Wed, 22 Feb 2023 08:09:41 -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=BTO9ANZcLsOBSH5GDgc+foxTpPpahlGlckIQEHkTwk4IHAw4iwxvOcN8MK5eWiFzDP RPLi6YoHM5BPWN0jlbhVDioyYzulv1+fwUSD4tosCotcP7WFlNxtDjE3jp66KhubAXP7 f6mWx0/sIB3cG5LBCxwGkr3dE6Bv6YlxIHFmSaH3PWkbfW4eCwpogilyAK8sImgoqxRu l17BOhk6Pcuxdh83AdJB2AD2AbJUoJtJxQtFCh4FFZXy+swc5pSzxDcW3mGY/89BzkvS TImGfqFiC03tKHED6a/YGPegfqjlvEMtUcPzfioUppgJVQ/vK4hrxA3HFGPvXwP/1rNn 7kuA== 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=b7tkH9hoi5GGyyHDdFQWpeHWir7urt4F3tySSXq7H/zoGBaA6Bh7SdbzVwnmQ9Etmn BMSeFXymExQU55Oiq6ATnntUwFWItpfdVp7IdYfNNkdBvxpKLMdLvilALH+hGvMzH0Di hMlruFvH/2/E17+JvTAkAdwFryZ+XJINW26NZIqa9HEzEXuqVHXnRiLM3R6L4or4dLER JNukk9bKb+DawVWzWtaG3E+TjNPJlnF+yQAiTDDFrVC0P7Zfi9VtIzKYL3O2d0IfziEr VBYsc3ksm/LV4tx+ez4LJdDt5PKXiN8HzCt2L3m/DWiADS4WC3U4SFKt6Rh3UOmNmU6E 9jBw== X-Gm-Message-State: AO0yUKWFM48klrvhbdEYX+2rtj5aHnBWq2qHYYfd1OOyJUU8jBY909bS m0Vk6N/ffzDHBGOaqo2v3WXjscbh1yop1vZMbtc= X-Google-Smtp-Source: AK7set9DmE/buNfx4Al9/EW3sF4yy0ezXDCJezvEdwhuzJLrn9ISB4z1dezCGoEd+Lb8uN1zug7uVg== X-Received: by 2002:a05:6a20:1610:b0:be:bfdc:621a with SMTP id l16-20020a056a20161000b000bebfdc621amr6551889pzj.30.1677082180885; Wed, 22 Feb 2023 08:09:40 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:40 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v10 18/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Date: Wed, 22 Feb 2023 08:07:58 -0800 Message-Id: <20230222160802.123611-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:07:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124376 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 CCA9641D40; Wed, 22 Feb 2023 17:11:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 38143430C8; Wed, 22 Feb 2023 17:10:03 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 7C7E64306D for ; Wed, 22 Feb 2023 17:09:42 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id d1-20020a17090a3b0100b00229ca6a4636so9588659pjc.0 for ; Wed, 22 Feb 2023 08:09:42 -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=TYBXfm7QciFW6NcIR/mC9WaXqUCDLDgZIALFG/HjA5mjxTawWk+MCaFNqY/alt937c Agr1jc5gNqRG+rYY7L+CCRO8TtI3xALmJ4BN8Ib7dK4VrIj3EHsqmaq+qp8YCtIUr5r7 OVg97MGjKOxNYc7RqAMZ/5uYO0tla5wiiEndZk8TBfZdtC1M/yZGln14M0LjelabGjS0 LnHUM6Sk9/4Dz4aoFmcGqqpcugb6Y+uHuhJj13VRPhdD2+c7pB/lAQPcVBATOwSsY7Zl BSR0eP/OzC5mRfeJsVP9Vi1pUmOv6tyrtO3QQqz89SX60tBCeurZXG0U8twTv41RMbnO L9Kg== 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=YvizF+d8LWfHVGnilGsXbJCmayq9LRQ+7gWVj9cdBCKyD/iTCxw+ae5TiIUcVvpqUM AUDWFMji+raAzW/hPK6jbNfOww+sABmGPJInIpiguJWPT6yqo+OFZ7q7XOoMIeYNi63d PHQMvJuvdRrUt+FZuWoSTeiPrSYBJFB2R4rEyjfhsgmU5R8dx/LXBUOg1zKjrJDQ9+Di 8DCQcT616xwGETRt0Q5XevsSk+3rRyJuRqlzZTwcdAyaK4Uhmxs32NoJujaDYWdDpMIc zM1q69arYEsbme8pqsfP5h3w5XBycfMJPcoX8NH8q84LaxUEO9h4iKtmH1Ya92K//62V LLag== X-Gm-Message-State: AO0yUKW7imNa698FUfHbJjPDwDbq4cqch2IxDcMBAwU2D1vwc5lJydzO IrYgutV12w/aLq+h5aQeAXI3fzGD7458JG5WLyA= X-Google-Smtp-Source: AK7set8wh5uLkMQGKiq+bXDC8r/2t5CHQgMR5PHsyumcWQEgWHPk5/9dbaTgxY+qtuDzSDLSScyHFA== X-Received: by 2002:a05:6a21:78a9:b0:c6:bd82:ea2d with SMTP id bf41-20020a056a2178a900b000c6bd82ea2dmr2141331pzc.2.1677082181775; Wed, 22 Feb 2023 08:09:41 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:41 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v10 19/22] pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type Date: Wed, 22 Feb 2023 08:07:59 -0800 Message-Id: <20230222160802.123611-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 Wed Feb 22 16:08:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124377 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 F232E41D40; Wed, 22 Feb 2023 17:11:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30EAF430D2; Wed, 22 Feb 2023 17:10:04 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id D0A834307A for ; Wed, 22 Feb 2023 17:09:43 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id na9-20020a17090b4c0900b0023058bbd7b2so8741455pjb.0 for ; Wed, 22 Feb 2023 08:09:43 -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=SIqnAYH5CnL4aLL96hZvzGaDP7pcxQN9wVO8q+PZWgs=; b=jicfETHiE6Vb3XrTPagWQiM7yb5Ceejwy7hQ9O/zR3PfDOInkWoUWI63Bt7Ukj0rUQ 4sQmdJTUPsea/+K8+GcYq1ycs639jfzQeeWWS3bTAx4KHjZekGuHIy7UoGBheDI/shS4 +VBo1qNWEuF9e/WePMq4lSpDoKSHVGGvoFCoETU8zvZRiNc53IXwdzu0krkc5WbJc5hN iWNJ/9fI8x0bDHEjKSzg0UdEKMek1Rlh3jyOJfUTyhxq+Krq9VPuipYn6TEz2FW9WZ20 tasqh3UfMUPZbI2rdiQtTSg7cEopijU9uYaBRRG4DWlk4s5CNCLz7zEkWSfZWSHhkkQ0 ZXnA== 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=SIqnAYH5CnL4aLL96hZvzGaDP7pcxQN9wVO8q+PZWgs=; b=1jUho+VGcl8wAYsta7dOtUaW3jzM64LK+lBHnHv9F9VPq5KvL0iL3+2kHxpihXwRjd mCYaZE/akhR5LFh8bR+TAmWZgXrraT+rrABCp7m7OhL9/zj8sSj+nTXxGYKFdCUDGUF1 NRNOGFJW/GsckzOCUbgqgaVEleHRebGgjOw6TPBc4SWUjTyUNsxjQX14qxAILCTZCX7o gl5Tl0yfT2a7ziloGTBaB4VvkpNGvyeOXNsMVaY12dIl551IDO2VnUB+wsIcm5cfqroG HsWcLW6lR0B6RTUneID2iH9RAwKJVJSxpUzgB5n/O/GPdYkQ3haavHvm3Zpj6PPQ2zX4 fy6w== X-Gm-Message-State: AO0yUKVE4kXwt6SLEvpmxuW+cAUwwaW8o1tvFMM3msuQkCXjt9ddVl/J 1DAbUBoQFZAugbUYwgckYDN8LySfLgHIQPybX9w= X-Google-Smtp-Source: AK7set9kzEbj1qeUDwgnX4SOgil9bDLEYFXthhYJefIXL0krzDTGRNh7gt5ZfQuGeSSCJOQB5/5z3Q== X-Received: by 2002:a05:6a20:4b0f:b0:bf:e6c:758b with SMTP id fp15-20020a056a204b0f00b000bf0e6c758bmr1349180pzb.4.1677082182735; Wed, 22 Feb 2023 08:09:42 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:42 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v10 20/22] hash: move rte_thash_gfni stubs out of header file Date: Wed, 22 Feb 2023 08:08:00 -0800 Message-Id: <20230222160802.123611-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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 | 47 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 29 +++++------------------- lib/hash/version.map | 4 ++++ 4 files changed, 64 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..eb334185725c --- /dev/null +++ b/lib/hash/rte_thash_gfni.c @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ + +#include + +#include +#include +#include + +#ifndef RTE_THASH_GFNI_DEFINED + +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; +} + +#endif diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h index ef90faa302d1..6127f5533873 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,16 +9,12 @@ extern "C" { #endif -#include -#include - #ifdef RTE_ARCH_X86 - #include - #endif #ifndef RTE_THASH_GFNI_DEFINED +#include /** * Calculate Toeplitz hash. @@ -38,13 +34,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 +58,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 Wed Feb 22 16:08:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124378 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 1EAB941D40; Wed, 22 Feb 2023 17:11:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C139430DE; Wed, 22 Feb 2023 17:10:05 +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 D36E943081 for ; Wed, 22 Feb 2023 17:09:44 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id h14so9427299plf.10 for ; Wed, 22 Feb 2023 08:09:44 -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=GitZHPeiGQMbREJXnS9cG6XPy9QIZPeOSCwkUvQt984=; b=F72V82VBYVZ0JeBoswBNFiJS+I4EqPQvZ+c0blFJmNYi4fhGH9LTJ1u54fiHbwpot4 d/aQ34FLIlJbDUgg3l/gt8TVefgT+HIHBiZgO7dk8Og4BwoERQRUvSnbezQI8SghdrVn S4vNRWqjW9kAC8S8oI1pRFuk96oJ/t0OUD4W2sOtAgeqwJbgpSTmca9CX/1RGsQWkI+N i4bjC6DfLkQacKmAe/DsJZnft7w5b3YHPMHCc4ZvkQcI/Sz3hGsfdhm3vR28U1ZSeo4+ LGFuiBOzdpeZ3TNPn6svw1Lghpr0pYJeRq243on8T/Ld0A59HtKopDfUF1+b9n6qg+q3 Xndg== 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=GitZHPeiGQMbREJXnS9cG6XPy9QIZPeOSCwkUvQt984=; b=SXns0hRNy8aWSTteFTw9DkGkndrKoLTrMRPONsL5Q7Wf8sto80z6vYg8Fwr+xgxaJN SBsYEvvMnLuSIYBQaonRJxAw9nFxKml5fCtuSyMhxwuKIlgvoict8tw01tfL+WkwO1AX ZWmcOQjB1oKI5BITxX9nS7Ttib/UyukhVCIDUXWgaCqhFC3jEPwO6a6rBJPWUrZ20+n3 nChufwIW7Klmdku5Ku/fKR+IQmPl+HgSKAQEG5GD8zewORKiZzBGWcEuS0UbEZVfLY+W u2a+auOypoGLLLaFpnMaix2Xr8uGCISJZNw0hAzbcQl8UEFQcWIAVn7CoPSNv0KpjrG4 fofA== X-Gm-Message-State: AO0yUKX6pGGKHbD0BumUlPMyUoKZ7ACvl8NwgJEF2WA6rohkwCz7Pr0Z JskTlQLpkp9tV1zdcmOJLm7ZiQvFWqfSWkKz5ZQ= X-Google-Smtp-Source: AK7set+WCYWd9m9EYmgwf9/uzJeB/ySkljlVh4B7rM8tdXwBie8s4oK9RT1AMNCPqvpl1EeLyoMBHg== X-Received: by 2002:a05:6a20:244d:b0:c3:18f8:6c53 with SMTP id t13-20020a056a20244d00b000c318f86c53mr679969pzc.38.1677082183768; Wed, 22 Feb 2023 08:09:43 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:43 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin , Ruifeng Wang Subject: [PATCH v10 21/22] hash: move rte_hash_set_alg out header Date: Wed, 22 Feb 2023 08:08:01 -0800 Message-Id: <20230222160802.123611-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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_crc_arm64.h | 8 ++--- lib/hash/rte_crc_x86.h | 10 +++--- lib/hash/rte_hash_crc.c | 68 ++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 48 ++-------------------------- lib/hash/version.map | 7 +++++ 6 files changed, 88 insertions(+), 54 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_crc_arm64.h b/lib/hash/rte_crc_arm64.h index c9f52510871b..414fe065caa8 100644 --- a/lib/hash/rte_crc_arm64.h +++ b/lib/hash/rte_crc_arm64.h @@ -53,7 +53,7 @@ crc32c_arm64_u64(uint64_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_1byte(uint8_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_ARM64)) + if (likely(rte_hash_crc32_alg & CRC32_ARM64)) return crc32c_arm64_u8(data, init_val); return crc32c_1byte(data, init_val); @@ -67,7 +67,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_2byte(uint16_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_ARM64)) + if (likely(rte_hash_crc32_alg & CRC32_ARM64)) return crc32c_arm64_u16(data, init_val); return crc32c_2bytes(data, init_val); @@ -81,7 +81,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_ARM64)) + if (likely(rte_hash_crc32_alg & CRC32_ARM64)) return crc32c_arm64_u32(data, init_val); return crc32c_1word(data, init_val); @@ -95,7 +95,7 @@ rte_hash_crc_4byte(uint32_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_ARM64)) + if (likely(rte_hash_crc32_alg & CRC32_ARM64)) return crc32c_arm64_u64(data, init_val); return crc32c_2words(data, init_val); diff --git a/lib/hash/rte_crc_x86.h b/lib/hash/rte_crc_x86.h index 205bc182be77..3b865e251db2 100644 --- a/lib/hash/rte_crc_x86.h +++ b/lib/hash/rte_crc_x86.h @@ -67,7 +67,7 @@ crc32c_sse42_u64(uint64_t data, uint64_t init_val) static inline uint32_t rte_hash_crc_1byte(uint8_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_SSE42)) + if (likely(rte_hash_crc32_alg & CRC32_SSE42)) return crc32c_sse42_u8(data, init_val); return crc32c_1byte(data, init_val); @@ -81,7 +81,7 @@ rte_hash_crc_1byte(uint8_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_2byte(uint16_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_SSE42)) + if (likely(rte_hash_crc32_alg & CRC32_SSE42)) return crc32c_sse42_u16(data, init_val); return crc32c_2bytes(data, init_val); @@ -95,7 +95,7 @@ rte_hash_crc_2byte(uint16_t data, uint32_t init_val) static inline uint32_t rte_hash_crc_4byte(uint32_t data, uint32_t init_val) { - if (likely(crc32_alg & CRC32_SSE42)) + if (likely(rte_hash_crc32_alg & CRC32_SSE42)) return crc32c_sse42_u32(data, init_val); return crc32c_1word(data, init_val); @@ -110,11 +110,11 @@ static inline uint32_t rte_hash_crc_8byte(uint64_t data, uint32_t init_val) { #ifdef RTE_ARCH_X86_64 - if (likely(crc32_alg == CRC32_SSE42_x64)) + if (likely(rte_hash_crc32_alg == CRC32_SSE42_x64)) return crc32c_sse42_u64(data, init_val); #endif - if (likely(crc32_alg & CRC32_SSE42)) + if (likely(rte_hash_crc32_alg & CRC32_SSE42)) return crc32c_sse42_u64_mimic(data, init_val); return crc32c_2words(data, init_val); diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c new file mode 100644 index 000000000000..1439d8a71f6a --- /dev/null +++ b/lib/hash/rte_hash_crc.c @@ -0,0 +1,68 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation + */ + +#include +#include + +#include "rte_hash_crc.h" + +RTE_LOG_REGISTER_SUFFIX(hash_crc_logtype, crc, INFO); +#define RTE_LOGTYPE_HASH_CRC hash_crc_logtype + +uint8_t rte_hash_crc32_alg = CRC32_SW; + +/** + * 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) +{ + rte_hash_crc32_alg = CRC32_SW; + + if (alg == CRC32_SW) + return; + +#if defined RTE_ARCH_X86 + if (!(alg & CRC32_SSE42_x64)) + RTE_LOG(WARNING, HASH_CRC, + "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) + rte_hash_crc32_alg = CRC32_SSE42; + else + rte_hash_crc32_alg = CRC32_SSE42_x64; +#endif + +#if defined RTE_ARCH_ARM64 + if (!(alg & CRC32_ARM64)) + RTE_LOG(WARNING, HASH_CRC, + "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) + rte_hash_crc32_alg = CRC32_ARM64; +#endif + + if (rte_hash_crc32_alg == CRC32_SW) + RTE_LOG(WARNING, HASH_CRC, + "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..e8145ee44204 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" @@ -31,7 +29,7 @@ extern "C" { #define CRC32_SSE42_x64 (CRC32_x64|CRC32_SSE42) #define CRC32_ARM64 (1U << 3) -static uint8_t crc32_alg = CRC32_SW; +extern uint8_t rte_hash_crc32_alg; #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) #include "rte_crc_arm64.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..8b22aad5626b 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; @@ -56,3 +57,9 @@ EXPERIMENTAL { rte_thash_gfni; rte_thash_gfni_bulk; }; + +INTERNAL { + global: + + rte_hash_crc32_alg; +}; From patchwork Wed Feb 22 16:08:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124379 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 4BCE141D40; Wed, 22 Feb 2023 17:11:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5DCBA430EB; Wed, 22 Feb 2023 17:10:06 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id CACD943081 for ; Wed, 22 Feb 2023 17:09:45 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id qi12-20020a17090b274c00b002341621377cso9230219pjb.2 for ; Wed, 22 Feb 2023 08:09:45 -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=5NA6mvX+cVJ8QnJL/IRAQX0yxV5V0Dus9MqtpxM1xKc=; b=WGhoJSeUY0xo3B+4FEOPvJGn62DzfxV22S9dKCciiW3m12wxB34ficgto7RLwzPsTg 0jn15aiQfGNOdejipPQ6TPeWuSMYMirdgKOo5pkwcIyjwSLTLXNW6tyPolYhoqhwi1f8 jrMpwCt2oGtTeQ91lQIk3medEIAiBiI7WtPpVplIKhzAcw58R5e/UHybE6Gn/fWfg80J /FFIOdOIOk/6ogPbZ9YBEKVBWDfbPZqDHgOGTO8B9TR4/eOdmJtayqTqjUL6wuB0Aane oSLyeHuKQcfolwCa7UCGNqqZI/vqMD5D5gcw9FBWfd43H+PEd41yfZplERVsUskuuEox Yx/g== 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=5NA6mvX+cVJ8QnJL/IRAQX0yxV5V0Dus9MqtpxM1xKc=; b=1fNXBblN9n3foJ1Hz2BfhFcx3lcZIq3pn7ebCx9V3H60S9I4/ed+Um4hu3SajsXI28 UTm0dgyEAbQ6Gb1MqvOckcDeWNBWXwW5JewLilcOwCUd9bvGyGktoVne6WL7cE/8uoMY tywpgO0lhErvOJKeRPPdPMo2lxuTo1jepZ/kOfFzZdiN8x1ve8MGJwfuFFpoG+bnNIhN 4yLCaAbUlHD40GiDafYmslaMXy3Nw8zVT+9Zd0g0MgsLfsjf7HjO7pavvrFmkiFCO5ZH gzBJ3yp+914KFS2OAqA7S4usJCBH1deu6XxqhvsyJ63K4sz0SwptUN/GDRBWHVwL0wRl ktCw== X-Gm-Message-State: AO0yUKUn75/K56NWCmeQ+4NmH18NngZ8kUUWlmnI4kn70xaZXaB2zB3s a7geiV37U9OxK9z1wGEUWX0wJrvJISwqOITh8+g= X-Google-Smtp-Source: AK7set+oeqvy4gcTceMJnzoWsdkt4S0ATBvOBjs2XRFyl0PuLnqQ3rb1gvbFmg2OhEvpq95/TBs8Kw== X-Received: by 2002:a05:6a21:999c:b0:cb:c276:5873 with SMTP id ve28-20020a056a21999c00b000cbc2765873mr3541303pzb.22.1677082184763; Wed, 22 Feb 2023 08:09:44 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id x24-20020a63db58000000b004fb71d96d78sm5063778pgi.2.2023.02.22.08.09.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 08:09:44 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v10 22/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Wed, 22 Feb 2023 08:08:02 -0800 Message-Id: <20230222160802.123611-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230222160802.123611-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230222160802.123611-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_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 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_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 eb334185725c..35206d575153 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -10,6 +10,9 @@ #ifndef RTE_THASH_GFNI_DEFINED +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)