From patchwork Mon Aug 21 16:09: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: 130591 X-Patchwork-Delegate: david.marchand@redhat.com 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 626EF430C3; Mon, 21 Aug 2023 18:09:53 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 521AA42FB2; Mon, 21 Aug 2023 18:09:53 +0200 (CEST) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id 1799042B8B for ; Mon, 21 Aug 2023 18:09:51 +0200 (CEST) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-68a3de5f231so815009b3a.0 for ; Mon, 21 Aug 2023 09:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634191; x=1693238991; 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=22sb9KeaWCIHf//+hSXs7eWusMhXwHuF7sjijeI+aRE=; b=Suq377ScWFNdfhIOulqEfgLCI5YfcDwNmnL57CqcQUu4Hhjo2CxbdHdqm6URlJe4PC 2/rATEHZCpSMIlMbLuiGau+6CoEVw8DB0QUePZroLlZ1ot/8lc5rVu86SQlFiqyMF9IX dpmiPXUJIJWINReHYYLXk1u3tdPS+gVVO6ag7AlGTq093iHkRBA5rU4J6XVT9HpaS4RW GiK1FtPbhaAZRxVlA4kZPICQCn5rI5uJ4i0c60FtymkklUF5I5Q3IDn3ObatdOzJYAT6 ywE7iGQ1URXp2aJyKlmJEubD9V6Ez0JZVp720qzxkrI3pyavCK0PCCzcXSx24YIX2agP K5DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634191; x=1693238991; 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=22sb9KeaWCIHf//+hSXs7eWusMhXwHuF7sjijeI+aRE=; b=ljaGNlk4QKRD5ahNoBSS3aCn4SZ4va14guLl0kJgHfPIUaUnl4tkjYB4gEp2HMnGff 3CFVPn5etaRbpt3wdaQDP+jarzf0LEeTUzkMzWAUuaErei3jTT08QSC+RTEBQ0IdOO5g sWIDb4+1S/n3fgB5IgVUzKbbiPLccAuCNHIJoqcShfBK7P4h+uOvLuWe+KznU2HPWRkn OWCJ6H4UI/Kv3mW+8Q6mxJbDdjojzHf/C87IizHS1jQVs80j8dDDXVw3IRvkeQw35L8n 0INFOI7klSK4JQlUCSix9WYCNXCNndytsbaym+FaRKt0xYI09khUrQ2j70l5R4DjDJjV U5Kw== X-Gm-Message-State: AOJu0Yx1Pu8wwWJ9XfY20+p1SqiGpTJEYH/L6DIdpzYpRQpwJZf6f2w/ 2H+AHxs9Pg6YizwpbqdieMePLp7rmonYRgiAQkhJSrmX X-Google-Smtp-Source: AGHT+IHiQUhPfesXdIZ6FkAqZz5d9EJhAiVeVsSwktlP9StRvj3R0kxbaCwHj2ieWkjyuNYfsqZYhA== X-Received: by 2002:a05:6a20:969a:b0:147:d309:be7b with SMTP id hp26-20020a056a20969a00b00147d309be7bmr4474251pzc.62.1692634190811; Mon, 21 Aug 2023 09:09:50 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v13 01/21] gso: don't log message on non TCP/UDP Date: Mon, 21 Aug 2023 09:09:01 -0700 Message-Id: <20230821160921.383832-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 | 4 +--- lib/gso/rte_gso.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/gso/rte_gso.c b/lib/gso/rte_gso.c index 4b59217c16ee..e29c7d884aed 100644 --- a/lib/gso/rte_gso.c +++ b/lib/gso/rte_gso.c @@ -80,9 +80,7 @@ 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..c0f9a1b66ff2 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 segmented * - Return -EINVAL for invalid parameters. */ int rte_gso_segment(struct rte_mbuf *pkt, From patchwork Mon Aug 21 16:09: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: 130592 X-Patchwork-Delegate: david.marchand@redhat.com 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 BA4B2430C3; Mon, 21 Aug 2023 18:09:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7008943261; Mon, 21 Aug 2023 18:09:55 +0200 (CEST) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id D7D494325F for ; Mon, 21 Aug 2023 18:09:53 +0200 (CEST) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-68a3f0a7092so1274628b3a.1 for ; Mon, 21 Aug 2023 09:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634193; x=1693238993; 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=Of4tV2dbEr2TKFWqVFHpFJXBAupadgx/es86eVvQGrs=; b=LpTMjGI0jmgQI8F/XbV4jgbIh9eRFV+VMV0SlM0QESPLYWEzYk4Jae6HfsGIMIIwB7 w4JQqj2hDg5v5N/XVLrnWRRKyfnFKkZvZOVhwMGzMr/N496Nzo1zZIaor2P7fPiba2UK F4L8+uB+Pjy0dtZHtkLZ1kIp/DBeO5DxanV6+xWIofseknWl81l9cMGSww5Kq3B3huVf d4vq71/4oVoDrEdWoaCtR9JPglQ8dDAlJ6rySucwAgFy1LI//UDw8GGXkUCc2Oqilol3 Soc1VY4lnPYIYqTT11WqWdY3sy0uwNnV5cbKJyyFJBrK+aCgWxO4VLcXqyihTwcSUR4m 5nhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634193; x=1693238993; 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=Of4tV2dbEr2TKFWqVFHpFJXBAupadgx/es86eVvQGrs=; b=dsbxcD02pjQOw8WzHH0+pMkS5dSlyZ73t79ovg5KqEEv2jQW2aZcILpNZ8kY8xSx5l Mol+fTKzYd+LFYKHh0QCLCd001mYyUgxN22VXIBF9u3y9nblSjH8GlAt24Jrf6E77Fec b/dvizpdVQKQIv20t0MoqS7stZx8YVe6m8yfxD5PYauFEP/TXc6l64LxbMv0dy/Z4dv+ PI6oA8vG2wKdYlpUcY1p2cEwrhRip9KB1KX+26vpTa0qjKxruNnhGOfv6L3rIJT3FzRD s4LjKsPqqcJntFeQOkO/0likJa6hz2KJi2uMEAvurAMxCf7MYJMLNnbJax0fvNuqNKjS pvWA== X-Gm-Message-State: AOJu0YxMBBZjPMORsY1wr0hQXRQ/CZ1Bm7cGysCztGUh5RaVBdAOx7dt MoAyp52h6/rH1Xy26Gc/gUwKPITZjUXQ5MUtL8CoAjUr X-Google-Smtp-Source: AGHT+IGl+P/PMDqMHnMGPee0dhTJIN0VQxb4XeisOyCHaMQe6v1OAadWUdopK8pXd/KxNDQkL+j8dQ== X-Received: by 2002:a05:6a20:3caa:b0:13f:1116:d267 with SMTP id b42-20020a056a203caa00b0013f1116d267mr10599639pzj.48.1692634191870; Mon, 21 Aug 2023 09:09:51 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:51 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v13 02/21] eal: drop no longer used GSO logtype Date: Mon, 21 Aug 2023 09:09:02 -0700 Message-Id: <20230821160921.383832-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index 52c771fb6b84..b51beb1a7604 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -370,7 +370,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/log/rte_log.h b/lib/log/rte_log.h index bdefff2a5933..4ed11a80069a 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -46,7 +46,7 @@ extern "C" { #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */ + /* was RTE_LOGTYPE_GSO */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */ From patchwork Mon Aug 21 16:09:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130593 X-Patchwork-Delegate: david.marchand@redhat.com 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 634EC430C3; Mon, 21 Aug 2023 18:10:06 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16C1B4326E; Mon, 21 Aug 2023 18:09:57 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 3018643260 for ; Mon, 21 Aug 2023 18:09:55 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1bf3a2f4528so24949195ad.2 for ; Mon, 21 Aug 2023 09:09:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634194; x=1693238994; 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=+iwGQ7jG6z2JWud0rODujOaLPpUudAkKTm2hdxXNiyk=; b=G1h/YyVUi6S5kxQEXSbaz+bySMHyEINACMkPrNtlhbq0gAuOncwAsdwB7CpqzWfd+T 5yd3N1Jkj1XilIO2GnYmcvIPbmJh53jYsn0ahHncxt9nmN2+57GDGDnLLYKOdHxqFywW RieEyMbfutgy7nRaOot1XmXwqcCZ7ALBAuhoXRom3SyhgpddI37tgC58HxEf3sh1ncoP oRaU/k157aJ9xJD1IF0DofvNYn7oAjlYG9il1RTX9oWExi7ZhteIYIwII5ebdpcwo12K Tz6b5NTh/xs4hlaNqLxmZm2kr0rqf6BtSrMmX19UsuwuLlTCOuZYNHkcsuT6UGkgB/Cb UDJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634194; x=1693238994; 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=+iwGQ7jG6z2JWud0rODujOaLPpUudAkKTm2hdxXNiyk=; b=A0vqE+gD2gWdrNEZyBZwKjRA9Vnos42TaUj2mZiDvw+HrEoVVti+VW+JBZJAz85zMf q4mTjoSxUiDOcSw5XIHpn9VnrSDqFo2zUzN4Gt8WzosXQmlrhB4ri9HKAYEYPtvvfhr2 WFODCfBWfaUso28MGc+DHh2bhCji1OjjGlDuadTRSYWK+kNiAT9nfSA91HJGgYeaBoCT f1uN6WjdPrm5bt8GkeFURrQBwC5K6BcuQXaO1SvVO+h3u6bAz6wwTBwiPGO2M5t0RaeX ZitYkoPZIfi9NVuyTlqWeWvckEhsQloDxkugPrSEzTdWsL2k6Vl55KUfj6Z/ghhuxB6a bE9A== X-Gm-Message-State: AOJu0YyxOZdfEmnkhKSzQUNpE9ugloIim+1zAJzypAA1xRAFm8gkfsdm X1/dYSNAFmrsGbyLC35pOnZ9KaUTCCK7K0ArE0nyNR1V X-Google-Smtp-Source: AGHT+IHn4FRwtQBVmGjKyYppOR1MXlf5uK3lwWsf4e++MK0WrkrcBm9e0gKPoQ6Cz4EIjv5quFm3bQ== X-Received: by 2002:a17:902:f7d1:b0:1b9:c205:a876 with SMTP id h17-20020a170902f7d100b001b9c205a876mr6570437plw.29.1692634193807; Mon, 21 Aug 2023 09:09:53 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:53 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v13 03/21] log: drop unused RTE_LOGTYPE_TIMER Date: Mon, 21 Aug 2023 09:09:03 -0700 Message-Id: <20230821160921.383832-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index b51beb1a7604..4a7ff738750b 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -355,7 +355,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/log/rte_log.h b/lib/log/rte_log.h index 4ed11a80069a..bc9d1fc8f106 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -30,7 +30,7 @@ extern "C" { #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ #define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ -#define RTE_LOGTYPE_TIMER 4 /**< Log related to timers. */ + /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ From patchwork Mon Aug 21 16:09:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130594 X-Patchwork-Delegate: david.marchand@redhat.com 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 C9400430C3; Mon, 21 Aug 2023 18:10:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51B4943271; Mon, 21 Aug 2023 18:09:59 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 56BA143264 for ; Mon, 21 Aug 2023 18:09:56 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1bee82fad0fso20611305ad.2 for ; Mon, 21 Aug 2023 09:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634195; x=1693238995; 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=oA9GWhqIEltXO0fzzyyLzXidMfk6X1MoUtYNlOqDGmE=; b=TjNrxeMfAFp+wuUgfVcAUsp62DXMLEwPEu6IqCKSwZmv3b8IHFJ/KsKNV8wettUpZB lEiHiSKFhUMSh5XxNivdN+HZgBEOZyvBpDlTpt2B8fI3WKnhI5IRvI5cxfQN7OlNeZNb +VzUuxFXW0O8W4Y4AK4vyXCzz8fNqeNr4XUXqw4kB6aY1FrrIZBDgXdquvmrHnyn0Vm8 GTdSbYF/0Vplf7pQiMM8ZuEbsBCsqcpO7Bf2JB019Gcm9Hv+vfG1BnWYQiCQDp/PbfDc /B/vHC/vWkvmP7IthVJDaS1RaC17O55++b3VdcTXaLpdrREYaaaq76GBjq7fRqcz25Vj ml6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634195; x=1693238995; 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=oA9GWhqIEltXO0fzzyyLzXidMfk6X1MoUtYNlOqDGmE=; b=V41Te0DtCXq7HWswaf2rdLlInld/aBviXuWyfDNsyu+hXv9hpQdoSOgiueP1aBJrx6 nWnilhkVetBB18x87BR/nuBOVm8c/2tFodHyROFZl2fTTIF6EBjk20L+lrx8Il/EaY22 vXnpBFreCtlbzR1MoaVdwn8iJAxBZEUPt6/7zH7kTUkORWLrVYCePKO+1k52PVytgT4/ Jwrm5+x5U6HXTLpRiqpIsbo04aEO3bMMGVeyhglE/uchkirRFfpp9HHsd5VAcQWXZuCG MxtUvfJubfKbLP0trqwzWFNx8iCBLjtWLsZ2q8wya09+SHeJqnT8vdgsHXXFBOV92Ll7 X6eg== X-Gm-Message-State: AOJu0Ywe9lojKVdmcbxVBXScd0K2C6wxH4tVDNDdRKpQginUnVuVgzq8 ck+N2K9MbaC6YwTTCsX/S4QCa6RXKfou1lOoHjeCsxdp X-Google-Smtp-Source: AGHT+IF03K6X9Lz9gsbuP1eId72L9zaDBG/q3wbdLJ14M/Zu8GjDs2oVR54uJbEDqI5SkdR1LpMJ8w== X-Received: by 2002:a17:903:25d4:b0:1bb:8931:ee94 with SMTP id jc20-20020a17090325d400b001bb8931ee94mr4344736plb.67.1692634195152; Mon, 21 Aug 2023 09:09:55 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:54 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Byron Marohn , Yipeng Wang Subject: [PATCH v13 04/21] efd: convert RTE_LOGTYPE_EFD to dynamic type Date: Mon, 21 Aug 2023 09:09:04 -0700 Message-Id: <20230821160921.383832-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/efd/rte_efd.c | 4 ++++ lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index dad962ce29bf..78fb9250ef87 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) \ diff --git a/lib/log/log.c b/lib/log/log.c index 4a7ff738750b..7a6b5c335753 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -367,7 +367,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/log/rte_log.h b/lib/log/rte_log.h index bc9d1fc8f106..6df66366608b 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 */ From patchwork Mon Aug 21 16:09:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130595 X-Patchwork-Delegate: david.marchand@redhat.com 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 E8C84430C3; Mon, 21 Aug 2023 18:10:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D07043274; Mon, 21 Aug 2023 18:10:00 +0200 (CEST) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 6A85A4325D for ; Mon, 21 Aug 2023 18:09:57 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1bf55a81eeaso10525425ad.0 for ; Mon, 21 Aug 2023 09:09:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634196; x=1693238996; 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=x1BtQULEkfs1qAbAF00sDx5XhkvDlByB/ODKUaok9HI=; b=CpXB62L/vOqUnEANMZWdaxRtGeyyk2gR1J1FnYd9iF2WfH1l5w9OFb+zwE63GGBg7i p4TU46XmvuQnlQr+J3/xhYO+eus7rU30+BbicQJvPj8LzKDiecVZhjDRll3WHkezmxeA mxudoJO27UaVJJ4yFcXNLk6I9hYRIAr1yFrAR8VBWtnz+TBV0Quwfm36eHTkIzN5gRck hwU0uceYYFGqBkFbpkThdaVrY/ICiDm3TK89EmOUE6e7EXCxnq5uJEZGz0mc0th2KDyn 0ZvPW3jfFrfXThfjUqSRnMhi4Bhc25r5enNSD7x45yojylF+zUA/9euVS/uFwe9QfWgE mj3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634196; x=1693238996; 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=x1BtQULEkfs1qAbAF00sDx5XhkvDlByB/ODKUaok9HI=; b=SOqbQ9KtOV2T3SMwQeRIEs1l5baBHxe2698mhNv9zOs+3vy1e/1cc9WyOppD9dkb2y jNWpJQxGzaXMMaVbGSIb/fcYSwZs3TL8R6Wn3/g8HhE+EAi8CnwhnP4Sqjl01DytK0Wd J0J6JBifV0AgD3rkR6VLsrKOb2ZljZek1asGKcqRw2mAumZ5r09DDO4lDfJMgvSRVMQV MasTv37XJ2njlXfWhRZlilWZtzSDlKBsl+gnfFBHsB/0C1WGGgg9Xdc1kBbbRQ2PMehH lPJ8ogjLM/VUHvgAZ87vuXzkSuHfmm6Qvt3ILhvxi1N4HS0d2hkNWR9Y0x6ANy+Xo9NY nJng== X-Gm-Message-State: AOJu0YyKDBpcEPfAuyqluH7YFTXw1ayXOo7+xH+Pjcskh03VQ+vY4bo3 iObkVO0VZTGJa7KtQPiYmEERJeBXNEJriweSbEdg40oj X-Google-Smtp-Source: AGHT+IHfpQLlwIN+IJZhGndrF0WZZ2pK5FWnL4XonvGn1mW5308Ms2oGlPwk+CKigD2JGyb04MuEJA== X-Received: by 2002:a17:902:dac1:b0:1b9:f9a1:85f1 with SMTP id q1-20020a170902dac100b001b9f9a185f1mr6160039plx.19.1692634196147; Mon, 21 Aug 2023 09:09:56 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:55 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v13 05/21] mbuf: convert RTE_LOGTYPE_MBUF to dynamic type Date: Mon, 21 Aug 2023 09:09:05 -0700 Message-Id: <20230821160921.383832-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/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/log/log.c b/lib/log/log.c index 7a6b5c335753..718922b5e5ac 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -365,7 +365,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/log/rte_log.h b/lib/log/rte_log.h index 6df66366608b..8cab1f11f7b8 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 686e797c80c4..3eccc618270b 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 5049508bea6e..4fb1863a1043 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -17,6 +17,8 @@ #include #include +#include "mbuf_log.h" + #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn" struct mbuf_dynfield_elt { diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c index 4c91f4ce8569..5318430126cb 100644 --- a/lib/mbuf/rte_mbuf_pool_ops.c +++ b/lib/mbuf/rte_mbuf_pool_ops.c @@ -8,6 +8,8 @@ #include #include +#include "mbuf_log.h" + int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { From patchwork Mon Aug 21 16:09:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130596 X-Patchwork-Delegate: david.marchand@redhat.com 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 71C08430C3; Mon, 21 Aug 2023 18:10:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CB1544327B; Mon, 21 Aug 2023 18:10:01 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id BB52243272 for ; Mon, 21 Aug 2023 18:09:58 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1bdb7b0c8afso18640305ad.3 for ; Mon, 21 Aug 2023 09:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634197; x=1693238997; 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=bpgY5jMWYUqWWnDZ2zy91qSrFZg8i5EccFuswJwYt5M=; b=gD5/IsF+RY/EfLy4HuP2/7ZDBfYQ3avWzqEjirBJ44f6ojXdPIEGsPYHzaokL0QrOk C+q99kmoZF2sJ+Zap34qrEFx3Ipwf5/UuzRj2b8/yo912y9wHTVVwIyqDTDRVYQZa3ND KzuD3pxZNMtP3o7shKcw8wM9kglqltOHvkMvlbWV0KF5s1vDlHrbJy2u/85NqilYTH8E KW+bUW5MXjKC+6i1OM5OToGPfX3h+CQCOJcDnXxP6LRhdTKUtSzoLRjvvMA5aybd9bSD z9v96oTrKsNROnSxsrRz1RXr5m9gK6XTAgGv5ZNGLEu4/6mSjyNuQsHd+8VlIXIaRZE3 JAvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634197; x=1693238997; 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=bpgY5jMWYUqWWnDZ2zy91qSrFZg8i5EccFuswJwYt5M=; b=B1AV3tz27gXhVo3C++t0X669Ol/6f6skCY3I3ZdEZ9K+NpNnzmCDKrqWDnnqmSRHya PE0HxFV3uAVSao1J8wsaBtG4QoOyEe8btNFAixJKkDEqb+A8SqSm/GeZLPSr+lccSK8b uo1E7n6I4vqmmJxK4IWpX3dQKfU+hetZ1wD7ulHP4O9YWcEf4vGeswByUottBnCsrOSW NedyDzSo2j6kxmjjQV3nuGLLba2WIZ+Ugj05mdvYWdd9QFad+ZkkbGTvOvRV1zY8eO3c 6h6oCJsFJomygSJjpgPoSg/3baPrpQRwBpUemZN6YQVZWUEST9fAxHyR5X+yaeOL2TYT n+BA== X-Gm-Message-State: AOJu0YxeOYImER5l+3s+fw5XjdFFpZlTkh9bIoQ8D7Xy/uhkuuWFdACB plm9xgRWQIB5x6632yo9ShqQtyHX1qraER5++hqZgVyz X-Google-Smtp-Source: AGHT+IEbn0czPOZ8R2ICSNxpbLusf/vMHixXpoodOYgyx6jB+4mGC+pClQ3T1+MSsOZ8bBqVPQUTMA== X-Received: by 2002:a17:902:d507:b0:1b3:8862:9823 with SMTP id b7-20020a170902d50700b001b388629823mr5323140plg.28.1692634197416; Mon, 21 Aug 2023 09:09:57 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:56 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH v13 06/21] acl: convert RTE_LOGTYPE_ACL to dynamic type Date: Mon, 21 Aug 2023 09:09:06 -0700 Message-Id: <20230821160921.383832-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 | 2 +- lib/acl/acl.h | 1 + lib/acl/acl_bld.c | 3 +++ lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 6 ++++++ lib/acl/rte_acl.c | 3 +++ lib/acl/tb_mem.c | 3 ++- lib/log/log.c | 2 -- lib/log/rte_log.h | 4 ++-- 9 files changed, 19 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..7de54d4c8901 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -154,7 +154,7 @@ 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.h b/lib/acl/acl.h index c8e4e72fabfb..baed9513cb31 100644 --- a/lib/acl/acl.h +++ b/lib/acl/acl.h @@ -225,6 +225,7 @@ int rte_acl_classify_altivec(const struct rte_acl_ctx *ctx, const uint8_t **data, uint32_t *results, uint32_t num, uint32_t categories); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/lib/acl/acl_bld.c b/lib/acl/acl_bld.c index 2816632803bd..22d909309a4c 100644 --- a/lib/acl/acl_bld.c +++ b/lib/acl/acl_bld.c @@ -3,8 +3,11 @@ */ #include +#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 25e75fec3534..03a47ea231ec 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..6147116d8d12 --- /dev/null +++ b/lib/acl/acl_log.h @@ -0,0 +1,6 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +#include + +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..650d52a97c32 100644 --- a/lib/acl/rte_acl.c +++ b/lib/acl/rte_acl.c @@ -8,6 +8,9 @@ #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/log/log.c b/lib/log/log.c index 718922b5e5ac..6f04f75f9a25 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -352,13 +352,11 @@ 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_ACL, "lib.acl"}, {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 8cab1f11f7b8..04dfb3443ea4 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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. */ /* was RTE_LOGTYPE_KNI */ -#define RTE_LOGTYPE_ACL 9 /**< Log related to ACL. */ + /* was RTE_LOGTYPE_ACL */ #define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ From patchwork Mon Aug 21 16:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130597 X-Patchwork-Delegate: david.marchand@redhat.com 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 34FC0430C3; Mon, 21 Aug 2023 18:10:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01C8743280; Mon, 21 Aug 2023 18:10:03 +0200 (CEST) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mails.dpdk.org (Postfix) with ESMTP id BDA7443274 for ; Mon, 21 Aug 2023 18:09:59 +0200 (CEST) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1bdc243d62bso20634605ad.3 for ; Mon, 21 Aug 2023 09:09:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634198; x=1693238998; 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=fyrJcbePnQ6zXNEhR66EsO6cYbBaUaucvyZn24qcaWg=; b=E23IDUUWTfPZgXqYg/jCo6Q83ufURoaiKOpXvnTtkWWmpUmeD13nyEMqjSR3TXFDev 3DOWnT47Y6Vnk5sMsei1CvrbeagCln5ima+3On6eCziHnYWqU2sYKom67sf9jtCzGFnU /Onq4RgyhyjzIeqfKRcvVRlsITZD9IVbnU2qR0IIdXT02rAu/PxQxkKAuerArfAd+wfh QmoqT28AE1Lz/FQ+N5nwdbxaLhR7JJyc6qlM/yX2NMNzaHWWi2jyC2FXg7UH3QqizJ0+ Wl3IuTg2o+TpCNUM2LfTdi4Wo0C9f0C4iPejMgy5kRXiH+4SqWi0O3pRqb9ai0u3/z/H tRUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634198; x=1693238998; 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=fyrJcbePnQ6zXNEhR66EsO6cYbBaUaucvyZn24qcaWg=; b=QRLnmXWtPXg9sjjguxzR5StGX0udkZ0heNyd/qCqVUU3WuRV/bztYqDnQYT7VNlmTy SsyWiZLMGMypgWbfKRoSvvF3u8vFNRvs/vB4/y9FBOBU8MYSQVU9Y66pv5A7cBmKvJnq y/mTGVzTK2oh9UsmlYIhNd85gTpkoZKODOdRtapQtIYEVLx+ucyrYA2AfkRCvloD7BVw v9zJR0N8B61Y3XvNYdYGwE+nhiwyXpEXNTOALdnNAMlAmFwUHkAObGUN8mGa7QDdzNOU v2lSbLBKo8AypRIQ3x2PkUihLECHBIrqGHM7A7DJQg2e0y733TbCN1r/Rw21qrF8QlWz 5TwA== X-Gm-Message-State: AOJu0Yw2i1hcp1WfOHZjelVY0hw47MnkED4I7cJ3DFXDcdSHJ5eC8UgP y/QoJ10bvudnttgnUnFir99RvgJNpDtL6+FaJNqopHzC X-Google-Smtp-Source: AGHT+IFvLQ5W5OGlMgUm/lmaqj7Dgc0KdW1dVbrVmj5/jVg0XuQTQ6RLBu2Ch+4+SpiY0GX27XPIqw== X-Received: by 2002:a17:903:491:b0:1bd:ccee:8f26 with SMTP id jj17-20020a170903049100b001bdccee8f26mr4078802plb.15.1692634198669; Mon, 21 Aug 2023 09:09:58 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v13 07/21] examples/power: replace use of RTE_LOGTYPE_POWER Date: Mon, 21 Aug 2023 09:09:07 -0700 Message-Id: <20230821160921.383832-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 Mon Aug 21 16:09:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130598 X-Patchwork-Delegate: david.marchand@redhat.com 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 EB591430C3; Mon, 21 Aug 2023 18:10:44 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C04943284; Mon, 21 Aug 2023 18:10:05 +0200 (CEST) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id BE18943277 for ; Mon, 21 Aug 2023 18:10:00 +0200 (CEST) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1bf57366ccdso13726445ad.1 for ; Mon, 21 Aug 2023 09:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634199; x=1693238999; 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=bmHkGw6nNCA9ARYN6hfzHAuA7ojBoytfJWTsjpoxblc=; b=L6DxjTnb4NzVZsl+CoEpoL6yofF6BDRw62/d5NuWkOQU1O+hTYmzgGTdIlt8SCpPvn fUoZy41/OmnC/x2P7tfteNcm8pvxOeXsp/2xuG1r+aIpsUDBrfmiohDctbcv74Bddq3e TEhOJenBQlNDcMQZhgV4Vnip2fxhxBF76EqGIq7arneq+Yzpnct57sVHWP7oN3bfgzrb QiyApvn82ZiZD4Nvqmqrt6b1uPgeYN/CAF/SzB5X/naFQGnDzlDFT2+IZI837WRLSuZd kv49iNsiLiqR2VRTMopioC1MXaraKgLG8AbEJyg54b5qHTES+FvEUiJgf96XI6QHby7u ZECQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634199; x=1693238999; 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=bmHkGw6nNCA9ARYN6hfzHAuA7ojBoytfJWTsjpoxblc=; b=JeQ/U879Fz1xEMNpRWKJG8xNRQ5VYnB8mE5/8lYbR/iwy5TQyFOGt1f7l5LmyeGS6+ DTrZPbOhcGNl0NPBnpC4V6S/tvOZj0ymu+Ib0n5RTHwTj83NTapdFDjbWH+P4Kf76UDj WVdDnewaD2ssa3XP6WNK3yABW+DNYZrohkap4r60KcPEgnZD1CXiDDjFieZRyqGHPoKm jSGx+OYz7sLdS4iU+YAjyH0E4ytoh1t8FoPjZ521JmHlofccIR5sC4mJZHHpOSZX3awt kavTX3MSxNfnduHlzmTPOsMmWFcwgXSQPkJD7r8fn1rI/52364ZdQXSkLQzYF92F5eB2 PIzA== X-Gm-Message-State: AOJu0Yz2pR7kl6OgAUHAnZ1Toz5SA3ZZQVXMbW/QwS+3mwHHF8T3xREW 4NHTBZAWMJGsJ/qg3egVHgaUuiP6KeiPvvswt7ASRhcb X-Google-Smtp-Source: AGHT+IFGpBwuEePjaMsv+Ejj/wUt3EczYP0fCVPnJfqkyQkzCiJN2rIxWTxeUXFXRhi98JAazX1VkQ== X-Received: by 2002:a17:902:f681:b0:1bc:56c3:ebb6 with SMTP id l1-20020a170902f68100b001bc56c3ebb6mr11081885plg.8.1692634199700; Mon, 21 Aug 2023 09:09:59 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:09:59 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt , Anatoly Burakov Subject: [PATCH v13 08/21] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER Date: Mon, 21 Aug 2023 09:09:08 -0700 Message-Id: <20230821160921.383832-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 3f01cbd9e277..f3330fd735dd 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; @@ -2246,8 +2247,8 @@ init_power_library(void) if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ && env != PM_ENV_CPPC_CPUFREQ) { - RTE_LOG(ERR, POWER, - "Only ACPI, PSTATE and CPPC mode are supported\n"); + RTE_LOG(ERR, L3FWD_POWER, + "Only ACPI and PSTATE mode are supported\n"); return -1; } } @@ -2264,7 +2265,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; @@ -2333,7 +2334,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 @@ -2382,7 +2383,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(); @@ -2398,7 +2399,7 @@ launch_timer(unsigned int lcore_id) } } - RTE_LOG(INFO, POWER, "Timer_subsystem is done\n"); + RTE_LOG(INFO, L3FWD_POWER, "Timer_subsystem is done\n"); return 0; } From patchwork Mon Aug 21 16:09:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130599 X-Patchwork-Delegate: david.marchand@redhat.com 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 30B61430C3; Mon, 21 Aug 2023 18:10:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A09F43286; Mon, 21 Aug 2023 18:10:06 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id BB30F43279 for ; Mon, 21 Aug 2023 18:10:01 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1bdbbede5d4so27117725ad.2 for ; Mon, 21 Aug 2023 09:10:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634200; x=1693239000; 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=ous8OGMzLdtisG9RJb+umFQunlv+xwUlovBg00lHXBk=; b=T6KLS7FoY9T2VxW7DaLHr9rBA+J5Lhlgi8UVRYvLl4sbehhQfT7XYfrCcwMlFipuaA 1fD/ft3nf6skTdOCW2GCg6coMaPyjUPbzcnMYXuHTz1n4+8K70cnR1BGVn6Qw8KCoCSD adLZ3Z0IDwbrFDAwJen5/q2I+0DOFurKgQE3DL9GDyKVIhpL+HQnVs3eP36qoveerNHy TCmsCRDvrvX5cI5wcrpFzxAOL74J94CugJBVqFtu6YdoBpGDwRCDxoZuzfESYGeY/ZoO EMq8k5LBrNEx+wpsNBOSOVfr7bR+F4iL81ifiIl3buEPpE7+neTed0QLPT8i2lYW5KSK vqaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634200; x=1693239000; 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=ous8OGMzLdtisG9RJb+umFQunlv+xwUlovBg00lHXBk=; b=kMeRIvF3N/AlKeCxoWIV1r0F4GIGMmR1uMJc8/hKnVMRwmJkq/yyJhSkCuz3b9oKDs iNzXxl2/OudOiMzdhJ18vmq7LZRI+rp/1TbEVP/r1l+MJn2HQWaaVBQP2O0HzLQuAK+o sU2ToH9DFl5o9nVwzuPvCEtXiGsj46vp8dLwFDIjt90RwhDzrwu48xXEWHHZRQAZ0IyJ /EA9k8tIWgfPMf6diJCxCujdhZ9M6pYT95zYpxpX5oLvB3w4IU3uI69uoUiNi6qoZWCN 6y6iHwiilqrbtfNgzdB01y6hVMuFLiip+FwVCOqHqoHOo/xSL401L7UbSp928I38SVZF pQ0w== X-Gm-Message-State: AOJu0YxIBtNxI3P70VjRBezB4UsdwBCJxP1BX+21+oXNfRQ2TGsqzlr1 hutFIQ95TDscRKhd5qFEDdEuHhYNsjlHctEKpdjiaIir X-Google-Smtp-Source: AGHT+IHawwUrVkuaaztG056J4OYRh3IYAAeXzS6mqgvkOTv1QvLOZQHJ3gRTcFcjibnYHNGZhl+VGA== X-Received: by 2002:a17:903:183:b0:1b6:6f12:502e with SMTP id z3-20020a170903018300b001b66f12502emr8621679plg.49.1692634200637; Mon, 21 Aug 2023 09:10:00 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt , Anatoly Burakov Subject: [PATCH v13 09/21] power: convert RTE_LOGTYPE_POWER to dynamic type Date: Mon, 21 Aug 2023 09:09:09 -0700 Message-Id: <20230821160921.383832-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 2 ++ lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index 6f04f75f9a25..5ec3c16250f5 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -357,7 +357,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 04dfb3443ea4..a1949e606395 100644 --- a/lib/log/rte_log.h +++ b/lib/log/rte_log.h @@ -36,7 +36,7 @@ extern "C" { #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ /* was RTE_LOGTYPE_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 7b2ae0b6506f..4932a0528691 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..c3fcbf4c1000 100644 --- a/lib/power/power_common.h +++ b/lib/power/power_common.h @@ -10,6 +10,8 @@ #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype #ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \ diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c index 6a8109d44959..db031f43105a 100644 --- a/lib/power/power_kvm_vm.c +++ b/lib/power/power_kvm_vm.c @@ -8,6 +8,7 @@ #include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c index 63a43bd8f5ae..db0e7705a9ef 100644 --- a/lib/power/rte_power.c +++ b/lib/power/rte_power.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h" From patchwork Mon Aug 21 16:09:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130600 X-Patchwork-Delegate: david.marchand@redhat.com 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 12F5E430C3; Mon, 21 Aug 2023 18:10:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 87D4E43266; Mon, 21 Aug 2023 18:10:07 +0200 (CEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mails.dpdk.org (Postfix) with ESMTP id BC39443267 for ; Mon, 21 Aug 2023 18:10:02 +0200 (CEST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-68a520dba33so837903b3a.0 for ; Mon, 21 Aug 2023 09:10:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634201; x=1693239001; 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=GaZBo8Q84sgG3NmBTtjQ7I1nggWkZyaznfCcGhB+7wc=; b=Umbf9FfHGdfi8YGTrQ4Fbk1f1ozrrFRuJpDDoh1shTHz1ElDOkFuwRDh2r4C3W+0Wz cMnE6NSYh0XbMInETUYcD9NdNFF9s59iNQ6RFZx9GUXoMHenSEsbAbFtmZBbpWAI17vF QG1Qsq3/xjFe2JAbGiPjIKNCsff1quphYZNNkX2EEbglM43LwOSJpkhjcPu+k89y5X/R 7q+waYiweprT5DHgc1lFFiGMvSWZw5ETRxagHnePIrKRLwZrcUycUzTz9D4AIg9BRj19 elAFiwoIkOpFaMhY9/e65HoYEA3Y7EvUeJPLaLd9qTFKq8XMswd4+Eac1zfKlxxi5H32 FZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634201; x=1693239001; 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=GaZBo8Q84sgG3NmBTtjQ7I1nggWkZyaznfCcGhB+7wc=; b=jbwsUzaDZ6tsckC+loxvR3cj1q2K5kZ+nNKw3iEfv+kuxkFDoUJ4Jq5ReL7J0FaDHf paA6ZkhY133/lP4s2hc6dHErHseaUkZBUsR6+f7W8dgY8B3GadEvY4xrWURscvfyCtkE c/BNWEYsUqzcl1bjyD3l4kSaF3RNQrl4LZZe6mi2sSoFfoSwVqzLc6uL4nkgFT0iKAw4 2zU9dXYU8ZQOW0RCV+ZtwIoTJRQA5EKN7WoODLppLjaVJUHaroYrCrSAUagvArPEhanw 4lnGwGuhmDg/yQQcs6/YFuZTOmAlQOES+NxB1Zmy5Bw2WBye4rYVA633WV/5Ln5zsA+b kNow== X-Gm-Message-State: AOJu0YzF0C2Nvnxue0kXAp51v5dSUR68QThXzmP1D+ZjpHok+1uigm80 Iuzd9Q1tRV/pfjsE9s7abIx8jNytDz7bf9czYqAUU94X X-Google-Smtp-Source: AGHT+IG1G6jKxPoo1QhUeVD6S6k5MxY+a3PbndQmN3RxyhjfsNrW4HJ7r9c3I8WuNc8qgSFNpQYk5Q== X-Received: by 2002:a05:6a21:33a2:b0:148:82d6:aa16 with SMTP id yy34-20020a056a2133a200b0014882d6aa16mr8242481pzb.25.1692634201656; Mon, 21 Aug 2023 09:10:01 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v13 10/21] ring: convert RTE_LOGTYPE_RING to dynamic type Date: Mon, 21 Aug 2023 09:09:10 -0700 Message-Id: <20230821160921.383832-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index 5ec3c16250f5..212c5d7b8669 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -352,7 +352,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/log/rte_log.h b/lib/log/rte_log.h index a1949e606395..4a1310385cf4 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 057d25ff6f2f..12046419f194 100644 --- a/lib/ring/rte_ring.c +++ b/lib/ring/rte_ring.c @@ -26,6 +26,9 @@ #include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT(ring_logtype, INFO); +#define RTE_LOGTYPE_RING ring_logtype + TAILQ_HEAD(rte_ring_list, rte_tailq_entry); static struct rte_tailq_elem rte_ring_tailq = { From patchwork Mon Aug 21 16:09:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130601 X-Patchwork-Delegate: david.marchand@redhat.com 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 7A4CF430C3; Mon, 21 Aug 2023 18:11:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B3C3A43290; Mon, 21 Aug 2023 18:10:08 +0200 (CEST) Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by mails.dpdk.org (Postfix) with ESMTP id E7CE043281 for ; Mon, 21 Aug 2023 18:10:03 +0200 (CEST) Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-68a3de5f231so815159b3a.0 for ; Mon, 21 Aug 2023 09:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634203; x=1693239003; 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=qb7xXaMHcvr5KwkFpewa6W38sCAZiHaF/lg3V8HqEl8=; b=QQTj/scmHr+0iwig7psyZ4f9DQs4JWKuvcUrFE52kg1ss55Lgt4kemF4rAolXVA1ZX D5crdAdYdSMMGEfo5GUVWpDbvMysevWzUOn8KPeX244IFThDTLQpzDjCu5jwOrZNSohT uhjXuD8v4ZRO14xJ+CsfEPvFG9rne3fKvUZQ5DnNhrjsx3UsE3lHLst6WgMq8h+V/sdJ qxUfbnLp0wNKM8Zbel4bgokv0tCa4OQi0d9qp/XsRel/iPiFm/62MC2qsXkYtlTx/rHU oURXoiQs0HJ/TD6sbszXSlE7ju6dwPi7zLhcmsb8u72qwSOi6uwN2vGCIpja9SuWE0Jf XCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634203; x=1693239003; 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=qb7xXaMHcvr5KwkFpewa6W38sCAZiHaF/lg3V8HqEl8=; b=IxjcDJquwJ+D4jXQ4YGmahol8yjH0c3r+dY1hn1WPAbKooDLjn0veefqrcNaR3IlgT Jx3dWvGdF5gcsNuWj1x2RUt8mdOwOa1QKlSjhqLej+wW2wYQ5HzBZtXwtkFn8RFtoh3S T8JQkE68xFjM2fdf371catw06aF7+RYmHIVJJYj0/GPiGeGEua8iois8gouH2nvt+8JV cXBem64k2k4BSMaDX4oYFAkopfEl4MzKgqu4QyyQGllwBpZvEeCz1zYHX2Hm+udxmRih RGs6szmFtVYZFggIT8bwuFxA0HNS97lgj53LwRC6ykB2dkHu72cx/xFCUanwEZtR9lMH vMYw== X-Gm-Message-State: AOJu0YxQUxuyRXW0FAgzfyRGFRTWF1+Lu4rHaLXiaxiFY4Ro4RLOnThD GSYnOBIw85k1pZPkLs3ESXUR/IfMpr5+g+ksrgzVBWCJ X-Google-Smtp-Source: AGHT+IF4nucIe3+2HCT25c506nfdQx/Kn2dctj5EnnKo2Lxe7yC5VwbvtacYBRDWqJ7Mc4hNO54NMw== X-Received: by 2002:a05:6a20:1046:b0:133:2974:d31a with SMTP id gt6-20020a056a20104600b001332974d31amr5076042pzc.17.1692634202738; Mon, 21 Aug 2023 09:10:02 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v13 11/21] mempool: convert RTE_LOGTYPE_MEMPOOL to dynamic type Date: Mon, 21 Aug 2023 09:09:11 -0700 Message-Id: <20230821160921.383832-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/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/log/log.c b/lib/log/log.c index 212c5d7b8669..58184548bb85 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -352,7 +352,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/log/rte_log.h b/lib/log/rte_log.h index 4a1310385cf4..48976fea1c3e 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 4d337fca8dcd..841666164797 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 a05b25d5b9e0..3cf5bcb5fd57 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 d0bfedd1d875..ca6cf89ce3ea 100644 --- a/lib/mempool/version.map +++ b/lib/mempool/version.map @@ -57,4 +57,7 @@ INTERNAL { # added in 21.11 rte_mempool_event_callback_register; rte_mempool_event_callback_unregister; + + # added in 23.07 + rte_mempool_logtype; }; From patchwork Mon Aug 21 16:09:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130602 X-Patchwork-Delegate: david.marchand@redhat.com 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 0819B430C3; Mon, 21 Aug 2023 18:11:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B7AE432A1; Mon, 21 Aug 2023 18:10:10 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 1DAF743281 for ; Mon, 21 Aug 2023 18:10:05 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bf5c314a57so7959025ad.1 for ; Mon, 21 Aug 2023 09:10:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634204; x=1693239004; 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=We/xZdUAxyM5b7hvcdwbi9lv9krFR0ggEJp9/aOINh4=; b=DQ4E/2XtaOHRCCJFRCjq7dDcLccbRix3iKh7zyFtHImlEtFjd5P+EGQsWPeLdNab1Q x2bJNP/aVqFTtE3kzDFkG2yirWWOXkz7dRAb/60/3A+sXqNAQVoDaJaWbCYxxBxcZR6c teNdqGTVcAgf2qj9XNbO2pSWrLU/tvUK9EokvJ0Dn+Y+WXS/a0YBKFKp24V1bYN0MBjW LDVEchIlqQNJiSWXdWSjv0RYKUSzPp0T2CARQh1A3zITVGmeoR54cQnfRJ5XqhWgo+ks gyEM3dVB6I7Ba4s2cC3vEGS5OlE5/d6FLzEkhOQk896ssAwYmv5pQi2Ogpemx2OBK7K4 LVQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634204; x=1693239004; 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=We/xZdUAxyM5b7hvcdwbi9lv9krFR0ggEJp9/aOINh4=; b=lxeFwhTl3RKXong9z6souKncbYxT00nB3Cqr/tBO0ufJbtEBVw0uVRxGV8i+th6mP0 mlpE3Mj90D1grL6W37Opfjrb6SRtUnWhFOA1JtobbXyWwwwdDWkPa43esGmZXUQStt/N CbwZi0f+vG+E/WhmA6e7LXMke7V4der/S/v8Orprd8nEtKWHdEAi7xRoknLvsOkoIFeW GDdRITc9E91ZJd2OHCMHSBNWPFEgQNx4Tn0cynkU8n209wjvSnQ7dTxlj9hGURijo6Yq O4gSu9HHW3pAlUBLqQ241pDwj6NM82vyQwo/k9mGhDopx7TfyA+5o7iH413P47l5FFu3 aYwg== X-Gm-Message-State: AOJu0YxClUa7LaGumCjQIMbAj9q9o0vRF+ULWnZTWpQByOpfq4Fj4GyL wM6m6RU0TYzWjnSKoT5p/GIrcM73vafNI07hhPy7vA4K X-Google-Smtp-Source: AGHT+IFyzA10eg+l/xUG31cFsDwdVSchw1rP+FgmxFI8A4lYLqIywxv9a4VDAPP4742gBGj5QGNOjA== X-Received: by 2002:a17:903:32c6:b0:1b3:d4ed:8306 with SMTP id i6-20020a17090332c600b001b3d4ed8306mr5983024plr.19.1692634203962; Mon, 21 Aug 2023 09:10:03 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:03 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Bruce Richardson Subject: [PATCH v13 12/21] lpm: convert RTE_LOGTYPE_LPM to dynamic types Date: Mon, 21 Aug 2023 09:09:12 -0700 Message-Id: <20230821160921.383832-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/log/log.c | 1 - lib/log/rte_log.h | 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/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 0c3b20e00a5a..f88e71a59d5a 100644 --- a/lib/fib/rte_fib.c +++ b/lib/fib/rte_fib.c @@ -17,6 +17,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 28c69b38999f..ab1d9604796f 100644 --- a/lib/fib/rte_fib6.c +++ b/lib/fib/rte_fib6.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -17,6 +18,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/log/log.c b/lib/log/log.c index 58184548bb85..ab28edec11b8 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -354,7 +354,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_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 48976fea1c3e..dc2454a0d9de 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ 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 812a2597d117..a62e951a8e0e 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -16,6 +16,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 ae44281ae105..5765995197f8 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -16,6 +17,8 @@ #include +#include "rib_log.h" + #define RTE_RIB_VALID_NODE 1 #define RIB6_MAXDEPTH 128 /* Maximum length of a RIB6 name. */ From patchwork Mon Aug 21 16:09:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130603 X-Patchwork-Delegate: david.marchand@redhat.com 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 88F74430C3; Mon, 21 Aug 2023 18:11:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 84B6243279; Mon, 21 Aug 2023 18:10:11 +0200 (CEST) Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by mails.dpdk.org (Postfix) with ESMTP id 37C0343289 for ; Mon, 21 Aug 2023 18:10:07 +0200 (CEST) Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1bf5c314a57so7959265ad.1 for ; Mon, 21 Aug 2023 09:10:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634206; x=1693239006; 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=pZwcbwfHY6W6f1Eox8va4POCw+h6SuagpoVNXpyy8dc=; b=p+w5DbyBNHpO7VxjFf2wryo5QxFqPGwcI2wxs1xNtPLA/43KlOZTpJuoINudIrpWqC F6bB1/Ji+Jy6584LJiZVZEyKmgbt8uWixOIxkevi5oeG/2c+33dUj3riqTc+iAudYgxv KWusx3YH8c0meYsb0kRmXXSkv2KhuxAzH6wSRJvrqCUW3ANmnyDm8f7dXlyeo9aBnygD jzJ4QA/L0Gs57x/iswROWQP6RXS2DBaEuoMkhrC1B+rRui0LLB/RRKXQBeqW3w09dFF3 62O7enhFbXJl2/6FvEzqAVKb0z6bW3G5M4LHKX4QjkToffs90tbPvuWjAsP4IL7LGjQZ RQFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634206; x=1693239006; 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=pZwcbwfHY6W6f1Eox8va4POCw+h6SuagpoVNXpyy8dc=; b=kZNbiI5HKd53p6lD27sbnU2j2pVJSYGmJv0b0BdRAmzMJgtcnmuIMs10Y3vHDSPzGi QG9ZC1ejGp8cBmcBwaj/VttYDggR9dW2Djqs60FS9OjbtSTKKqvMAZ6QJ47LpTjreAAH P/1gAJIoDwdNZJV4I/AeGCdJDmfHk8Vo2XYPE+Wz79+ZEbueezHEwcgXgA0xt+Eoegln FsxKS0I4lw/DK1bnMWIP9GYu7iCMOBZCNM1cLcehYPZOMwXvDSA3Nbi0nMimjQbxXy6B jtEJw6pWmG1zLTS7iivggnzHP7VUs3M/gJ02XcjRffyE/Op7JnLFkvnldca0pfjAzcj3 L1Qg== X-Gm-Message-State: AOJu0YxrIzpp6SMrfpsKGKrguTSi0UcTul9MKNaG2iiK/kByrMFU3Mpl 9SsABBWGYilV4Tyv0vaqKeH8gXUNIl+fa9/H6fCWMnb8 X-Google-Smtp-Source: AGHT+IG5IN2zMkP80ZUjVR2xAIHzkbUXX1hduxGi9YLYsJVMtiXgYHRJkWGl22eNVwQ0GXgYz6HXTQ== X-Received: by 2002:a17:902:dacb:b0:1c0:8bf3:eaf9 with SMTP id q11-20020a170902dacb00b001c08bf3eaf9mr340607plx.40.1692634206230; Mon, 21 Aug 2023 09:10:06 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v13 13/21] sched: convert RTE_LOGTYPE_SCHED to dynamic type Date: Mon, 21 Aug 2023 09:09:13 -0700 Message-Id: <20230821160921.383832-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 2 -- lib/log/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/log/log.c b/lib/log/log.c index ab28edec11b8..dfaf6f13b007 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -354,8 +354,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/log/rte_log.h b/lib/log/rte_log.h index dc2454a0d9de..f185fcbc5a94 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 751f6cf84197..96cd863b5467 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 @@ -2999,3 +3002,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint return count; } + +RTE_LOG_REGISTER_DEFAULT(sched_logtype, INFO); diff --git a/lib/sched/rte_sched_log.h b/lib/sched/rte_sched_log.h new file mode 100644 index 000000000000..fde051f49d62 --- /dev/null +++ b/lib/sched/rte_sched_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype From patchwork Mon Aug 21 16:09:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130604 X-Patchwork-Delegate: david.marchand@redhat.com 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 B6EA8430C3; Mon, 21 Aug 2023 18:11:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03CB0432A9; Mon, 21 Aug 2023 18:10:13 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 3E6C543289 for ; Mon, 21 Aug 2023 18:10:08 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1bf5c314a57so7959425ad.1 for ; Mon, 21 Aug 2023 09:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634207; x=1693239007; 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=HDOJaQ3nxL/25gZ+u23mdf7sATlAIHEYOdrUssZcwgI=; b=tbL2kKrERgJvTT+64MNitPObvJPvCqT6rwhY1vAOXaVOjy6GIvsZS1s2efA8N2rTQ4 TSchz/Ra7Qir+qke9l6SMV20gq7dwN2u+NrobnfWNgSqqxNNk34E4CeSbIxQYVm2Q8WR NKI56qKpXGgsOS/CS5l1MmQHXRKLnjyn0B9IS/7knpgki9R9tsRZ0am9waA0qzxW1PE0 DuHu+zdykOlGqBA/DaLc9iCkKEzJmlLOGVKozZ37orHtHi5om1NN02PctGN52oOJ0JX9 tWU34wBj1OBWBc4CNd5d/rI1ZXYvlA6deFMxf6et+5eIkYLCmVroQpuxxBQtLVoXYBs+ 3PHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634207; x=1693239007; 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=HDOJaQ3nxL/25gZ+u23mdf7sATlAIHEYOdrUssZcwgI=; b=WMl5EepTpBfzYQzGN0mAtuU7v/nT10FBxNzyBk0b0oWiyxzO2w7GVHGEWz5gEytJoc pHooNHkqQ9YycvSJXAUuI6MQouks6XOGm7Z4WNcyFV/nomVy2tV1vv4CRJLlmAsU+P9Y 3/rnR84AXFHdL7mmislfZkumo3YiF0/qCZyO5rpAQiNsy274jFOwzfUTiamFuvl1rggs mWK+A5FEOtZnYVBDuD/bwYeqBNzHwOprX+/Fp34R1MBikM7rzR4aB72ZV1sWOjXXsV70 fgmXSsdhxBZxHNn3b35XTkih8hXuwl5Z1Nt6/ub/koH9g0l87UpW4cfQu59kznBPBCQ2 V9MQ== X-Gm-Message-State: AOJu0YxG7EoH2UbpD2A/IfK5v8P+UEnLCc8J7NkuHoq3G1/2cH618+c9 70sDB4ylxURtQd+bRbxtNbN4QeEUOlmlmsGqApaeyQ3k X-Google-Smtp-Source: AGHT+IHpHedrR5wpFLt7qS8Y1yD8UD0wmlY4NtBUtQpNC0Pc6KvVrMXOENRhy75wjjh9zpR7MzbGfA== X-Received: by 2002:a17:903:1c4:b0:1bb:b91b:2b3c with SMTP id e4-20020a17090301c400b001bbb91b2b3cmr5496273plh.34.1692634207239; Mon, 21 Aug 2023 09:10:07 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:06 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Akhil Goyal , Radu Nicolau , Boris Pismenny , Declan Doherty , Aviad Yehezkel Subject: [PATCH v13 14/21] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Date: Mon, 21 Aug 2023 09:09:14 -0700 Message-Id: <20230821160921.383832-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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") Acked-by: Akhil Goyal 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 6ae0e49fd7f8..c4bac17cd77c 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1128,7 +1128,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; } @@ -1136,13 +1136,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) } else { /* outbound */ if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TX IPSec offload is not supported\n"); return -EINVAL; } if (tso && (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TCP TSO offload is not supported\n"); return -EINVAL; } From patchwork Mon Aug 21 16:09:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130605 X-Patchwork-Delegate: david.marchand@redhat.com 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 F2580430C3; Mon, 21 Aug 2023 18:11:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30DA9432AF; Mon, 21 Aug 2023 18:10:14 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 3635F43293 for ; Mon, 21 Aug 2023 18:10:09 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1bdaeb0f29aso21102755ad.2 for ; Mon, 21 Aug 2023 09:10:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634208; x=1693239008; 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=5dgl8/02P3Gk8ikMlS19AFOhQGSwpUXpjiuDBxHtU9Y=; b=Gomg2HaP5p1+bgX8EYQG8mRxjqatY8F8MMZp8ylHYPkQwgvV/ZvpkGZC5X2agsgu7a S5s+lkX6gU06nqSkAaTuZUNDmeX5U6obcX7Jifgr9rAnsWWRmkhXRXAR16fn4W/8z+jE LKeRDB9qCK97ogvkI+Dgv5zxob3oVciBpc+QTfvlrh8O0RMwgbNxiynWq0HGhR6ArLPH x+/j1oV/Bly81bdUyxbpJkgHMnl7JRjwUMyyJbFXHIxyTCj4xeNmB3t+ZF6cP++n2OeZ +qW7cWq+35m55e4cSCIYe7vymCRlqaWGhGDWXI843snL/xvIhQBCXJWYtrnFrC6eTVZU cRSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634208; x=1693239008; 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=5dgl8/02P3Gk8ikMlS19AFOhQGSwpUXpjiuDBxHtU9Y=; b=BKBJAJ+he8FS/3lJzOZM3r/YuSuolNRsuJ/4eRKo1ztG/4V4RGFUtt7XGX8Lo8vGM8 UyIkhUIgUoH83OHbukecqGFiWUTRe1wYmn+LGCkVkr1LHDB/wyeZPz74mHNzE2trOpvC kWdAtvQ4gyWtkZK2Xk/IdPAt/JjZC518npfpZpENHJDyta5NW8Ia9/HPIJZeMhFk3enk H6EYpnP9o/2cqoM2CO/Wvc9Aiis43/ezO2SYJm3SlC4EBJZuEPvHASZX7Pg7xBsPUk5y PCeZNnnf32mqPHqLC9fQhzdJUDdsnntzfHH+rmpxp4Arm915FjHWH4j+BcvhQWQDIY2c E2LA== X-Gm-Message-State: AOJu0YztygtTcXRK+xBJfYrYfZAtBw+A/mNOHAGvzUraM63+iHzyXtZc L7P5M49gL6DW9zXvvc0vVlxybmVCCvoQgK6i2mh2FHq3 X-Google-Smtp-Source: AGHT+IENodPLFsis1BK17bDt39Pw61cHQeRL+TUqtl3TPXhzhhkOq8G4e3TGZ2rOHlqqG/UGbYlF0Q== X-Received: by 2002:a17:902:c3c5:b0:1b8:9b17:f63d with SMTP id j5-20020a170902c3c500b001b89b17f63dmr4989728plj.23.1692634208129; Mon, 21 Aug 2023 09:10:08 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:07 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v13 15/21] port: convert RTE_LOGTYPE_PORT to dynamic type Date: Mon, 21 Aug 2023 09:09:15 -0700 Message-Id: <20230821160921.383832-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/log/log.c | 1 - lib/log/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_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 +++ 11 files changed, 29 insertions(+), 2 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index dfaf6f13b007..c089fc66affe 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -354,7 +354,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/log/rte_log.h b/lib/log/rte_log.h index f185fcbc5a94..b11aec69af78 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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_ras.c b/lib/port/rte_port_ras.c index e5de57da42ea..5a610b1ba5b5 100644 --- a/lib/port/rte_port_ras.c +++ b/lib/port/rte_port_ras.c @@ -9,6 +9,9 @@ #include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX(port_ras_logtype, ras, INFO); +#define RTE_LOGTYPE_PORT port_ras_logtype + #ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094 #endif diff --git a/lib/port/rte_port_ring.c b/lib/port/rte_port_ring.c index 52b2d8e557f0..32a90e836579 100644 --- a/lib/port/rte_port_ring.c +++ b/lib/port/rte_port_ring.c @@ -10,6 +10,9 @@ #include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX(port_ring_logtype, ring, INFO); +#define RTE_LOGTYPE_PORT port_ring_logtype + /* * Port RING Reader */ diff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c index 8a7d815ef323..6e0a8aba5419 100644 --- a/lib/port/rte_port_sched.c +++ b/lib/port/rte_port_sched.c @@ -7,6 +7,9 @@ #include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX(port_sched_logtype, sched, INFO); +#define RTE_LOGTYPE_PORT port_sched_logtype + /* * Reader */ diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c index 7d73adc1e79e..e9cdadbceb8f 100644 --- a/lib/port/rte_port_source_sink.c +++ b/lib/port/rte_port_source_sink.c @@ -15,6 +15,9 @@ #include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX(port_source_logtype, source, INFO); +#define RTE_LOGTYPE_PORT port_source_logtype + /* * Port SOURCE */ diff --git a/lib/port/rte_port_sym_crypto.c b/lib/port/rte_port_sym_crypto.c index 295984d025cb..77a2f04d65f6 100644 --- a/lib/port/rte_port_sym_crypto.c +++ b/lib/port/rte_port_sym_crypto.c @@ -8,6 +8,9 @@ #include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX(port_crypto_logtype, crypto, INFO); +#define RTE_LOGTYPE_PORT port_crypto_logtype + /* * Port Crypto Reader */ From patchwork Mon Aug 21 16:09:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130606 X-Patchwork-Delegate: david.marchand@redhat.com 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 24236430C3; Mon, 21 Aug 2023 18:11:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 763CE4328D; Mon, 21 Aug 2023 18:10:15 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 415ED432A2 for ; Mon, 21 Aug 2023 18:10:10 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1bdaeb0f29aso21102975ad.2 for ; Mon, 21 Aug 2023 09:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634209; x=1693239009; 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=dxfCJ8JCP4HHGFPNVjC7sgPW8L8L1EzHthHSsCbcwEw=; b=nQ0laaNd+e9g9UIBOB3zfW6cRULKzwZ6Capfs2gQPDUDdFTROCwigRnXXlDsiunh6P hAvvcbP9dFVODpMLOvs0U8KmjOPlvwhjvpmDhYctrzq4/84Uhn4ra7EYSyDmN6bORhOI Tl4GOnZwslLRSzIp6Watdxhu6bk1QUkTNA0QkxzcY5FVpTKko3aG9AfLEhD0a1Mp4YY7 JkA9Van1BGDsbIiywFVjvl+QlSjyvot6F7Tjzr6G+/vyoi1MEFd+P7whc0YhhdeTEVOw EVIh64OdSGwLQOoMPVC25fh+PSrLu4Y5dR9iI1BjglIjglj8Nv8w0ZRfLE3kzEIfSsZ4 zweQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634209; x=1693239009; 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=dxfCJ8JCP4HHGFPNVjC7sgPW8L8L1EzHthHSsCbcwEw=; b=FSVu7nYvWhKygeQJVxoKLBgYR8QTvYJlVddtfSDrbbrTbnX2IRbkGY3u4IaxbxaoFm eG19NTVtvcEgyeL4BTEdPir33q3eNyyb82fDMiJ4oLcL3iy2V5O3cXUnf2HpSDndQa2J VCbyP9VIwzzH7ISSGgWdVQxYvvY5XtVLNPOIFvzL8hhDY2v9bH0uwA++Rvezbum/fVUk BX2RJZlR4yAjaQnXs9xURWvZmbddgiQnFQgyV15ZcEx79ZZVDOI/65QyDvOk5g6zZ/ct H2ADrnlLeu4gUzpX5Vidt4uJKEjbtMtIcd0eF1Eg7SNmqWVZFvJ+eAaTUH4aN7pTG6T6 06qw== X-Gm-Message-State: AOJu0YzXUqmfn0GBtmbEYIKimP5a98t3tDUXbwC2pQw4gw1mllOgSnPO 56thntSvB+RDbEuIiNpv5jEhqErQO+ZkVc5qF4BJLk1E X-Google-Smtp-Source: AGHT+IF2Pi7fRtC5apfOi0DhhXSigYmnpXda5Zx5lTt1LnRTNq638BdAg6uxo3yNkxG/xiV6vH+mng== X-Received: by 2002:a17:902:e884:b0:1bb:dc48:644a with SMTP id w4-20020a170902e88400b001bbdc48644amr5917281plg.49.1692634209250; Mon, 21 Aug 2023 09:10:09 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v13 16/21] hash: move rte_thash_gfni stubs out of header file Date: Mon, 21 Aug 2023 09:09:16 -0700 Message-Id: <20230821160921.383832-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 | 30 ++++++++----------------- lib/hash/version.map | 4 ++++ 4 files changed, 67 insertions(+), 22 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..4fc92984077e 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,13 +9,14 @@ extern "C" { #endif +#include + #include -#include +#include +#include #ifdef RTE_ARCH_X86 - #include - #endif #ifndef RTE_THASH_GFNI_DEFINED @@ -38,13 +39,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 +63,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 daaa9a8901db..8288c6e7967e 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; From patchwork Mon Aug 21 16:09:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130607 X-Patchwork-Delegate: david.marchand@redhat.com 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 BB1D4430C3; Mon, 21 Aug 2023 18:11:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 98C57432B1; Mon, 21 Aug 2023 18:10:16 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 4B08A4329C for ; Mon, 21 Aug 2023 18:10:11 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1bf55a81eeaso10526995ad.0 for ; Mon, 21 Aug 2023 09:10:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634210; x=1693239010; 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=29zSp5QQZDR8i9eDwDM8kGdPdjyl1/FORyCUzyk7YZE=; b=F6uDdcML1aV8Fedahmz9KHXRWEsdvE4PyxkRNSRENu6uzOXY0GcQGJMRo9ZKOMsJgU rHLwo+ipPiitlxrWBJbzdjj/UzmfmVHok3u39KSZ+r66vWILgJL6NC4ZrHhJXdvw4bP8 vbi7Bd/F84btbam98LGe4Mqdl63pd5NI3zX52OxIiSDQiAl0PU4gigAKHJ5chYfuarR1 Oq7MNpgmaI57GgGqsOMS0x7ULcVsw6f4VFmpKWUcEjKlOb63YesFEyqZ0wLSwscbEjZv uM+lmXpq7QTmcygWvaKPmBqt42VdeT5DhTm23h9nwIPazXHiNXmfQ2UuSYrMnptopePe Aopg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634210; x=1693239010; 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=29zSp5QQZDR8i9eDwDM8kGdPdjyl1/FORyCUzyk7YZE=; b=Y32qZ58yANbJ2Ggt463KUdExlKYghwKPBGyG1xIqNOfQ9s8RvcPdc1omGGpY7rN/Jh B9AkCqRhe5KWRKl/+mPPOvpNFThc0Gy4k5iKXfDvb5hVcXXEV9J6vHCHxjSFJT4o3c29 ViA8Gz5xBbnbEo2JPyNOdMNnVv5pE6ny1z19t8K/eEbAOAUMnMcA12SYtLe4jr1lwtIS +e3FxOdqv8dU7H9G4BWROu8Jby7qv4OoQ+l8/fIHP3/D3cZ+OS0HixTSEDe8dRsAEog4 nYek9ue6E5W5+li0e436iCxWgINjp9sTCE5nxF5wISyaFmAJ9HkFzE6xu1QB7NM46P+e 4edg== X-Gm-Message-State: AOJu0YxMZooE7ZV8SSZoW68RUX12B2IKHd0rR1jtSp1nFKD+DuheKkvu cOF7l8dtuec6Y2eCwiU7ZmupHtAcGiYxZ3rjmAiDRhD9 X-Google-Smtp-Source: AGHT+IEAdm157KNsBdMBhgUtmxqq90O5+oGsQcoNmURSr206Dmq8kZuEi/Z5w9J+EKMOyo6OM7ndpw== X-Received: by 2002:a17:902:eccd:b0:1b8:5b70:2988 with SMTP id a13-20020a170902eccd00b001b85b702988mr5104162plh.30.1692634210221; Mon, 21 Aug 2023 09:10:10 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ruifeng Wang , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v13 17/21] hash: move rte_hash_set_alg out header Date: Mon, 21 Aug 2023 09:09:17 -0700 Message-Id: <20230821160921.383832-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 Acked-by: Ruifeng Wang --- 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 60bf42ce1d97..8ad2422ec333 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" @@ -52,48 +50,8 @@ static uint8_t crc32_alg = CRC32_SW; * - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default x86) * - (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 8288c6e7967e..a1e68036c5b8 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -9,6 +9,7 @@ DPDK_24 { 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 Mon Aug 21 16:09:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130608 X-Patchwork-Delegate: david.marchand@redhat.com 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 A9A69430C3; Mon, 21 Aug 2023 18:12:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 23852432BD; Mon, 21 Aug 2023 18:10:18 +0200 (CEST) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 4992643295 for ; Mon, 21 Aug 2023 18:10:12 +0200 (CEST) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1bdca7cc28dso27171385ad.1 for ; Mon, 21 Aug 2023 09:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634211; x=1693239011; 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=dp2sKZAUJiFJEpSNsnpsQCoeXrioe+3xH+HBOtAZGp4=; b=dX/D9A79Dj7putfkd/fyo+uwhIinVi3YZ/+tqa8kA2CH1J5GKBjjflyeRAPuYlqEdn 6TiisrYOFoodHt5IDxdEA6ox6J/OYiitr8xve/Ta8kxFCRUUqpUuDmsGdWAmY74KjUYc dkqK5YmXTtUpHj3qOfI5GLw27dbky8f7li5QntodLTKE71qwSEwSBaYK3GtGLbO0o+mq aF/vboKOyB6BNEiraKuKQ9PdD2uXVvMiN1mQRUzPbV1MdsYWe4EjktfWfN+DMhqFdhgU Nz9VWbmkPdOLzETJiE+/fzElwPQEPx3afRy814mG5Y0iR/jF0GMsif55xdbTXcm/FS+D qdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634211; x=1693239011; 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=dp2sKZAUJiFJEpSNsnpsQCoeXrioe+3xH+HBOtAZGp4=; b=foeOOnfludnN3jRO9cXUENfFa6vGytFSCzX3TH2ynnwcHlZBPutakT4Lxve6HWr5D0 boa5+tTz72y48fliyEA/fQB+FOeKrwTBQofPEiIXZR+HKG0P4LQYfgfSJdkwTcK59mEP d5XCn/lgTyf2rtwJuPLq7p/lpDW1SKiQYGsWt9j+u7bNgC81Eice2TsE0gGj5w9QCwed 6RzI4RLGTAoyQ8+E+RIeB5Tmv2RvLk3Mye7FcquKV57Kh5656xQe2+HZhbx7KbosACGu gKYfhIH1Uctteb16ZQxx2HZLBXYrBvK891jLz229oly3w17jqa8mnlFNQX9MBQibRdU8 MgYQ== X-Gm-Message-State: AOJu0Yyq/pKoQf8aPEXanoDjFaoAnerp5gAMjsSOKHeByhLsBLWSnMr6 OplRsv2o2WfDIkpdB7eLb+pMJfJ8voXVqTRyrBjFrhPX X-Google-Smtp-Source: AGHT+IEDLg2l2ccnPGDJrYyb6qFA5M/QvhuBSauBwhJfVduMvoRYoBm73r1eYWWdzuIkve7/doutlA== X-Received: by 2002:a17:902:d511:b0:1bb:ffcc:8eba with SMTP id b17-20020a170902d51100b001bbffcc8ebamr9170156plg.58.1692634211282; Mon, 21 Aug 2023 09:10:11 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:10 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v13 18/21] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Mon, 21 Aug 2023 09:09:18 -0700 Message-Id: <20230821160921.383832-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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/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 +++ lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index d92a903bb39b..98d4366770d4 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 2228af576bb9..fbee0b2188e5 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) diff --git a/lib/log/log.c b/lib/log/log.c index c089fc66affe..3ce9300754dd 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -353,7 +353,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_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index b11aec69af78..4d1b892ab689 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 */ From patchwork Mon Aug 21 16:09:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130609 X-Patchwork-Delegate: david.marchand@redhat.com 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 4A149430C3; Mon, 21 Aug 2023 18:12:13 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43A5A432C0; Mon, 21 Aug 2023 18:10:19 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 2BFA0432AB for ; Mon, 21 Aug 2023 18:10:13 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso21165365ad.1 for ; Mon, 21 Aug 2023 09:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634212; x=1693239012; 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=vR3mrqqAkYPeQ5D4xSTp2AoFwVEPhM/mBGAEMW4OTGI=; b=L2uTb6CS+BkzvnIaH9CREEh6CpBdRqvnBcNp9wIU+XJVq/CPQAydCz5lxy69sdnrIQ lcOnVjgz8q8SFisLZcWk09w+FXxdyVmmoXahKLx9WpqMyZsXGs0X1VTxNOoi4v/QOl8j 6e+d0UJvspLmkWID5SZRU4EdLGU20KGO4gNabCQ8gS+kFISDrVrFuYrtgmv1BRT5E+YS XgpRIPpqiX2ABHaSC5m9WA9+8UfW/GWomkP5vO3/meZ9dGJKH/C3PA6/0eGcsFxeOT8r rN6GBUWhqimhoFEuhA2yyCzp841pQoyak69Ab2chsUsWWfElczVpjf//hu2RUz9Y4k4q qibw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634212; x=1693239012; 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=vR3mrqqAkYPeQ5D4xSTp2AoFwVEPhM/mBGAEMW4OTGI=; b=YtPjd78Q4Y8Yba+9eBJSR6TA+MSQj+Jq5Qz/jjNjwAG1kRLjlg0Wr4tsd6BvxXbrR0 7zpCY08A+2lRO7eaeFHY3YlE4zbLfeAPgz48wTPLJ8dYX4X87kG12Ti3Yf86Prm6UKCv P0cJRIQEYc6aLe+EEBNzlQ4UtjiuYVomfpw5JnvzJQPFV1e9JjCLAK15pYM6gjk5Dcry zIzBfUg3HTWg4oFrmBmUlSPBoNHbABabO0WnAhzBX7KxdGnLBW1imSJAt5WdjTtXIw2v N1gmppYVFm1IbsuKLAV5/LwVZi7qF5j4AUTP3CSvVPZiYL8oDu/LAPbwToO84mcAsfFb Y3xw== X-Gm-Message-State: AOJu0Yz6+s1XxcszPL0hTdWJignIZdaduTfJJOJZ8A+EU6exqcz2xwqC LlDhjBdNfZijvGvEolloMRDgZak9gQ6CSGj9AdR7OM7Z X-Google-Smtp-Source: AGHT+IG3eM2ILoCMRH+3XxGb1d1MpocTUqD7uts964pGs5UeLKmRWU1tDkbZBE4yYVgkCeShjsNTaQ== X-Received: by 2002:a17:903:4cd:b0:1b8:c6:ec8f with SMTP id jm13-20020a17090304cd00b001b800c6ec8fmr4523666plb.46.1692634212182; Mon, 21 Aug 2023 09:10:12 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:11 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v13 19/21] table: convert RTE_LOGTYPE_TABLE to dynamic type Date: Mon, 21 Aug 2023 09:09:19 -0700 Message-Id: <20230821160921.383832-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 Make an alias for RTE_LOGTYPE_TABLE in rte_table.h and use it. Signed-off-by: Stephen Hemminger --- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/table/meson.build | 1 + lib/table/rte_table.c | 8 ++++++++ lib/table/rte_table.h | 4 ++++ 5 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 lib/table/rte_table.c diff --git a/lib/log/log.c b/lib/log/log.c index 3ce9300754dd..1ad2f80e67cc 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -353,7 +353,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 4d1b892ab689..6418479ee266 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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/meson.build b/lib/table/meson.build index f8cef24b5918..e753b6fb23d8 100644 --- a/lib/table/meson.build +++ b/lib/table/meson.build @@ -7,6 +7,7 @@ sources = files( 'rte_swx_table_learner.c', 'rte_swx_table_selector.c', 'rte_swx_table_wm.c', + 'rte_table.c', 'rte_table_acl.c', 'rte_table_array.c', 'rte_table_hash_cuckoo.c', diff --git a/lib/table/rte_table.c b/lib/table/rte_table.c new file mode 100644 index 000000000000..4a083f4aaf0c --- /dev/null +++ b/lib/table/rte_table.c @@ -0,0 +1,8 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation + */ + +#include +#include + +RTE_LOG_REGISTER_DEFAULT(table_logtype, INFO); diff --git a/lib/table/rte_table.h b/lib/table/rte_table.h index 9a5faf0e323a..39654e51e8b2 100644 --- a/lib/table/rte_table.h +++ b/lib/table/rte_table.h @@ -264,6 +264,10 @@ struct rte_table_ops { rte_table_op_stats_read f_stats; /**< Stats */ }; +/** Internal Logtype used */ +extern int table_logtype; +#define RTE_LOGTYPE_TABLE table_logtype + #ifdef __cplusplus } #endif From patchwork Mon Aug 21 16:09:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130610 X-Patchwork-Delegate: david.marchand@redhat.com 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 71174430C3; Mon, 21 Aug 2023 18:12:20 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CA58432C4; Mon, 21 Aug 2023 18:10:20 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 340AD43265 for ; Mon, 21 Aug 2023 18:10:14 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso21165455ad.1 for ; Mon, 21 Aug 2023 09:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634213; x=1693239013; 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=kbfTE8GmKf18LycBRdPgbJ+fPLWnYmaV3T6FArzes6o=; b=D0j8ZMVCannv8UoDlVQtHg9sewEr4b3b9+Wtoem6fy7I4+jraXzHblj8eqZzlwkW38 1GDwwBG4z23O+RrB1XM6mrnfgPhRqWL/J8G9ZiPYj3pNP25OR8XX0vKTjTiXOKTOs6r/ a/+OzWENFRR1CHrIaS+T4QhfbaJ2Z0gkoZMqUSky1DaKo7dza82VdjL5Lq7JHbmlE3HK zkD175s7BRfFyDlnR3GRX7x1gkB8Qk+nlZdT0gG7sZ7EMdrjezbcEmODYFLgYhrMveIw EvIOaEhvB7IQa7X7DRMUbNE7dpdCRagvk5wbuB5A2G0XOYm0iO9pCuSylJ75K6FktlHp 1EDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634213; x=1693239013; 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=kbfTE8GmKf18LycBRdPgbJ+fPLWnYmaV3T6FArzes6o=; b=UPkSgSWvGA75vVUMetYtw1C6fzSmSzcvhaRQzkl9D/mUTdxJCnfBVc9IugYHkRtAkp 3cEH+VIBOy3cQtOLc0zklYqf1/wRXiJq21X33O6+nDCEau5QoXcPbn+SmO2zOttuxuxi +A3cxNQoERTEAtCE1ljMa8GND3e7CtSCltTJ0fyKjEpxJtVJsttmjM4afljpZw0faspV XxXw78ei3b8ZMtyj0BEE+sugwtp6MmlTyLxWsQWB+3UQXUA7xYLQJ21mX30zqJHOLYaS yXUD3qKsY4CRWMCH3F7oKNIfBKfcTVX5xr++KN56UpCMZeVRuDz8cJ1q5k6rm94NwwFA 6NsQ== X-Gm-Message-State: AOJu0YwvSPyOnSETg2qS84BOgMwBtqrKTz+JyeYSH5RJ4s+CgGfqtgxu wPMCMa9JjAO0GJ6Ov099Xkj5GTZUuJviftammxn8hIYl X-Google-Smtp-Source: AGHT+IELOd39HOpEAWhbNVL1j/6Bow5YdpusNM4n1VYgKC0gcBsz+KBQKck0P6yAr5fNb9p5fGS/Sw== X-Received: by 2002:a17:903:22cf:b0:1bf:1320:9743 with SMTP id y15-20020a17090322cf00b001bf13209743mr5825719plg.45.1692634213078; Mon, 21 Aug 2023 09:10:13 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v13 20/21] app/test: remove use of RTE_LOGTYPE_PIPELINE Date: Mon, 21 Aug 2023 09:09:20 -0700 Message-Id: <20230821160921.383832-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Instead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog. Signed-off-by: Stephen Hemminger --- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index e66f06b84d0a..dff9bddfb948 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -346,7 +346,7 @@ setup_acl_pipeline(void) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss = NULL; table_params.action_data_size = 0; - RTE_LOG(INFO, PIPELINE, "miss_action=%x\n", + printf("miss_action=%x\n", table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs), @@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret = parser(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret = parse_cb_ipv4_rule_del(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule " - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + printf("%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], mbuf); } @@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets for ACL test, " - "expected %d, got %d\n", + fprintf(stderr, + "%s: Unexpected packets for ACL test, expected %d, got %d\n", __func__, expected_count, tx_count); goto fail; } diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index 7adbbffbf55d..960f730cf20d 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include "test_table.h" @@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p = rte_pipeline_create(NULL); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: configured pipeline with null params\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_1); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with NULL " - "name\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with NULL name\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_2); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid " - "socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", __func__); goto fail; } if (rte_eal_has_hugepages()) { p = rte_pipeline_create(&pipeline_params_3); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with " - "invalid socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", + __func__); goto fail; } } @@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; - RTE_LOG(INFO, PIPELINE, "%s: **** Setting up %s test\n", + fprintf(stderr, "%s: **** Setting up %s test\n", __func__, pipeline_test_names[test_type]); /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } ret = rte_pipeline_free(p); if (ret != 0) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to free pipeline\n", + fprintf(stderr, "%s: Failed to free pipeline\n", __func__); goto fail; } @@ -245,7 +245,7 @@ setup_pipeline(int test_type) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count) int ret; int tx_count; - RTE_LOG(INFO, PIPELINE, "%s: **** Running %s test\n", + fprintf(stderr, "%s: **** Running %s test\n", __func__, pipeline_test_names[test_type]); /* Run pipeline once */ for (i = 0; i < N_PORTS; i++) @@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret = rte_pipeline_flush(NULL); if (ret != -EINVAL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: No pipeline flush error NULL pipeline (%d)\n", __func__, ret); goto fail; @@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0] = 0xadadadad >> (j % 2); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + fprintf(stderr, "%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], m); } @@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets out for %s test, expected %d, " - "got %d\n", __func__, pipeline_test_names[test_type], + fprintf(stderr, + "%s: Unexpected packets out for %s test, expected %d, got %d\n", + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; } @@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table = 0; if (check_pipeline_invalid_params()) { - RTE_LOG(INFO, PIPELINE, "%s: Check pipeline invalid params " - "failed.\n", __func__); + fprintf(stderr, "%s: Check pipeline invalid params failed.\n", + __func__); return -1; } From patchwork Mon Aug 21 16:09:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 130611 X-Patchwork-Delegate: david.marchand@redhat.com 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 83932430C3; Mon, 21 Aug 2023 18:12:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6B9E9432C8; Mon, 21 Aug 2023 18:10:21 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id F403A4325F for ; Mon, 21 Aug 2023 18:10:14 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1bbff6b2679so20706955ad.1 for ; Mon, 21 Aug 2023 09:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1692634214; x=1693239014; 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=5QpS2aq7y2KYjYCTgCBECHh7W/wSiiYmqYOUGkUrWko=; b=uOw/ZNgcT6bXUzBFAI3swtix/EFonWtdF4iDVhKmyFpPwW3WKLcjhXs9ROL+Oceu2e GQagGs/DWOECccvi81SHL9JJ7w3Bhqxc1NZNdx2iWbB/Rf4ZGY6WBYQCWbs9Q1ohZ5pb s6rYUm22bJ+vs/O7MLpgrWL4gJlOr+ZZZ/f4cPNLG66UE0kcxAkWk02cliAGnYez4wGy eRk3xGorGlB+sIquRWxhJqfvxRsKqNdp13fxBiAHrSE8WRDczH3s+jdRz0OD7CmwlTLV I6wBkDFG/d1cbjoMNAmxfDu7gV/wBGYAg7g9qmzzJgEaiz6bPZns6h526nOkww/G84D8 ONew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634214; x=1693239014; 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=5QpS2aq7y2KYjYCTgCBECHh7W/wSiiYmqYOUGkUrWko=; b=FV1ASIiZ2pBrFs6XTrQR6akfnHyHxtoRSNiTKbHuq1h8Gz9FRuzglY1gNWuViG+rni qUScCDy+oPx/ZNy1irHEruhAhWovyNW0l47mZQMQbDlb7ixZUk57G+hww5/y7GvfuaP5 4u+Ld7SPNhRrz1l25J4h6Jc7KBiIINxIWoRRAgn6XP11KrUZ+fKrKM+HT9SctX18O0tj UnXdSP5mJ+pb8GZsMBMGGHf//q2Lpb8iFCEDI4HWHWs6l6CaveLaJTCVUfet5885S/UO AIMXx2fDEuW14VmC8EUgXjjmqkYfvOZtC8qdbZK9JRqkf5Hdj6lIUGu2qPJM6+R6Spy1 Tfig== X-Gm-Message-State: AOJu0Yx1OpiYpyJgyuiKdVIkGdYcpmkbO1to6Gent54GEftQsasXoQY/ mTKOyaLoMsa5bZcCthKiUuC7HFV0ha/llb02QB+JGovq X-Google-Smtp-Source: AGHT+IHTG8bXrVowM1XrnlT4HHhThFxCXWimidiSIkzDuIMPhLr7E8oQSiUOdfP6KYQ+CMnduG5TEg== X-Received: by 2002:a17:902:6bc5:b0:1bb:9bc8:d22d with SMTP id m5-20020a1709026bc500b001bb9bc8d22dmr4494700plt.16.1692634214016; Mon, 21 Aug 2023 09:10:14 -0700 (PDT) Received: from hermes.local (204-195-127-207.wavecable.com. [204.195.127.207]) by smtp.gmail.com with ESMTPSA id i1-20020a17090332c100b001bf2dcfe352sm7208159plr.234.2023.08.21.09.10.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:10:13 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v13 21/21] pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type Date: Mon, 21 Aug 2023 09:09:21 -0700 Message-Id: <20230821160921.383832-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230821160921.383832-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> <20230821160921.383832-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 RTE_LOGTYPE_PIPELINE to a dynamic value. Signed-off-by: Stephen Hemminger --- lib/log/log.c | 1 - lib/log/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 2 ++ lib/pipeline/rte_pipeline.h | 5 +++++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/log/log.c b/lib/log/log.c index 1ad2f80e67cc..f58e40e6a9f8 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -353,7 +353,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/log/rte_log.h b/lib/log/rte_log.h index 6418479ee266..29db07881a5a 100644 --- a/lib/log/rte_log.h +++ b/lib/log/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 1fa9f9c47eda..6b937cf782ac 100644 --- a/lib/pipeline/rte_pipeline.c +++ b/lib/pipeline/rte_pipeline.c @@ -1608,3 +1608,5 @@ int rte_pipeline_table_stats_read(struct rte_pipeline *p, uint32_t table_id, return 0; } + +RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO); diff --git a/lib/pipeline/rte_pipeline.h b/lib/pipeline/rte_pipeline.h index ec51b9bfaadd..9fd40566a80f 100644 --- a/lib/pipeline/rte_pipeline.h +++ b/lib/pipeline/rte_pipeline.h @@ -833,6 +833,11 @@ int rte_pipeline_ah_packet_hijack(struct rte_pipeline *p, int rte_pipeline_ah_packet_drop(struct rte_pipeline *p, uint64_t pkts_mask); + +/** Internal Logtype used */ +extern int pipeline_logtype; +#define RTE_LOGTYPE_PIPELINE pipeline_logtype + #ifdef __cplusplus } #endif