From patchwork Wed Mar 29 23:40:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125593 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D572C42868; Thu, 30 Mar 2023 01:40:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12B2F42B71; Thu, 30 Mar 2023 01:40:58 +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 1E16E41138 for ; Thu, 30 Mar 2023 01:40:57 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id ja10so16487848plb.5 for ; Wed, 29 Mar 2023 16:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133256; 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=unxZs94JjtRtjLD/agARiK/DjnEnz3wdbp3vV06jQc297wzO4zKVUlDQyhLKeTBDlX l0gO68KteWc2/VRBJKJsnxqASTd4G5yg8NtfUConjMh0G7yXRVomnHJRj3x1qcDNDBNH fA86/37DQUulhny4tdbGbLTbYNP4QXrlmX5nBGjXrhw00X61FzjdwCds5j2ufTubmXKx h0KXIU2EyqadtdagY6VpffeaGQDEm+iHvPABNV56kJllsUCLVIzEsWEboanggToAE6UC GgG64Qi7dPJ+haWGX5BaDWU2YZCukDfJ3qcfiTDg/dJxEgTk7tZ0hap2uinM+1TXXNNs n3sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133256; 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=Yi6fXAYwYzNcGwVz1ngsDfOso1DE4Wb8e63NQb3/fE3sYoANqNwJigACsFjy+Fdfq7 2PQQ9WpmhxKgvk7ejmNMOQe50lxHL2dJ529fATHr31LTvZ1W/FY9iuak7JlMe6EU8xK3 9MSOKUe2xIUknbrM6rI5fSg+wfzWp1gmU7eJ2Cj4NUWCkCLzKSQpigX/SZr3n/vCjiev cys7uRoSMn4tYIkzMTADT72SoVCwQyT/Naz/hQt21pK+5mBcq+jL9Fn4kiBngjAJRn5y K1vpz5NXi0ejpWTSEZBK8ef25SMxomXFxHghfO8T8R7HBDi00/KRhUlhKwKFZpYjLHUW mzdQ== X-Gm-Message-State: AAQBX9foD7oEYE6AXZdDclmHEqXb+jAlQRjVzWzTnWqVx9r3y9+0bALx dTHjLHMOJVffsKQ4VW43cOUTdBOCk7fukb9PzeFtgg== X-Google-Smtp-Source: AKy350YZ5Fdcbji9+72mcn3Eq83iH259aFfux8II74kF3k2iwiaqbJKX0Ov6RxKEwjGQOHsq1uxNNQ== X-Received: by 2002:a17:90b:33c7:b0:23f:35c8:895 with SMTP id lk7-20020a17090b33c700b0023f35c80895mr22002166pjb.32.1680133255963; Wed, 29 Mar 2023 16:40:55 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:40:55 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jiayu Hu , Mark Kavanagh Subject: [PATCH v12 01/22] gso: don't log message on non TCP/UDP Date: Wed, 29 Mar 2023 16:40:28 -0700 Message-Id: <20230329234049.11071-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 Wed Mar 29 23:40:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125594 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EA46A42868; Thu, 30 Mar 2023 01:41:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36C0342BAC; Thu, 30 Mar 2023 01:40:59 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 0A5DA41138 for ; Thu, 30 Mar 2023 01:40:58 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id n14so625588plc.8 for ; Wed, 29 Mar 2023 16:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133257; 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=XlN6YmU2ymHyZPUdj6f4T0YJn98/RgYo0/MmgXUjfOU=; b=1jsWbS2X+srHKQwUQbxLhg3EwNZoA1ZAhhBgWvBrsaWggvJ+umJOmymHH6IrSKnUXt CymuSMj+Odb4hxb/HO1b92N6K69c4Er+6DqsyFB/aasPtZKAIIHoqQFszGALSaphVlJv lzlhLODh8sD5hs9QLJ7j9vMsUp7c7rqViIewgBFqD4cGe6oM13apMLhyoXfpfchBcg0S AonGnObYeTPgCJhe0TOmzj/ShBVRYtf1BeZPDeYBN1kVf4JJo9oQShsnAuHQv9Hr4QoN 64NY57pQ1cAaIL+lt7cUrrbFSoEFx02xHXzwOXCo+jPzCAIK3ItJjW2l48pbIE0+vEEZ og6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133257; 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=XlN6YmU2ymHyZPUdj6f4T0YJn98/RgYo0/MmgXUjfOU=; b=VwpuuuVLuVqabPj8JbFdLRQ9atyZYJBER9HBxoLS1joLrEUF8fDMk1nNyjIrklcUqD dwjH1Ter/D5SiKZFwPOOmG/3va64q9AHd/UscwLwgerdEEikrlKFVpp9d9fgoM/ciDw5 xosq/32Tljm0HF9dn96GxnIm2WnzQkDzCG9LhSc3/kaE0hOrTMeCtG2k/NYJcl/fTKFa Ksa5udDMtxlQBob4PuTng9ABZhtcpLhZSvFCfWYOaUzdsBOIK11JzUE6wwYBHA7SxQvQ TB2Zi4FnpntCGiFos8Q2XdEgY8mAfrgn0LkWqbSz42MlNBPTh72cQ0WChOuhfjnuPWhh yrNA== X-Gm-Message-State: AAQBX9cNpC7ddip287BmvXnVBXWPsfNsRikBumYPwaTQBsjpx+OO9gnB 5o9cNm6rzfJJfR848ajM/F7QAEvXdWogNql3G/jcNA== X-Google-Smtp-Source: AKy350Zn6igLYgLto+OQsd26wzLpcshelK2ovlP9ZBZPv6CGWGZQJFfiuIiu8NlGshp3+D8fKPb2mw== X-Received: by 2002:a17:90b:4d0d:b0:23a:f6e6:8ea5 with SMTP id mw13-20020a17090b4d0d00b0023af6e68ea5mr3451782pjb.24.1680133256862; Wed, 29 Mar 2023 16:40:56 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:40:56 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v12 02/22] eal: drop no longer used GSO logtype Date: Wed, 29 Mar 2023 16:40:29 -0700 Message-Id: <20230329234049.11071-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The message that used this was replaced in previous patch. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index bd7b188ceb4a..894701e8c19c 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -368,7 +368,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, - {RTE_LOGTYPE_GSO, "lib.gso"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 6d2b0856a565..11d517806054 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -46,7 +46,7 @@ extern "C" { #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ -#define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */ + /* was RTE_LOGTYPE_GSO */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */ From patchwork Wed Mar 29 23:40:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125595 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D3D9142868; Thu, 30 Mar 2023 01:41:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56E7642C24; Thu, 30 Mar 2023 01:41:02 +0200 (CEST) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 40BD242BB1 for ; Thu, 30 Mar 2023 01:40:59 +0200 (CEST) Received: by mail-pj1-f45.google.com with SMTP id j13so15640514pjd.1 for ; Wed, 29 Mar 2023 16:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133258; 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=/JpfzTApqxcaw6IwzzWI8xuuV2X+q4qcoqtpIBt9LtU=; b=JJa48JRIOOkx2JfTkft6OgIJVLo0OnC0fGN6eGAlhgCOXKJXYMrbK+TlpjEm1qTgOF XieoK5kye1Q/mKT6d723OaGVGwxojvBEdttrQBJxjmqZbe9eNupSw6vlxVGGPVQMfFCP VHBxqDhgGV44dVDPpElpPNKR/Za3ZaNpN8wTysjeOS/f8N7v8JsjZOGUI7EviqhSU+dp k54bMZUQTBlZrEb2z/0PKR0Xn4OPlhqRqsxL2uHhOAcD12lAH8AYJTkM1dCOWpze0sIi XZ7sTdVBLXcuHu6a0Cj9RK4ju4fohFbmzqXwQVqc0CFcgO9tfxb+I1EHnf1B+e1Y7eq/ AcXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133258; 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=/JpfzTApqxcaw6IwzzWI8xuuV2X+q4qcoqtpIBt9LtU=; b=10VJOSkbGFom0B6SEowubBsmefBjL76+jrK4gMWxSxbyLFK4C3Xes7VId5fz6hyPJp vHt2CG2Po4WkT5nr4clVDMfNlaKr+zDaoonDyl8qx/cgThN9BaQCbTg6OG3PzcPg2+ug +SmhVh6snoeZ5aWxo5VR0qUwOn5nt+lLO1YZQSEA/c6vit6jvRWbifhkGl+/X+qcDaLh ui12W2DCxhQ72icswljDmFi98fdIeXjdxQL1Vl9rMNvwueA50rgxALeaDWvgtIXQL9oL 2icwRlumyRPBMyLPh5FCTbHtElEo0zNwGpd5W5FpT1GaxsXviO1OnHtHJ4Xmtj9L4igl 7CjA== X-Gm-Message-State: AAQBX9d3RO/OKMe58wJf61L1LBHr1dMMMOfa8fm6nIYMiVCrNEfzX899 Lcxx4EY3C6lH4tOc8Wn/DBKv2SzudaPrWgfiDEKecw== X-Google-Smtp-Source: AKy350bv11GydQawW0VcP1Ril9mV2K7mX9rkWXA7UWPkWFwJMFfAWM2/3DCLcGljY3c+aIa36tDZPw== X-Received: by 2002:a17:902:daca:b0:1a1:a5d9:146d with SMTP id q10-20020a170902daca00b001a1a5d9146dmr25710772plx.65.1680133257998; Wed, 29 Mar 2023 16:40:57 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:40:57 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v12 03/22] log: drop unused RTE_LOGTYPE_TIMER Date: Wed, 29 Mar 2023 16:40:30 -0700 Message-Id: <20230329234049.11071-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The timer code does not use rte_log. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 894701e8c19c..5421da008f5b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -352,7 +352,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, - {RTE_LOGTYPE_TIMER, "lib.timer"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 11d517806054..16d6ea31583d 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -30,7 +30,7 @@ extern "C" { #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ #define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ -#define RTE_LOGTYPE_TIMER 4 /**< Log related to timers. */ + /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ From patchwork Wed Mar 29 23:40:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125596 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 701A742868; Thu, 30 Mar 2023 01:41:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7AF5042D0B; Thu, 30 Mar 2023 01:41:03 +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 E573F42BFE for ; Thu, 30 Mar 2023 01:41:00 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id o2so16491369plg.4 for ; Wed, 29 Mar 2023 16:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133260; 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=7ybvLmYk64ORBpBZCzEXS4GYRTcgDUw2cRYDgREBuoo=; b=jdL979Fex8OotO7qbrJVuFw/I6+14YpsqxQrV6yh2kdtgQDGWLxkYTY424TtzyFva+ 5Qj31R/xQHTZkV10zF4ClvBE/9H16eERi3W7ie0zfr1AugSVR3YvsyaEqQX5w61Df5+X yi2D4L18YFPzO18ol8BnyeFSpPRYSKwzhJMHkRqahThRKFfsgeRo5Rwn8hQL9czyjuiV mqE4wB+tjJ3NHUtUnDHHmcYbfb9osE5LVF/huTSMLUb1ttZm5J4tILj7uBvwghdtNYB6 95HadHud3PqjSw6D1w4e9h9RA3MW//a+pzS6ndFt7YjVu2yiP2rVHaZoR7rbrS9jTiej 3w/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133260; 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=7ybvLmYk64ORBpBZCzEXS4GYRTcgDUw2cRYDgREBuoo=; b=zpSre9iyHUOukF71JYU7JPBeRlVyIUy+DIZmwNpJIM9fKKbQ2S1HrEnhQCgPqAqZXE /AJSZYeOb4ZXBUm+XhlNYDAuknzrFSjoz3zeWc+NHetMm1D+MQSNnipbzxVIY1w/gTQJ KoQLr6HGB5MjCN5xJQznBORis8stWQPfwjm/R4QIuNsdx1qIdLMh2DzRlwoCTyx5yGUk hc/xLKIZ97zAj1qHAcHItIl7Zb3XFsn4cPgw5EF7BgxavAYQlsWSd5MQxWv8l4IfW4cQ heJuICf5E82Ec5uD5G+ctLHraO9TRYDvUTKtn7p//3qflM2LZ1ukURtClQ8c+s2X2oTq oz6w== X-Gm-Message-State: AAQBX9cfDLrZbUMFSQUrq6/INckYHTTJ/TV6J8L6dabeFIU1KVfF3bXb 8PRvkOsbsxVt5b7/2CBbPnUCx1gw8qfrrwnf3nTUYw== X-Google-Smtp-Source: AKy350YFt6OWN621UuY6d99TQsVxzmfudFyiHwZdh0pk+sIHI0QN5EjdlZdegvi7WPBFXB6OOnuCNw== X-Received: by 2002:a17:90b:4b8f:b0:237:30ef:e593 with SMTP id lr15-20020a17090b4b8f00b0023730efe593mr23045782pjb.24.1680133259789; Wed, 29 Mar 2023 16:40:59 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:40:58 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Byron Marohn , Yipeng Wang Subject: [PATCH v12 04/22] efd: convert RTE_LOGTYPE_EFD to dynamic type Date: Wed, 29 Mar 2023 16:40:31 -0700 Message-Id: <20230329234049.11071-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace all uses of the global logtype with a dynamic log type. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/efd/rte_efd.c | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 5421da008f5b..25bb17938cc1 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -365,7 +365,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, - {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 16d6ea31583d..0b39795b4d06 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -44,7 +44,7 @@ extern "C" { #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ #define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ -#define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ + /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ /* was RTE_LOGTYPE_GSO */ diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c index 686a13775742..9edb11799c89 100644 --- a/lib/efd/rte_efd.c +++ b/lib/efd/rte_efd.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -28,6 +29,9 @@ #include "rte_efd_arm64.h" #endif +RTE_LOG_REGISTER_DEFAULT(efd_logtype, INFO); +#define RTE_LOGTYPE_EFD efd_logtype + #define EFD_KEY(key_idx, table) (table->keys + ((key_idx) * table->key_len)) /** Hash function used to determine chunk_id and bin_id for a group */ #define EFD_HASH(key, table) \ From patchwork Wed Mar 29 23:40:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125597 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 889B842868; Thu, 30 Mar 2023 01:41:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1000C42D2D; Thu, 30 Mar 2023 01:41:06 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 3666442B8E for ; Thu, 30 Mar 2023 01:41:02 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id q102so15617607pjq.3 for ; Wed, 29 Mar 2023 16:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133261; 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=nkd0+uwHKBGg/oAuU64YEwUzRQiR4Ebnx8BWBk9lS24=; b=2dqR85qg93n5uLyMk1dvBqbg/E/gXFN64eeVETAQFgi1oATCYev7LjqY5mMffRcBUp F6udRayJW5E7f0L/PZjknSmlBvIiiSG7ZXDSsB/LBpPRjcePx+I0RIUQM58d9g5WijFX 7JgTAzfIMO3z+sWFE7o32xbxxkt1YgzcJVMMciJ3ACQKE4//nfc6PRBBg+6XJuPKyA1w epk+/XtR4mo0PYf1/BYk79HyIiMEXa1V2Vs+yNfO4+O3pIn0hKT85cxoYfyHN03OdpAU knh11dk29GHZjd8U3S2nJHi//9qFvqqzpvA5SBTTss+DpKgc1fIFbausNFANz+OJSpdC zKPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133261; 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=nkd0+uwHKBGg/oAuU64YEwUzRQiR4Ebnx8BWBk9lS24=; b=Bbf1VjtkUJCjRfUiv35cIemTuTzespjR8h0HyWc827gXPhRIatiikiAYBU3Zr4ucWq NWXgKdj7HkS2nivBlq9RxP28RHCjAwNHtJcPqozYi7oQo+xIO6Fd3UGeGGz5VkUCAWMb oK8lmgcRd/USb7tYw9X6xP2s4hcSVXuFeLUhhhV5TBfTE0erx681M2m5VST27pYZwvq5 pn6GA7zVYFQT67S/2a/Z9/ZVwZ7IAWo2cK6OLuL2X55QaJIPEOZ2kG8fwI66iNZlihI9 /qXCGdmt8c9NNG41MJoO2QiAi2ZaPXKrj/bI81tsC9/Mf8TxwlEbIZNrNe9a7okk9g1j zTew== X-Gm-Message-State: AAQBX9cNwHRty3M8Q7ad4+g1QeD2lk9t4iz5uEXbLjlMnhVqGf1xQhRQ OuLoPv2uKr4oVCzuSFz10pJ8DsCexNea9lzWfJbyYg== X-Google-Smtp-Source: AKy350amyMKyJGI/9dE+xojrwszRPIk7QO+ma3MP7at0heDGxMDV+0sWWze3jMkML1n7jrm3Ih036w== X-Received: by 2002:a17:90b:1e43:b0:23f:8752:98be with SMTP id pi3-20020a17090b1e4300b0023f875298bemr24529094pjb.4.1680133261067; Wed, 29 Mar 2023 16:41:01 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v12 05/22] mbuf: convert RTE_LOGTYPE_MBUF to dynamic type Date: Wed, 29 Mar 2023 16:40:32 -0700 Message-Id: <20230329234049.11071-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Introduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 25bb17938cc1..d4389e436913 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 0b39795b4d06..941fbe51fd30 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -42,7 +42,7 @@ extern "C" { #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ + /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ diff --git a/lib/mbuf/mbuf_log.h b/lib/mbuf/mbuf_log.h new file mode 100644 index 000000000000..d759a9a25501 --- /dev/null +++ b/lib/mbuf/mbuf_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c index 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 Wed Mar 29 23:40:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125598 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DA67042868; Thu, 30 Mar 2023 01:41:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A82D42D16; Thu, 30 Mar 2023 01:41:07 +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 7F06142D0C for ; Thu, 30 Mar 2023 01:41:03 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id f22so12365103plr.0 for ; Wed, 29 Mar 2023 16:41:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133262; 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=3UNH+rX0whf8lrUo4PwnjJ6AgBTgeH11Jh0mld4XjBk=; b=USTzohJO57T7499kA68Qiu2IMOvrTPGHnt7GtSN5muoJOD6+bA/X6I9Lf3/psHb9wE aABWYPXeSYSMy3tdC07VMiocsMqXgZfYXT/D08cDG2F8Nl3PiLr5YANNDwA2sca/ouh6 Q+LkM9iXeXtS2aONz94KUEVladdDuDwJqmGiz7vNhbcFGs1anMqANYTh+hvAYOMH+Ssi cOwlMbRHOyxrfp7WVdaGUse+tKSMp86ZsyU/HeCUIYA2Lt/iP8ZzJLczVwpfyw67PZ7d 42y8bVqaRQUa4ERi7YqjIBmml5UY47Pw8t6Lrc5MubyxFBA+RyfPmS7xph2kdqTobvyy QWYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133262; 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=3UNH+rX0whf8lrUo4PwnjJ6AgBTgeH11Jh0mld4XjBk=; b=3QEgtbpI0/SaN+ucf/Rz7l5WIkySj4qjZoYMleKHiS04P6kDO5JHU/V6WexkjcP+oH qEY3EsQe2QmauokbnzntAEHqS5MjRPfR5gePSaB4HAuh5NOOzgMJlbID7E+AGWpkrE03 FLUF2otprSREccetRfqgnp2rxW6qUmk7/1BVNxt3wkk9iFYvbg4Sfih5s/6JZiAgEOkE 70UfDDdf5Ioi9GkfN0hPgW+2jeOAhQp4c/Po8fvrE3BTcrwZVr5jvs1sMSE6iie3Htvt SsYlqA/heryAdHQ3r6fl/reCUfkPJY3ocd6DIR4FO3nRWBI4C32WhQ/MLkacwkgnEPJ3 3OMA== X-Gm-Message-State: AAQBX9ecBUG11akfWGwDQxM+R+c0s/fVt893fduILnXIHiDb1pSjY2Yp dXwt64cZgxeYRJ8gzX0d4l830m/MsfoSLXG6/BzUMQ== X-Google-Smtp-Source: AKy350b67AxrxdRGZ11RaexgKa/86m5x9/4gp9NrcX4ZLtfkTb5igs57IZQIiMEnQLkNxUnviwZqyA== X-Received: by 2002:a17:902:f34d:b0:1a1:cef2:accf with SMTP id q13-20020a170902f34d00b001a1cef2accfmr16476321ple.30.1680133262366; Wed, 29 Mar 2023 16:41:02 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH v12 06/22] acl: convert RTE_LOGTYPE_ACL to dynamic type Date: Wed, 29 Mar 2023 16:40:33 -0700 Message-Id: <20230329234049.11071-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Get rid of RTE_LOGTYPE_ACL and RTE_LOGTYPE_MALLOC. For ACL library use a dynamic type. The one message using RTE_LOGTYPE_MALLOC should have been under the ACL logtype anyway. The test code should not have been using fixed log type so just change that to stderr. Signed-off-by: Stephen Hemminger --- app/test/test_acl.c | 3 ++- lib/acl/acl_bld.c | 1 + lib/acl/acl_gen.c | 1 + lib/acl/acl_log.h | 4 ++++ lib/acl/rte_acl.c | 4 ++++ lib/acl/tb_mem.c | 3 ++- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 lib/acl/acl_log.h diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 623f34682e69..75588978a720 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -154,7 +154,8 @@ rte_acl_ipv4vlan_add_rules(struct rte_acl_ctx *ctx, for (i = 0; i != num; i++) { rc = acl_ipv4vlan_check_rule(rules + i); if (rc != 0) { - RTE_LOG(ERR, ACL, "%s: rule #%u is invalid\n", + fprintf(stderr, + "%s: rule #%u is invalid\n", __func__, i + 1); return rc; } diff --git a/lib/acl/acl_bld.c b/lib/acl/acl_bld.c index 2816632803bd..f38e6478315f 100644 --- a/lib/acl/acl_bld.c +++ b/lib/acl/acl_bld.c @@ -5,6 +5,7 @@ #include #include "tb_mem.h" #include "acl.h" +#include "acl_log.h" #define ACL_POOL_ALIGN 8 #define ACL_POOL_ALLOC_MIN 0x800000 diff --git a/lib/acl/acl_gen.c b/lib/acl/acl_gen.c index e759a2ca1598..54ec485d0c58 100644 --- a/lib/acl/acl_gen.c +++ b/lib/acl/acl_gen.c @@ -4,6 +4,7 @@ #include #include "acl.h" +#include "acl_log.h" #define QRANGE_MIN ((uint8_t)INT8_MIN) diff --git a/lib/acl/acl_log.h b/lib/acl/acl_log.h new file mode 100644 index 000000000000..b55573cbe207 --- /dev/null +++ b/lib/acl/acl_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int acl_logtype; +#define RTE_LOGTYPE_ACL acl_logtype diff --git a/lib/acl/rte_acl.c b/lib/acl/rte_acl.c index a61c3ba188da..a29decb1f6ca 100644 --- a/lib/acl/rte_acl.c +++ b/lib/acl/rte_acl.c @@ -6,8 +6,12 @@ #include #include #include +#include #include "acl.h" +#include "acl_log.h" + +RTE_LOG_REGISTER_DEFAULT(acl_logtype, INFO); TAILQ_HEAD(rte_acl_list, rte_tailq_entry); diff --git a/lib/acl/tb_mem.c b/lib/acl/tb_mem.c index f14d7b4fa26e..6a9d96aaeda2 100644 --- a/lib/acl/tb_mem.c +++ b/lib/acl/tb_mem.c @@ -3,6 +3,7 @@ */ #include "tb_mem.h" +#include "acl_log.h" /* * Memory management routines for temporary memory. @@ -25,7 +26,7 @@ tb_pool(struct tb_mem_pool *pool, size_t sz) size = sz + pool->alignment - 1; block = calloc(1, size + sizeof(*pool->block)); if (block == NULL) { - RTE_LOG(ERR, MALLOC, "%s(%zu)\n failed, currently allocated " + RTE_LOG(ERR, ACL, "%s(%zu)\n failed, currently allocated " "by pool: %zu bytes\n", __func__, sz, pool->alloc); siglongjmp(pool->fail, -ENOMEM); return NULL; diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d4389e436913..9e853addb717 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,14 +349,12 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_MALLOC, "lib.malloc"}, {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_ACL, "lib.acl"}, {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 941fbe51fd30..1408722b2c2f 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -27,7 +27,7 @@ extern "C" { /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ -#define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ + /* was RTE_LOGTYPE_MALLOC */ #define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ @@ -35,7 +35,7 @@ extern "C" { #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ -#define RTE_LOGTYPE_ACL 9 /**< Log related to ACL. */ + /* was RTE_LOGTYPE_ACL */ #define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ From patchwork Wed Mar 29 23:40:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125599 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E7E4542868; Thu, 30 Mar 2023 01:41:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49CA842D36; Thu, 30 Mar 2023 01:41:08 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 109F342D13 for ; Thu, 30 Mar 2023 01:41:05 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id mp3-20020a17090b190300b0023fcc8ce113so20243386pjb.4 for ; Wed, 29 Mar 2023 16:41:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133264; 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=ZJWWt+ZxpXEEuTzykZuV5zsC34UQf5EBX8tIyx7/Oz+WGbEdIMrNbBni90fWtYeGq8 sgsY0K4nztjfxpVBg2bqGi5xbEvMtTM8TiLX+G4twBDXU49cL4XDDiUxpygGRQvH75wc h1DfgQIccV/ASfo9l7iXudiBSslD5kvzOBzzv+/vDZO5dvvUnNt1qLfNJ077tzjIuDcd VMM+QDailU61YE+DTq5UEF3YooZGPq+w9eZtOXZU63zPny5JL1Q8HbVHiEEHQeHjFed8 YpJj41dUQDlWpCLJ0PNB/jTolJH7cKoTkSW9toh6OVu1vtPfUp5FUxVkO28QXrxqftno eGVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133264; 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=I3k5h7uuHfuz/hINL8XJOgck7LSMhK/iMwq6yoEgrxVyT8/S54t6003DcL5x2JGICt yX8nOIw50+8FIzpaSwVFQ3PKqUo57fjBahRKzCln9jB9g3h6ghvULLLb1jkAuWH5GvwK k/PtpguGSJ49SP03NCitSy8PrRJtDJoVdY8ADKL6axeictwI8Mr16yv4I6v7l7N3U8UR Ienj4CewxHlctV+JYfINoTTIhqXAjHxuSmOMXvapXfmjtTi1XzM7wvcRbFdX65f+BFIc THAeX2LQ7U7W09fkVKfsl7yjiFbjaWZS6lgpSyLwaTw+jJJGf3ACVsVq0A1VQSWbJvDC HpPw== X-Gm-Message-State: AAQBX9ea4efBnSkmSBA9o1rvE/jmUKrHBKa2+RQdbTRxb8Ih9I4+ez1M oLuw8JDA9AWLCHa1ZupOLdCCiQJT4Zvh3g6jBbyGzQ== X-Google-Smtp-Source: AKy350aFzKEJOzZcUVcYSw0zhiUeWgjPeHXowqBSuRVxyPopDo6QS7eAK93wdTkqy/cXMcBhFbw5XQ== X-Received: by 2002:a17:902:fa10:b0:19f:2b42:5d01 with SMTP id la16-20020a170902fa1000b0019f2b425d01mr18131031plb.9.1680133263980; Wed, 29 Mar 2023 16:41:03 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:02 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v12 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Date: Wed, 29 Mar 2023 16:40:34 -0700 Message-Id: <20230329234049.11071-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Don't use static logtype in sample application. Signed-off-by: Stephen Hemminger Acked-by: David Hunt --- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 21304d661873..542f76cf9664 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -679,7 +679,7 @@ init_power_library(void) /* init power management library */ ret = rte_power_init(lcore_id); if (ret) { - RTE_LOG(ERR, POWER, + fprintf(stderr, "Library initialization failed on core %u\n", lcore_id); /* From patchwork Wed Mar 29 23:40:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125600 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CB7FF42868; Thu, 30 Mar 2023 01:41:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC02242D3A; Thu, 30 Mar 2023 01:41:09 +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 5339D42D31 for ; Thu, 30 Mar 2023 01:41:06 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id u10so16477273plz.7 for ; Wed, 29 Mar 2023 16:41:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133265; 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=h0NMEmoZDZFyPT3QV+RM34fugJhn8QhgiZ6RQ/vAmscPMNSmBqxeZepN88O2qrzWLf efacK53n+NSwNuEiu3IQx4hkPwWZMTfT/5s+fioZIshf4Ks5KqnWi14QpfDjiIbWkxv+ kxevaVrQLKU7ydHm64I0jbanM7vl4DXgXAS3W4xUSV6RwxvOf5u9eeuVpjfh/8y+P+jX uXJI7dOQ/o1dn9xSeXfXhcJUd+zEkkclufp3HT3ahkI6WkKI+WKSiQf6DtmFzKj+d+54 3f8n812r0XC7nPIiuZAdtQpMSnbUx5YF6u7WqCJsnQ5yQlrZ5iaMo3uFVpydIm6Fd8Bw 2Gmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133265; 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=HpdnIdiIeSUfhbKu0Yyqffx5F0Dv4ZeVBG9KhSZacoAQRSzwuqX27np281YSBUXfxt gz+uoBU/V6GOOQ/h9q1thv81AI7Yl1kmo1hU2aUDjUD/OJp3RIsqqnCTwEudBSFRw1Bv R1gIYnqmP5sqQS7Lgyy20G9/4mTrJlx/M+FYeVNloYURV/yUeHeb9GLUpDNmSQAmKPYl VpoLzmJ6evXRG61amKSxP42PCeOIhM5DIqVvFAznKzhey46uAijhKSJCUzkFmhfxJfNL czhhf3JwYaUJRSMqotZmjOUc4HQ3gtmpZ+hdm8KtLohf8YNjpk5vEt8n2RBrQh35yQ4V px9g== X-Gm-Message-State: AAQBX9ch3h8V+ei3IM6EoSm/Wc7pCoevDg+wkn230UolVSvF6zntF2Pe JsbR/gHNeX3+kPR8mupgd8Gdj+jgKlxvVROxSmLb1A== X-Google-Smtp-Source: AKy350aPHHY2pMoa/iTMq3P2rGRtmjMiWCYKKdm+SBM8y6n4TeNya4n/B2bMXF9Sf5bBJRuvjqnNzg== X-Received: by 2002:a17:902:cf51:b0:19f:3b86:4715 with SMTP id e17-20020a170902cf5100b0019f3b864715mr18473676plg.8.1680133265173; Wed, 29 Mar 2023 16:41:05 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v12 08/22] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER Date: Wed, 29 Mar 2023 16:40:35 -0700 Message-Id: <20230329234049.11071-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 Wed Mar 29 23:40:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125601 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2FEA42868; Thu, 30 Mar 2023 01:41:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 103B742D42; Thu, 30 Mar 2023 01:41:11 +0200 (CEST) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id A316842D13 for ; Thu, 30 Mar 2023 01:41:07 +0200 (CEST) Received: by mail-pl1-f180.google.com with SMTP id c18so16466633ple.11 for ; Wed, 29 Mar 2023 16:41:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133266; 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=nvx1Vs9qbz/cD1UXPRMyyRhD5Ra64Cr7ISVxUPjGncE=; b=jDUMdMHZ71VMBsyMFbzqFw6x/odhlJVVCV2g4n5OaEhrcaMIkGt3VCDnMjn3R2r9qv m8CFmN8CfGIHNniKefE4/QvTj6feADNPNM49aMc5tY9RBMe+BH4mhUxzmqiz/t6OMn6H XuvDqJKAGhC5G8xBfLnik/s5poUq0w0wQTED3h9h/xSkpSEcn3j9lmQqS83IoxTE7fLP 0Mw1LnbG1Wkigu+UmtGTsVPkvo3h5R2hb5vDAQJhFwG8Iima87uaa3Og8xPNQ6hffSGi Ze/zY306lBEwVLHWwUrYlzKi4jeEGszPSA3Mq27GF1h8VHzq3Ll+8ZvdWFNfyanjKJjy 2ukg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133266; 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=nvx1Vs9qbz/cD1UXPRMyyRhD5Ra64Cr7ISVxUPjGncE=; b=0Q7ST3e0sCu9F2JVuVhPhdfkRi6LH2OZmSq3KjzUf9IU7SCKC8vlLoY6adkj+8bfYc ZLpgCSBtiIIwWzm2zHO8GvfhJRoPgrw6xhfqn4umSQN3Jwm1eB/qd/lHrmNkhmmE1Rbi oWxcZAY2PTYf70onec+AgLzODIcsHMzEHOLKBbR3zta8bgnNRLFveojC7Kw41AeiXaW1 SGrlW/jbLJ0oaEgeH56V7b/b0XnkT0uoypugSnQ7wCQB8jg2qWvkxHeYGeIrUbaEdDnN xjCOFUeA7CgnAFtA3lcUL0PIAYIMeA9rGTy8T0seci+sSvtnM4U/xiTf0ZkvHGBq/N8e ViXA== X-Gm-Message-State: AAQBX9eflaeiI7GAtN1Wp/3bL6hEZfp6jtcHosQg/DSK50f+5BJaN83c mn5h4eTTO5jK/3S5Xnx4S1wSrI16BiO9S34sxx+RUg== X-Google-Smtp-Source: AKy350bsnv6Yh0eorZWhVtczktW1yVDa2lNESXXBfYEmdr+ZxdQiQupggGuOieFAoSMTxQF9luUKKw== X-Received: by 2002:a17:902:e812:b0:19c:e440:9256 with SMTP id u18-20020a170902e81200b0019ce4409256mr26268818plg.35.1680133266554; Wed, 29 Mar 2023 16:41:06 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:05 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v12 09/22] power: convert RTE_LOGTYPE_POWER to dynamic type Date: Wed, 29 Mar 2023 16:40:36 -0700 Message-Id: <20230329234049.11071-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use dynamic log type for power library. Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest. Signed-off-by: Stephen Hemminger Acked-by: David Hunt --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + 7 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 9e853addb717..39e1e6680dea 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 1408722b2c2f..7d4345acceca 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -36,7 +36,7 @@ extern "C" { #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ + /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index 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..63a3a443509e 100644 --- a/lib/power/power_common.h +++ b/lib/power/power_common.h @@ -5,11 +5,12 @@ #ifndef _POWER_COMMON_H_ #define _POWER_COMMON_H_ - #include #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype #ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \ diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c index 6a8109d44959..db031f43105a 100644 --- a/lib/power/power_kvm_vm.c +++ b/lib/power/power_kvm_vm.c @@ -8,6 +8,7 @@ #include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c index 63a43bd8f5ae..db0e7705a9ef 100644 --- a/lib/power/rte_power.c +++ b/lib/power/rte_power.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h" From patchwork Wed Mar 29 23:40:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125602 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6CFB342868; Thu, 30 Mar 2023 01:41:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4939B42D46; Thu, 30 Mar 2023 01:41:12 +0200 (CEST) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id AC60C42C76 for ; Thu, 30 Mar 2023 01:41:08 +0200 (CEST) Received: by mail-pl1-f172.google.com with SMTP id kq3so16450197plb.13 for ; Wed, 29 Mar 2023 16:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133268; 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=drxJ6tAjLOgviQ8BDUxH9iZAgxBRmPvKfA6Fo5BBXlM=; b=yogf3vRTZCUt1goEO8Q75wyflQwYNTeXcgzBFAWdc4CMk+fy+TcD9EKNGb4MuH7IxF muOfEVUgqUM47rZze6ia5IcddmyW+oTGImPrtygwUBcko5iGNbJbCqdHsT/0lG6ZGAX5 oyJiNHSnk5iORJv92qis+IPYz+MlgVe1b0AgsZ8mZa+DXnBKGKvyyvIRXv/ryyWyGsqZ 0yqNQ4lhRw5CpLYiw4rRMu7YZmOhKKiPLwpTxQ64F+8sj+ANsdlB+frlBAaTGxlF1Bz1 veeU9vghiiLQj6yO7FOcPv1zZtSTUvThQIA1XNLY3J7+diTFhzw/HF6YzGJhifJWj3BM oC3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133268; 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=drxJ6tAjLOgviQ8BDUxH9iZAgxBRmPvKfA6Fo5BBXlM=; b=0PBxxUeGk2ssfMTxzPQd1H8esqjgmdyClsxUECQnT9g3ZEkirHws7nMyO7j8GTp10l Hx5WxlEGWL0slsKrPlf5Ww0ef9kdDBKpxzYHLHAYOMWE5JJyJlnBxLovGjzb6PWQtRaa IurqAZgVuLF2iAdvPmpF7UzVBLjT0VjVTJgu32uFjA4PEf7VmC5pE95AFb5WhFfBBlMD vSMhQe9nFJYXHArbwAwTge4QSELCwegdEnfKsC4WaBfPcqlNCIs1VGYaul3xxSAqiE/6 FUslvOb6N6YB0akpuNfAXp2uEA8eY3TZxIBsMwImvDKjPhoRBRckQqMtllKaSq0xzDCA 1z2w== X-Gm-Message-State: AAQBX9fOxuO/FJ/7YdiAUmDEmJweuLmNcTxc3RmjEbmW3c3YmLSQ1Tsz xxKqyMCaXOM2zQJB3TpQ4v/HjomLgFTWKpAMvlnJdQ== X-Google-Smtp-Source: AKy350bc5qp1QV5lmLphs4BzW09d50+2ET1RLjbq7AGxlEJtpeE+8biRvj6+4M+uoiRrYZrgkLklsw== X-Received: by 2002:a17:903:684:b0:19d:297:f30b with SMTP id ki4-20020a170903068400b0019d0297f30bmr17795024plb.19.1680133267947; Wed, 29 Mar 2023 16:41:07 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:07 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v12 10/22] ring: convert RTE_LOGTYPE_RING to dynamic type Date: Wed, 29 Mar 2023 16:40:37 -0700 Message-Id: <20230329234049.11071-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The logtype for ring only used in library. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 39e1e6680dea..5f15e312f15b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,7 +349,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7d4345acceca..31a2ee2f6b6f 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -28,7 +28,7 @@ extern "C" { /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ -#define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ + /* was RTE_LOGTYPE_RING */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c index 8ed455043dee..ae57acd7cd11 100644 --- a/lib/ring/rte_ring.c +++ b/lib/ring/rte_ring.c @@ -26,6 +26,9 @@ #include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT(ring_logtype, INFO); +#define RTE_LOGTYPE_RING ring_logtype + TAILQ_HEAD(rte_ring_list, rte_tailq_entry); static struct rte_tailq_elem rte_ring_tailq = { From patchwork Wed Mar 29 23:40:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125603 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35F0842868; Thu, 30 Mar 2023 01:42:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C74CA42D55; Thu, 30 Mar 2023 01:41:13 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id 1F13B42C76 for ; Thu, 30 Mar 2023 01:41:10 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id ix20so16499154plb.3 for ; Wed, 29 Mar 2023 16:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133269; 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=aeq1uj25JldFreKq0IK768GUaQxEEtggWUlF7dBKhTY=; b=kd/kzaiYEiPy7sHNOLw/MakCMCvvYxsfRO/pObq1KjRH11VgwxkqMTGFll0Csed9u0 I863WKaTpO0BoS2Y1tNlkd5WN0PMB5ZgrtSSRT+Kv3OQoc6psELoNntt1j+O7MYlNHge 92p0fqS05zXYE5o4ZUowlxMpKPSClJLwsAf8kH0gQtqO0By1a+bpkCFvJEbcZzgqcva+ EJ+Ak5VjAorBAn8DuVblRyTvVsNZmvZmOsnl0KF/7ODAa1XIi+wTt0Ecqnufc/9+sVy0 nfhprXjLFkns2d9Jh5THtEw2qSLB6tRgCTSk3MRtQB3/H2NFEO4hICVkw4LxWVBy2HtA Ep1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133269; 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=aeq1uj25JldFreKq0IK768GUaQxEEtggWUlF7dBKhTY=; b=S5Ylfuo4VZko7as+hDeuxlvIzK3GC++zrQjjnQTAbqEOV0AVqnQhjBwEqlx/QMj8DW htrMwQIfU/kCyoCnMqTHVHe1UtDAJgx3g2gkEj/sdJrWliCBvliyp4EjQBIWXfnNEicu 71wSqACgd6nZqYMAfcAQ6RzB/Or31yj9I2CGiuD9/FueWIrqUoFTZ+PqrNu8p2gpgcW+ UJ6yGiAx0rMU08GtE58gK1se6Vmr+x5JNeuHbASSgrmo2Ntb5UZ+9TG3edJBvPSUBKhA 2EKdrWxju7fD2AhYoxFT7DMVCJ7UF4XS2imbVrZBlv2Lnyaut5lbO9H1Q3vEpIvVnHB3 D4UA== X-Gm-Message-State: AAQBX9etjM5l18RqmBgTUejgr2W0LGbRhGJDnlnP9wINl2unUjyJewZf N3BA/FxHrrrYvCJ3fU4XBTXxTnpQjaxJrr5aBOjpyg== X-Google-Smtp-Source: AKy350bXxPNOfNRuFYGbHqBGT656ywbKHRnbRbHiT6LhxcmktzOq/H/XFaknP++CV72P8dvsXl3qJg== X-Received: by 2002:a17:903:11ce:b0:19c:b11b:ffca with SMTP id q14-20020a17090311ce00b0019cb11bffcamr28643641plh.23.1680133268958; Wed, 29 Mar 2023 16:41:08 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v12 11/22] mempool: convert RTE_LOGTYPE_MEMPOOL to dynamic type Date: Wed, 29 Mar 2023 16:40:38 -0700 Message-Id: <20230329234049.11071-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Convert from RTE_LOGTYPE_MEMPOOL to logtype_mempool. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mempool/rte_mempool.c | 2 ++ lib/mempool/rte_mempool.h | 8 ++++++++ lib/mempool/version.map | 3 +++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 5f15e312f15b..4025d2039d55 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,7 +349,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 31a2ee2f6b6f..9f86bfdd0198 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -29,7 +29,7 @@ extern "C" { #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ /* was RTE_LOGTYPE_RING */ -#define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ + /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index cf5dea2304a7..b609a94fdf9d 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -31,6 +31,8 @@ #include "mempool_trace.h" #include "rte_mempool.h" +RTE_LOG_REGISTER_DEFAULT(rte_mempool_logtype, INFO); + TAILQ_HEAD(rte_mempool_list, rte_tailq_entry); static struct rte_tailq_elem rte_mempool_tailq = { diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h index 9f530db24ba1..db01acc19b02 100644 --- a/lib/mempool/rte_mempool.h +++ b/lib/mempool/rte_mempool.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -175,6 +176,13 @@ struct rte_mempool_objtlr { #endif + +/** + * @internal Logtype used for mempool related messages. + */ +extern int rte_mempool_logtype; +#define RTE_LOGTYPE_MEMPOOL rte_mempool_logtype + /** * A list of memory where objects are stored */ diff --git a/lib/mempool/version.map b/lib/mempool/version.map index dff2d1cb5555..eb2c12127560 100644 --- a/lib/mempool/version.map +++ b/lib/mempool/version.map @@ -57,4 +57,7 @@ INTERNAL { # added in 21.11 rte_mempool_event_callback_register; rte_mempool_event_callback_unregister; + + # added in 23.07 + rte_mempool_logtype; }; From patchwork Wed Mar 29 23:40:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125604 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5F8F42868; Thu, 30 Mar 2023 01:42:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB9D642D62; Thu, 30 Mar 2023 01:41:14 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id DB18742D17 for ; Thu, 30 Mar 2023 01:41:10 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id n14so626044plc.8 for ; Wed, 29 Mar 2023 16:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133270; 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=5UmCQD0yXvyxxwVVk2Jvhz4Nnw3R8287jjpuzWnUKFY=; b=ujGBgBkWLYr/jJGJhhRTj/6d4tlxpHnD1pLQwqk6K+gFKNlNd1/Na/yi+uk9NZEnfJ 3UAutdSdxEcno/AmnkYcEPcsiQYpptBbdQPPxi+scAJLCmnrq7fadVxO2o+4X37cimwp 2twUqJGDG/QLdJof73czoJpOQUD/0vK5jPsdinEFapRDOKLHD4Z/24kT1EQWgGhQRmUH OafnHIv3QxWHhIxNyfiLrhTE2KOPgZFH9sSMnBKfrK1sMfsbchtRSEkrXTzszAlSgXG/ rsTGReh6AjmVRq5OmGDgzu6HnM42GKr+tM1etAQFrTzg144lqjvFJn+20FeWAqJKum8g 5qOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133270; 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=5UmCQD0yXvyxxwVVk2Jvhz4Nnw3R8287jjpuzWnUKFY=; b=3epnRt3WpoAZrT4XW33/bRmRh+2HmwLLTenCPDopp4WI47G0pzXdXL1bT5o6JlSGU8 ZvklsSWSrIGCC3W94RAJaE1AKEQx5jzmTt3MQQ4KCDd3/eTMMAh3VpSVP1A1P3j2/iZh 4AQG7ytFVluqLWn/pN6v0WUnQPSEuhkKB1CozBJ+HqvD4uul6451unX0V81oxGuDifs2 jV0m10l5B5dnucULydXfI/WkBMAXtzIHgUGXPU7CFxYGgvUiOk5Umgu0F1MrmgbUVetp tVBjfSuin+EyEAbfl17KbwEgexmAHnDax1ZUKAuTGFxrvqdgYthmzcNHkD+EeVqjoXyy 3HaQ== X-Gm-Message-State: AAQBX9dABorscnMsnhLBhGpThnYeevHbJsbwzAw7rfTMQneXDWZsMDwg x7ORGU6Zq1kA6+JxG2a9LPgu/dVC4u3AcR7oXLilMg== X-Google-Smtp-Source: AKy350bOTzebRir6YkapEiw0l7mBESe/7ijuKCbE4pt/qJ0aStbbeJSAvnEvS+yexeQICyDKX8YoPA== X-Received: by 2002:a17:903:2291:b0:1a1:ee8c:eef5 with SMTP id b17-20020a170903229100b001a1ee8ceef5mr25244591plh.7.1680133270054; Wed, 29 Mar 2023 16:41:10 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Bruce Richardson Subject: [PATCH v12 12/22] lpm: convert RTE_LOGTYPE_LPM to dynamic types Date: Wed, 29 Mar 2023 16:40:39 -0700 Message-Id: <20230329234049.11071-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6. For rib and fib libraries give them own types as well. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 4025d2039d55..6e2007e6ed4f 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 9f86bfdd0198..115a48bf05f5 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -33,7 +33,7 @@ extern "C" { /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ -#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ + /* was RTE_LOGTYPE_LPM */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ diff --git a/lib/fib/fib_log.h b/lib/fib/fib_log.h new file mode 100644 index 000000000000..c731c820f621 --- /dev/null +++ b/lib/fib/fib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c index 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/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 Wed Mar 29 23:40:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125605 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5169A42868; Thu, 30 Mar 2023 01:42:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 39BC742D5F; Thu, 30 Mar 2023 01:41:16 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 3ADC042D35 for ; Thu, 30 Mar 2023 01:41:12 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id q102so15617964pjq.3 for ; Wed, 29 Mar 2023 16:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133271; 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=Y22x/PMYLrqRgOMATwqnJE2b+z0HiVYvormDrFz/lWw=; b=OuCdw9xruK5SldeDtiNd+/LBpVeO5r6IyuhHdl2IErZkds/P1m3VR1RDfCYgBoec1M +4ZFi+iv+C5UOIOgwuwr82uTaGLJHZp62/aIcrDOar4C+QkxVH4klcbnyQZGsQKrvMuU pfDqfKZuNRU//4G5hP9KJd3XVi/VfWy8tGmacfjC6CGPE0sGI/vkbHsltP1Sjksm/Gz3 K5WpiGagOaD3jetsXRMOH4G1fx7p5q6S4az+HcE6JT8NWpTiyngpkonUR7Yn5vBtqFn8 ROyhWYxXIFZUNicO0uvIZ4NoaYXzm1WZWP7x/jNa3MOT2GPht7KyoYXh9GxpybwtskBu AOsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133271; 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=Y22x/PMYLrqRgOMATwqnJE2b+z0HiVYvormDrFz/lWw=; b=DfUWTKmPG8+RcKpE9jrNG6JXPWGuyF9cRgyxf9s7K/kB1Mw4eWqpnOQFSXX8VpkrDS KhVxo4/2tUHKW4dKM8CYyVrv6wWRfgzjfqyTos/q+XL/biETnX2zzmO3pvgOuzsvDwU+ 5RBXRgalpw7rynao1ABVvH1zr+o8F8/BPOOzaJUo5D0CeEHAA8HbCA5joJDYZ68gVkvp LEIN4DshuoeCedl4unomPloG0tez2zmBPzmvUIbUs6vaWyrIZWd8HYOQS+2eQxs8UNS6 6QQmny0xl3ToPV6vqkq22m+8tW6nA3oYd+FPmzXJS21aopRBIlZIpyzkesLOiCb8+p3x /GRg== X-Gm-Message-State: AAQBX9c7MkRDKzCfrfcHZKE6HL8smCe38aDlfD4E5hQMZopHxpVMniJ1 dqkwMI8tJz7QeUQAW0ZIrhdarBc9DUpH8RfSM78btw== X-Google-Smtp-Source: AKy350YT3hFhYHoC3k4An9+YWU94d/oT9YfcBlCd7Kq3ASY3ojT4WCCv9HrWN2wm4wyVkkU7kBP3CA== X-Received: by 2002:a17:903:110e:b0:19e:9807:de48 with SMTP id n14-20020a170903110e00b0019e9807de48mr26729333plh.23.1680133271465; Wed, 29 Mar 2023 16:41:11 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:10 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v12 13/22] kni: convert RTE_LOGTYPE_KNI to dynamic type Date: Wed, 29 Mar 2023 16:40:40 -0700 Message-Id: <20230329234049.11071-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Even though KNI will eventually disappear, fix the logtype now. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/kni/rte_kni.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 6e2007e6ed4f..70d5bb7b1951 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 115a48bf05f5..dc2454a0d9de 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -34,7 +34,7 @@ extern "C" { #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ /* was RTE_LOGTYPE_LPM */ -#define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ + /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c index bfa6a001ff59..b327bb28c45b 100644 --- a/lib/kni/rte_kni.c +++ b/lib/kni/rte_kni.c @@ -23,6 +23,9 @@ #include #include "rte_kni_fifo.h" +RTE_LOG_REGISTER_DEFAULT(kni_logtype, INFO); +#define RTE_LOGTYPE_KNI kni_logtype + #define MAX_MBUF_BURST_NUM 32 /* Maximum number of ring entries */ From patchwork Wed Mar 29 23:40:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125606 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22BAE42868; Thu, 30 Mar 2023 01:42:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9CC942D6D; Thu, 30 Mar 2023 01:41:17 +0200 (CEST) Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) by mails.dpdk.org (Postfix) with ESMTP id CC53D42D56 for ; Thu, 30 Mar 2023 01:41:13 +0200 (CEST) Received: by mail-pl1-f175.google.com with SMTP id w4so16464097plg.9 for ; Wed, 29 Mar 2023 16:41:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133273; 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=44dZ4ytCFbB15xyOjr93d/NjqhAyDXFKhUkhvIwHcpk=; b=S/EglSGSV1h3qTJV7ZEoBkOwculocGnqF3sacUXZhBE8WqlmpibNBnUtpX1qbAszV5 nDhuzW9fvsSC44FKQcSoP+VbSpj14r2TJr1Fa44rbvpr8Fqo899eMaC15hY6Wk/RYvaq ikVKoJn6zc8HQSPs2j8xcDS9C+kmBhGI9zKEP1nU1oScXg2h4IGhLvIhzlRE94C+77ot 8O4unK63bSi+0AT1q9iVzBLpz1yyF50BjQGL1bZ2nfTdUJQJL11xTSgxiHAAbm3z4r/M C/LxpYJmtx84mMSXctSC311l8YFdYh1wOZdbEBvpKb+Xzw/Z+HjqFXsn7rSHyq4lkJPe qyKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133273; 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=44dZ4ytCFbB15xyOjr93d/NjqhAyDXFKhUkhvIwHcpk=; b=Ioe/W++Bz/cffPMspIHjmvPHURRn5Pq5ZaBKfTd65t8AOpyX6qLrOy2BYqt2X/WV47 9/Ol7fUrtLG4zAde+QG2GUlFED54RCk6+/DkB58TyB9Dwde2n+pbsiXMa5BWihyCtdgG WKz1hOTc1ol38Rm9Tafhh2FZqRRZj7TYLWMQWyTV+hPyKj5HVSg9GjnXGN/t/55sUfIP NqZmf3K7Chg3ayUhRRJnx3oQHRiJluU8G5F/uaK7DdyvaF7xm96n83O8EDs89VDCOlji IGBZTAQ5EzxJQuxpaVzhn04gRvnnLmE/+2r8BvA9hT21fJVQVdFrlQLn1nUsPmBU541X PUnw== X-Gm-Message-State: AAQBX9escV9MeKzAtctcZcWuJJDwEamhIiBxMCtrqRenpv3ZAXc/fgKu uwOYDLrhFBx/skK2/kEge0u/J04De0c2ls1yAXWtEg== X-Google-Smtp-Source: AKy350Zb9ivDug4h0z6viz6RJdWCG6HeluqxqVj3k7+BWebtbSOYp3I8S8X3hkSruReERtZto0OO+A== X-Received: by 2002:a17:902:f684:b0:1a1:b238:d1a5 with SMTP id l4-20020a170902f68400b001a1b238d1a5mr24443961plg.4.1680133272704; Wed, 29 Mar 2023 16:41:12 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v12 14/22] sched: convert RTE_LOGTYPE_SCHED to dynamic type Date: Wed, 29 Mar 2023 16:40:41 -0700 Message-Id: <20230329234049.11071-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Also can remove unused RTE_LOGTYPE_METER Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 2 -- lib/eal/include/rte_log.h | 4 ++-- lib/sched/rte_pie.c | 1 + lib/sched/rte_sched.c | 5 +++++ lib/sched/rte_sched_log.h | 4 ++++ 5 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/sched/rte_sched_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 70d5bb7b1951..d4b7088b5cbb 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,8 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_METER, "lib.meter"}, - {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index dc2454a0d9de..f185fcbc5a94 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -37,8 +37,8 @@ extern "C" { /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ -#define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ -#define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ + /* was RTE_LOGTYPE_METER */ + /* was RTE_LOGTYPE_SCHED */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ diff --git a/lib/sched/rte_pie.c b/lib/sched/rte_pie.c index 947e2a059f6f..cce0ce762da8 100644 --- a/lib/sched/rte_pie.c +++ b/lib/sched/rte_pie.c @@ -6,6 +6,7 @@ #include #include +#include "rte_sched_log.h" #include "rte_pie.h" #ifdef __INTEL_COMPILER diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c index 19768d8c38b0..27e98e46df7a 100644 --- a/lib/sched/rte_sched.c +++ b/lib/sched/rte_sched.c @@ -16,9 +16,12 @@ #include #include "rte_sched.h" +#include "rte_sched_log.h" #include "rte_sched_common.h" + #include "rte_approx.h" + #ifdef __INTEL_COMPILER #pragma warning(disable:2259) /* conversion may lose significant bits */ #endif @@ -3002,3 +3005,5 @@ rte_sched_port_dequeue(struct rte_sched_port *port, struct rte_mbuf **pkts, uint return count; } + +RTE_LOG_REGISTER_DEFAULT(sched_logtype, INFO); diff --git a/lib/sched/rte_sched_log.h b/lib/sched/rte_sched_log.h new file mode 100644 index 000000000000..fde051f49d62 --- /dev/null +++ b/lib/sched/rte_sched_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int sched_logtype; +#define RTE_LOGTYPE_SCHED sched_logtype From patchwork Wed Mar 29 23:40:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125607 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 07A1842868; Thu, 30 Mar 2023 01:42:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF83F42D75; Thu, 30 Mar 2023 01:41:18 +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 BC5F542D56 for ; Thu, 30 Mar 2023 01:41:14 +0200 (CEST) Received: by mail-pl1-f169.google.com with SMTP id o2so16491875plg.4 for ; Wed, 29 Mar 2023 16:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133274; 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=/kG30QXgiqTlAY/aumHd2pxlHHbrLxsI9VJTymreolY=; b=v1PO0ru9IjOARPmHkIKureJGzgn8rsOLfSIypo1YgPMAf+4qQDdKCWYp5Xujn811de OMebSvR+LYf7/hsgI8srkdC29+C0UO3pXrEBjtU9FY2dnjIei0BF+S82GrD7DzfM4Syf 6ZSjq/XHRVwD7ukCHaRseHBGZQrhF61OLGo1Jg8BYWqMl2rXEwSM3fDLZeEV6odMkm2D zRw6NbiQzAr/DWffJrypG1EBuLXuUyasU6qi6OTTyo2/pMRf4HVdCxN+9IjPUBPIwjBJ Xi01Zz/O9L4sedj7aD+BQJVZO+Fla7+Hy2PJqUL9eeAvSZWIX+SV9f91CYBn4TxxooRT DjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133274; 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=/kG30QXgiqTlAY/aumHd2pxlHHbrLxsI9VJTymreolY=; b=T8bZBapOfEDI9pIv+d6b2e5s1q28a6JHe/BycFlSjbjZDWsORU3oIpbG1LAPN/8vG1 g7Pps7tOehKmA8a0p/LMm/C2mDS9j6m1zzbqTD7PFcfATRx6KPsFiTehLnkRQChYU8vX an3aEy3iQwB+xH//XAhWJkvGZfKARu4zfUOxs5qNrTmmpPvNXdpxeFXd5VrAVDYDjOBB De/5fWs/WBG1HgeCsQ+A7qXOBDphawpou1/Ejh54p9/jT1h4tdFjXg2bm6acYVQfGd6s qduxnAwRvZJml7msY2XCsXlIkA+DTSu0BPT2HAdjX2V6Lk2FDorhxoVrpxQ/+2TXOlxV l24w== X-Gm-Message-State: AAQBX9fpl5TwMW7GFWcsBQPGgYH4xrG3Py0Fgzi1hzipZJVN+mCPd2xg Jy4jdpY8iWR9CrGUtK34Yxq1BKgOpi0mBf1FQsMyiA== X-Google-Smtp-Source: AKy350YBdvxX56iatxua8XDpOtrHS+m/h/o/rEa2KkP9vJHz+4he2JyEeCpKm4LxC9Vz91dNj6Rz8g== X-Received: by 2002:a17:902:daca:b0:1a1:a5d9:146d with SMTP id q10-20020a170902daca00b001a1a5d9146dmr25711641plx.65.1680133274051; Wed, 29 Mar 2023 16:41:14 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:13 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Akhil Goyal , Radu Nicolau , Aviad Yehezkel , Boris Pismenny , Declan Doherty Subject: [PATCH v12 15/22] examples/ipsec-secgw: replace RTE_LOGTYPE_PORT Date: Wed, 29 Mar 2023 16:40:42 -0700 Message-Id: <20230329234049.11071-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 5f5d2685f64c..417bfb41cca5 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1130,7 +1130,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; } @@ -1138,13 +1138,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) } else { /* outbound */ if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TX IPSec offload is not supported\n"); return -EINVAL; } if (tso && (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TCP TSO offload is not supported\n"); return -EINVAL; } From patchwork Wed Mar 29 23:40:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125608 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5EF942868; Thu, 30 Mar 2023 01:42:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 37D6842D7C; Thu, 30 Mar 2023 01:41:20 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id E985642D4A for ; Thu, 30 Mar 2023 01:41:15 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id q102so15618078pjq.3 for ; Wed, 29 Mar 2023 16:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133275; 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=1wleyC5RN3HtbfpJxdzL5Ti1JMWLIQCoxA7ICzwu8uA=; b=KMILvjDbuYoD0loPa3MdcRMbyd6UepC3xYKbYgWuTXul7E+JGQhCZGL4oXlH3hl7g3 Fjjd7N91lRiwRFs4QVB9NoX8AfO8zeS+piEHxildKYiovi7MiIY2/7pzUSbFXod/SHWJ Rxd+MeVIDYf90J0X28x8EWVzjtsziqILWF4XCcmgqq4QJ/rFppk5/tBJnDaqzt7SsWYh fIixkNzZf6TO3oRzEP1hZbfxBxJzAlir0kdYnd1ai/2v1J8cJS1tQQnDQwqce5RUP8v/ 14y4EzlnnIUGgD4gVIWvtB3Vo8ALUODHdACluEf/Z61s26E93pghgBkqDku0smmxOALo kqzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133275; 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=1wleyC5RN3HtbfpJxdzL5Ti1JMWLIQCoxA7ICzwu8uA=; b=kMHOxidKPoPmCoAhZZPGsu2mdh/sxXfJ9VGNQNkUuoBL/SO90z6UV00B2+O0nzCgZa ld8Bpp7f99oShQ6d4BrXlggaymsHmXWBN3s42MmqEjrdtZjQMPsUcXIfUHWbLhTtedfi ci4g/2BRNdzYTLlKO5akwXebRS/jVqtJVR6FwhuyNlTzRovv7zzT+LFlYFhXkyCkxEO7 4lm6eo6q7cpDT2yS6y/03v2VnQh0FcyMUTIuE0Yc9Qj46tts/AbJ0BDqu+4WT896Dxn4 087t6R6+mQH7UdzR7OyAv40S3ZI/+YNuUXDfteBz9hrLa5ZyeNMQqVpfAyI4IG3Zvgjc ZIxA== X-Gm-Message-State: AAQBX9c9ZkGAPQBZ9TT1YWhc4Ue1tRKnZndmMSOJuuWR4O83+yiLPfLp nE4MmoOaW9H6ZJOwAV5TdCz7v0KFAQhfMdrG6GTvIw== X-Google-Smtp-Source: AKy350auMF+8eWWXZZQNwb0LPs7F5FNkMVNaO5pN64QqxgPQJfkTaQRK+GHQ6omKPH730XfandJnCw== X-Received: by 2002:a17:902:c950:b0:19e:b9f8:1fca with SMTP id i16-20020a170902c95000b0019eb9f81fcamr26502795pla.10.1680133275147; Wed, 29 Mar 2023 16:41:15 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:14 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v12 16/22] port: convert RTE_LOGTYPE_PORT to dynamic type Date: Wed, 29 Mar 2023 16:40:43 -0700 Message-Id: <20230329234049.11071-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split up the single static RTE_LOGTYPE_PORT into separate sub types for each component: port.ethdev, port.evendev, ... Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/port/rte_port_ethdev.c | 3 +++ lib/port/rte_port_eventdev.c | 4 ++++ lib/port/rte_port_fd.c | 3 +++ lib/port/rte_port_frag.c | 3 +++ lib/port/rte_port_kni.c | 3 +++ lib/port/rte_port_ras.c | 3 +++ lib/port/rte_port_ring.c | 3 +++ lib/port/rte_port_sched.c | 3 +++ lib/port/rte_port_source_sink.c | 3 +++ lib/port/rte_port_sym_crypto.c | 3 +++ 12 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d4b7088b5cbb..7f1d2c8a256d 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index f185fcbc5a94..b11aec69af78 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -39,7 +39,7 @@ extern "C" { /* was RTE_LOGTYPE_POWER */ /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ -#define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ + /* was RTE_LOGTYPE_PORT */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ diff --git a/lib/port/rte_port_ethdev.c b/lib/port/rte_port_ethdev.c index 0da7890261e9..6685d304a6e9 100644 --- a/lib/port/rte_port_ethdev.c +++ b/lib/port/rte_port_ethdev.c @@ -10,6 +10,9 @@ #include "rte_port_ethdev.h" +RTE_LOG_REGISTER_SUFFIX(port_ethdev_logtype, ethdev, INFO); +#define RTE_LOGTYPE_PORT port_ethdev_logtype + /* * Port ETHDEV Reader */ diff --git a/lib/port/rte_port_eventdev.c b/lib/port/rte_port_eventdev.c index fd7dac9a5661..04447bd7f7bc 100644 --- a/lib/port/rte_port_eventdev.c +++ b/lib/port/rte_port_eventdev.c @@ -5,11 +5,15 @@ #include #include +#include #include #include #include "rte_port_eventdev.h" +RTE_LOG_REGISTER_SUFFIX(port_eventdev_logtype, eventdev, INFO); +#define RTE_LOGTYPE_PORT port_eventdev_logtype + /* * Port EVENTDEV Reader */ diff --git a/lib/port/rte_port_fd.c b/lib/port/rte_port_fd.c index 932ecd324e05..b2412e7706ee 100644 --- a/lib/port/rte_port_fd.c +++ b/lib/port/rte_port_fd.c @@ -10,6 +10,9 @@ #include "rte_port_fd.h" +RTE_LOG_REGISTER_SUFFIX(port_fd_logtype, fd, INFO); +#define RTE_LOGTYPE_PORT port_fd_logtype + /* * Port FD Reader */ diff --git a/lib/port/rte_port_frag.c b/lib/port/rte_port_frag.c index e1f1892176c4..9adcbba47da1 100644 --- a/lib/port/rte_port_frag.c +++ b/lib/port/rte_port_frag.c @@ -7,6 +7,9 @@ #include "rte_port_frag.h" +RTE_LOG_REGISTER_SUFFIX(port_frag_logtype, frag, INFO); +#define RTE_LOGTYPE_PORT port_frag_logtype + /* Max number of fragments per packet allowed */ #define RTE_PORT_FRAG_MAX_FRAGS_PER_PACKET 0x80 diff --git a/lib/port/rte_port_kni.c b/lib/port/rte_port_kni.c index 1c7a6cb200ea..d4ac08b4cff0 100644 --- a/lib/port/rte_port_kni.c +++ b/lib/port/rte_port_kni.c @@ -9,6 +9,9 @@ #include "rte_port_kni.h" +RTE_LOG_REGISTER_SUFFIX(port_kni_logtype, kni, INFO); +#define RTE_LOGTYPE_PORT port_kni_logtype + /* * Port KNI Reader */ diff --git a/lib/port/rte_port_ras.c b/lib/port/rte_port_ras.c index e5de57da42ea..5a610b1ba5b5 100644 --- a/lib/port/rte_port_ras.c +++ b/lib/port/rte_port_ras.c @@ -9,6 +9,9 @@ #include "rte_port_ras.h" +RTE_LOG_REGISTER_SUFFIX(port_ras_logtype, ras, INFO); +#define RTE_LOGTYPE_PORT port_ras_logtype + #ifndef RTE_PORT_RAS_N_BUCKETS #define RTE_PORT_RAS_N_BUCKETS 4094 #endif diff --git a/lib/port/rte_port_ring.c b/lib/port/rte_port_ring.c index 52b2d8e557f0..32a90e836579 100644 --- a/lib/port/rte_port_ring.c +++ b/lib/port/rte_port_ring.c @@ -10,6 +10,9 @@ #include "rte_port_ring.h" +RTE_LOG_REGISTER_SUFFIX(port_ring_logtype, ring, INFO); +#define RTE_LOGTYPE_PORT port_ring_logtype + /* * Port RING Reader */ diff --git a/lib/port/rte_port_sched.c b/lib/port/rte_port_sched.c index 8a7d815ef323..6e0a8aba5419 100644 --- a/lib/port/rte_port_sched.c +++ b/lib/port/rte_port_sched.c @@ -7,6 +7,9 @@ #include "rte_port_sched.h" +RTE_LOG_REGISTER_SUFFIX(port_sched_logtype, sched, INFO); +#define RTE_LOGTYPE_PORT port_sched_logtype + /* * Reader */ diff --git a/lib/port/rte_port_source_sink.c b/lib/port/rte_port_source_sink.c index 7d73adc1e79e..e9cdadbceb8f 100644 --- a/lib/port/rte_port_source_sink.c +++ b/lib/port/rte_port_source_sink.c @@ -15,6 +15,9 @@ #include "rte_port_source_sink.h" +RTE_LOG_REGISTER_SUFFIX(port_source_logtype, source, INFO); +#define RTE_LOGTYPE_PORT port_source_logtype + /* * Port SOURCE */ diff --git a/lib/port/rte_port_sym_crypto.c b/lib/port/rte_port_sym_crypto.c index 295984d025cb..77a2f04d65f6 100644 --- a/lib/port/rte_port_sym_crypto.c +++ b/lib/port/rte_port_sym_crypto.c @@ -8,6 +8,9 @@ #include "rte_port_sym_crypto.h" +RTE_LOG_REGISTER_SUFFIX(port_crypto_logtype, crypto, INFO); +#define RTE_LOGTYPE_PORT port_crypto_logtype + /* * Port Crypto Reader */ From patchwork Wed Mar 29 23:40:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125609 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6138042868; Thu, 30 Mar 2023 01:42:38 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8958C42D3D; Thu, 30 Mar 2023 01:41:25 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id ABB9142D69 for ; Thu, 30 Mar 2023 01:41:17 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id x15so15632131pjk.2 for ; Wed, 29 Mar 2023 16:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133276; 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=KG1l4G35s0adQWHb2a8klPUSGEkiLy1z+c3HlBssSyQ=; b=ZTtSJYswPqMLwH/bNWSNFUd/D4k5f86oNEwpAh09jXATL0KLsnB1+5Aou/u8scAuUs fz1v/77rv26T99zSaEeeio8/F0f9odrFZNkf1sqPiTOIrCqRHN5WW3SM02YtBId/yseH LsxwSFXaJYqxxtj3i3r1qi+BOZ3f9ppKeEcAycZHq1y3iwb12FpSjjtyY2Wnvc0UgoSU PQfkOBuuw1T9Mz6RBUj+ZAMMulCoZkozRHbadVEjlidVrKxtC6OT1JcrJbGWr9Ul+cza 0xI43weLWxHpRBtXK1ayBmA2mHTD5KZ7zCgeDcSVJ7Vfu4QoU4AEQqMAgWxO0zVieytc SF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133276; 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=KG1l4G35s0adQWHb2a8klPUSGEkiLy1z+c3HlBssSyQ=; b=c1yx+tYYaQny3WGPSYZJBCLrvB2Tq8lYRubchaQSafupDfvm7wCDkM8BKgyA60JRqZ eRLV6i3Sswmfcx0KuXJNC2MYm75eaPNErehHQH2kGnLkfP+9ZvkEdIbxy7IdmJIzFeyc tO7eTdXbfbPEHnS1xFBJUZL42fgZW+ARfetIw8CEjvMznJQ11HYNgo+JwiSA1g6L0+sd 1M1qJ1EOrhAL+6usz+8IHIY1YW+DPIlpikMDYsO4r2dXvJI+biTMZGO3KTB2HtvODnUI mKbjavW4sm+M1Ul0obFVkY6XmgkUHUH/GWRgtlAp6g9lGLu56UCtlwzDPwpVUyjoTQF+ nYxA== X-Gm-Message-State: AAQBX9eFvXVdm+C3GzGVRo04MeBDiowDUd/6juxBdQUlHrWtrxpVen6Y bM1w/2/jy5Xyn6WsgOwGzWGkcf3QrrNCz25EtLgjBw== X-Google-Smtp-Source: AKy350bjrBb+Mt9Z7SWN7W38c2rHuL1/7TDmC9wydCjHvwLgE2XE/J2JgKIYY+CWXcCB1mFz3vo7WQ== X-Received: by 2002:a17:903:24d:b0:1a2:4efa:fcc0 with SMTP id j13-20020a170903024d00b001a24efafcc0mr13323078plh.1.1680133276537; Wed, 29 Mar 2023 16:41:16 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:15 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v12 17/22] hash: move rte_thash_gfni stubs out of header file Date: Wed, 29 Mar 2023 16:40:44 -0700 Message-Id: <20230329234049.11071-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 bdcebd19c29b..f03b047b2eec 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; From patchwork Wed Mar 29 23:40:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125610 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B8FF042868; Thu, 30 Mar 2023 01:42:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A665342D82; Thu, 30 Mar 2023 01:41:26 +0200 (CEST) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 0D4F342D4B for ; Thu, 30 Mar 2023 01:41:19 +0200 (CEST) Received: by mail-pj1-f48.google.com with SMTP id q102so15618183pjq.3 for ; Wed, 29 Mar 2023 16:41:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133278; 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=ajNSW0dhTFKFeRoVwFrppElVBjIDjifWwTugDwJNyR8=; b=6QEvGPsmdjjCzjECTQREysoUPrMHugACOH4CkgsIjKGt4U17s600VynGbNEOY71ERA BsZa2Hp+wfmzybBgIUCZxp+/Q6jjcEyTRe74KxCswbelHDFuMD8UPkZjjSkbZJYLXpFv NRSKxfWEZgSyY2QKAzrBs9gxK66B4Vl1Qu8XCUyKDVECIxAvMDtQexUcWXfVHkXM+tzG ZXiPkCYviesCFBxMYCihlFs64hSl7+t0U/VeEaNnUdSLZVK7QOqqH7swqPKv43rswWm5 OOGOat8+S/1ao8F1CglY6no5FV9lBw2AroyZ6yL4BpOvWL5LLEaRcAZF2IdSPpq1qneV I+kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133278; 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=ajNSW0dhTFKFeRoVwFrppElVBjIDjifWwTugDwJNyR8=; b=0yhdABZLEOB1Lm56l3ymFIoTu4KTCayHIzrAoX7WeEhxMphSTr3e/OEjasY/6uDWaa QV/3nqwNcuvm61K8nI4P1dwEMwYIX1m/ltjGxPwVOHeElBKLGixFW9XwqEW5mSJMLjcN Wtf4QsjJJkEo7Pf/SNsWvJkzv2iWAR2gsRbnM76ZgpnQaE14G+XJVdzM4m35vJQfbMCF Z6cHc6Yq9mFWnV6vEI7R89S2WPPUXVwE6K4K6Er/1AV9D9ydDQ4ULdEkvf2lnJjs5Xgi WaniMp5tdHA3/VLD72vV4oT4q2O/h0Pvsp5Q3VIrMHvlpcq806FB0EvBGKNShw2jIFZz wO7Q== X-Gm-Message-State: AAQBX9fJrzFS6hAFtfnOimLj3YwI7bjVmGudRR0RfRPw98sfctKqvOKS QWEATVlGzN07DgjhNoLjgYF6xRCCcJYXTKVfpxWyFQ== X-Google-Smtp-Source: AKy350Zz1X8kTjXCYIvgSzpYnwDjxBhWGS4cqRQ7+5Y8dTRSK5PCqE/fOwD9GCgu7ySPh1N8YJ5Wig== X-Received: by 2002:a17:902:f985:b0:1a1:d24f:a5f6 with SMTP id ky5-20020a170902f98500b001a1d24fa5f6mr19412830plb.46.1680133278174; Wed, 29 Mar 2023 16:41:18 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:17 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ruifeng Wang , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v12 18/22] hash: move rte_hash_set_alg out header Date: Wed, 29 Mar 2023 16:40:45 -0700 Message-Id: <20230329234049.11071-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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 0249ad16c5b6..e8145ee44204 100644 --- a/lib/hash/rte_hash_crc.h +++ b/lib/hash/rte_hash_crc.h @@ -20,8 +20,6 @@ extern "C" { #include #include #include -#include -#include #include "rte_crc_sw.h" @@ -31,7 +29,7 @@ extern "C" { #define CRC32_SSE42_x64 (CRC32_x64|CRC32_SSE42) #define CRC32_ARM64 (1U << 3) -static uint8_t crc32_alg = CRC32_SW; +extern uint8_t rte_hash_crc32_alg; #if defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) #include "rte_crc_arm64.h" @@ -53,48 +51,8 @@ static uint8_t crc32_alg = CRC32_SW; * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8) * */ -static inline void -rte_hash_crc_set_alg(uint8_t alg) -{ - crc32_alg = CRC32_SW; - - if (alg == CRC32_SW) - return; - -#if defined RTE_ARCH_X86 - if (!(alg & CRC32_SSE42_x64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) - crc32_alg = CRC32_SSE42; - else - crc32_alg = CRC32_SSE42_x64; -#endif - -#if defined RTE_ARCH_ARM64 - if (!(alg & CRC32_ARM64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) - crc32_alg = CRC32_ARM64; -#endif - - if (crc32_alg == CRC32_SW) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_SW\n"); -} - -/* Setting the best available algorithm */ -RTE_INIT(rte_hash_crc_init_alg) -{ -#if defined(RTE_ARCH_X86) - rte_hash_crc_set_alg(CRC32_SSE42_x64); -#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) - rte_hash_crc_set_alg(CRC32_ARM64); -#else - rte_hash_crc_set_alg(CRC32_SW); -#endif -} +void +rte_hash_crc_set_alg(uint8_t alg); #ifdef __DOXYGEN__ diff --git a/lib/hash/version.map b/lib/hash/version.map index f03b047b2eec..8b22aad5626b 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash; @@ -56,3 +57,9 @@ EXPERIMENTAL { rte_thash_gfni; rte_thash_gfni_bulk; }; + +INTERNAL { + global: + + rte_hash_crc32_alg; +}; From patchwork Wed Mar 29 23:40:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125611 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3343942868; Thu, 30 Mar 2023 01:42:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BBE0C42D8E; Thu, 30 Mar 2023 01:41:27 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id A0E8042D4D for ; Thu, 30 Mar 2023 01:41:20 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id f6-20020a17090ac28600b0023b9bf9eb63so17862856pjt.5 for ; Wed, 29 Mar 2023 16:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133279; 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=KYyjXTambFBbEixOpaOuxHXFoGzcAUqUXhHuF2gOOvw=; b=EfyP1VWnSUQ9aO2592DMOlKrzYJ7BCUn2sVdTkzrIweL6SUemgm1oTw4zgKfeUNuGm bXEq6/1FBM/qYzD1ye+Hhg5XNMdFdjFMv2RPu3UzJ5pD1ggb+jmD0bW2u98ysekNFfK5 XZR6Q3tzSE6lQGavYi7VJ+1txvLsFO+dgt3YQydR7vjIaDoISSFp+JgMwkwu+jyGlv8S 0S4t/J4IKEAIb3yDzD9BUZovdGx2Ocv+cUHuyxai7qppOEhJlKLtk0mgNaVHFX6LkJn/ SWLKpGF5Pr+MCmP+TyydyZIkp9Az9gVLW+KbST2Ez5ekLJjikY7it6FZGwfj7lfTbG1x /AGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133279; 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=KYyjXTambFBbEixOpaOuxHXFoGzcAUqUXhHuF2gOOvw=; b=c7kwfl+B/QSdkiFDqYZzpaICX+idvyRslVogtbpMQesph56Nusr3s5ghvwrrWe8CyU pPBedts0CXbF8KfUnUdD5GDGtVq0qgPipezWpMCfFW2cCHQ1Wrc53FW6ADFPNQssMjiu ylsCgVB0HOC+3leSTm5oTwNiK1HN4UhpxCHz1Y0Uxl/IEPfzoKDEPXJqWzSS/wTXa+Y1 5kNsDxw3K7QejPJ9d+fkv3Fc/kqFBYGIMhgOG9DVHRBnlRkcGQrKczFuCWcu+hoSwX4O 05fi5JT6RtdqL+vfChEQz+Epe496PHh+gYKQs8nZSoX1KByRuJhA+MRZLSUtQLVhyaxr bvzg== X-Gm-Message-State: AAQBX9f4DuNmz3HClDvAAyuynQnYgZ9JJdfnQtywYsAVIMPXkg1wBO2d FpaWoFs6hNl87hV33Lo7iDPa5II6w/wk9kPPga1uUw== X-Google-Smtp-Source: AKy350ZwHncW3iIpgF6bod1J6rcG7m62GB5QjjaPWbFpAQYREA1vYsK4oZnPl3OxeBcAdZlMCJfncw== X-Received: by 2002:a17:902:cec1:b0:1a1:aa28:e67a with SMTP id d1-20020a170902cec100b001a1aa28e67amr26117211plg.48.1680133279551; Wed, 29 Mar 2023 16:41:19 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:19 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v12 19/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Wed, 29 Mar 2023 16:40:46 -0700 Message-Id: <20230329234049.11071-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use dynamic type for hash and add subtypes for crc and gfni. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/hash/rte_cuckoo_hash.c | 5 +++++ lib/hash/rte_fbk_hash.c | 5 +++++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 7f1d2c8a256d..58f9c0ce629b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index b11aec69af78..4d1b892ab689 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -32,7 +32,7 @@ extern "C" { /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ + /* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 829b79c89a27..e2b07bfbad71 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -24,6 +24,11 @@ #include #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT(hash_logtype, INFO); +#define RTE_LOGTYPE_HASH hash_logtype + #include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */ diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c index 538b23a4030a..b4c4c191abdc 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -8,6 +8,8 @@ #include #include + +#include #include #include #include @@ -18,6 +20,9 @@ #include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO); +#define RTE_LOGTYPE_HASH fbk_hash_logtype + TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry); static struct rte_tailq_elem rte_fbk_hash_tailq = { diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index 0249883b8d07..c1fd2e34c9d4 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -13,6 +13,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO); +#define RTE_LOGTYPE_HASH thash_logtype + #define THASH_NAME_LEN 64 #define TOEPLITZ_HASH_LEN 32 diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c index eb334185725c..35206d575153 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -10,6 +10,9 @@ #ifndef RTE_THASH_GFNI_DEFINED +RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO); +#define RTE_LOGTYPE_HASH hash_gfni_logtype + uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused) From patchwork Wed Mar 29 23:40:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125612 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83BD742868; Thu, 30 Mar 2023 01:42:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0602E42D94; Thu, 30 Mar 2023 01:41:29 +0200 (CEST) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id D442B410F3 for ; Thu, 30 Mar 2023 01:41:21 +0200 (CEST) Received: by mail-pj1-f46.google.com with SMTP id a16so15610243pjs.4 for ; Wed, 29 Mar 2023 16:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133281; 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=ikHB5dtp5RYBSN0M0st0QKv2nFuCg8MaF4o7coZa0mo=; b=LvltUe7xQcSRhLgjCIxsEMbbqvlD9dro2fEk+hNSyGo/SeY7FN+o1aO7y5cxi91fD9 iXY5C0ndlmKxMsjldNCTfUYg57vbmlKyaYGAtE04Gtet3nmP4tRB5zG4pHZNusoeAhVE sY6JD0uJhOIovawgJWMC2j7DctXRJCiTav81RW28MdS7AdLt4ELS7xkSuGLTrXDpy9lF 4zg08w18dsfBkEk2hotu2kwOP5KfLxHz93eCuYVL3koyBl5djJWIOfv7v63bwuP7XHCQ jlJzWRPvuqDxWLMaGOX3CyvKr1O+VzIUSwJvXMfNbAZs+bD+2fso83Om1Qm5f4IhPJUD YUvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133281; 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=ikHB5dtp5RYBSN0M0st0QKv2nFuCg8MaF4o7coZa0mo=; b=JvDAZlxoWCFZrtY8+Z5Qnn3V35mK7riEeI87J1VmIU+BIiM2hI4PduBB06WJZDZQK7 Zo7USBzVp9fd8qwEAOTDyOQ63fYm5ApwnTVtRv7TamlK1ciTU/6ywRdUlLsOtVnsk1Y3 G8MRp8sNd45s7L4YnflNH6rgNmcwJ6uubavbxAWhp0/hro0tmVkiQg3sYf0MTx1p3hxc 93gYgsXNiS6RMCs4SlRczcWqKn8CSnZ1wc5HzhzYVtKGI/Ba89Af8CvJoPv7RcT6uamb nuFLHJA+N9mdd76YaUgyEGO5C9U77+SztoWKAFisNcX1DtOQRlxsu141bkbKNMdErDvk HR/w== X-Gm-Message-State: AAQBX9fhbwR/bDGTapPrQmuL4TVK/OUuu1thb8wD9/shx9VSNySeHXaH rB14gtzp9eJohSFO8LlmglSDPpAUXhxYDMIrctdVJA== X-Google-Smtp-Source: AKy350Zcb9Fkn+52PQVMVdQTbn/jpHK57856u6tCswgzlNcGlJ2xCdXVrLzKIz5yfR+F9c/zcVNreQ== X-Received: by 2002:a17:902:f90e:b0:1a1:d949:a54a with SMTP id kw14-20020a170902f90e00b001a1d949a54amr16220322plb.58.1680133280791; Wed, 29 Mar 2023 16:41:20 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:20 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v12 20/22] table: convert RTE_LOGTYPE_TABLE to dynamic type Date: Wed, 29 Mar 2023 16:40:47 -0700 Message-Id: <20230329234049.11071-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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/eal/common/eal_common_log.c | 1 - lib/eal/include/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/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 58f9c0ce629b..6c2d9bfc1950 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 4d1b892ab689..6418479ee266 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -40,7 +40,7 @@ extern "C" { /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ + /* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ diff --git a/lib/table/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 096ab8a7c824..42e9b58fbea5 100644 --- a/lib/table/rte_table.h +++ b/lib/table/rte_table.h @@ -265,6 +265,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 Wed Mar 29 23:40:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125613 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 965C942868; Thu, 30 Mar 2023 01:42:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C79242D8A; Thu, 30 Mar 2023 01:41:30 +0200 (CEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 86F0A410F3 for ; Thu, 30 Mar 2023 01:41:23 +0200 (CEST) Received: by mail-pj1-f51.google.com with SMTP id d13so15654958pjh.0 for ; Wed, 29 Mar 2023 16:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133282; 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=0YCKpW4jIfHCvzN6tn/0/EcWeUyCBmFO09oSmE9G8mikm+sJ0rQAdEY5p/3K21raFL qy0kzdlIRLfRvfWM3A9qi9I5q3N0EW0ybrk3OmiDRO7jrxnFOJRi2j59kFOEE+WZOF+S glKRuGGapTJKAYGLEpC77rG7GafUbllS4IKmNfgo/s7kapT/gC78X2GoebmaLtOIqWTK twn30gJkrP48qjs7aM/Yd+QYEo8qXZAIMxPBb4BIi5umP1l8s62xB92kTWSGqzmJcly4 4LL6KEJHRbXQ6JiMNRSfnltjc1vdf0Y6aQnuvR9804Omx4zwoFkGO8yypGIg7fUCylyL RVlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133282; 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=tdU8TXOt5pxsTPIdBbH6Ap/5pWs5yBFNnxEKtwIBG1oGQ9ZkiMVQgUGA0OKkh6gpNp 0zxknaaLzUUqCMufl52RzRqxzq8GeSaWtjn2CuQ9Oh1MO5dbOMx+W2cVqpFEHpgE9Ti8 7XNKr6pul3eQkAvRUCoeu8NHsBIIzgwncbFHJmXzA2Tm0umbfuLvb3wnP/gpvCoccTiF ZQMknDOg0bQ9l1nzOAg8HX4fsIqGjkdbRE/ai41zWKcQWpJ3zmexOuR44B3SHzpRltOh MFzrJj95hopDMYq/jzhiYp04JtxaTsJ/D4YB5hM3dmZNQFs5VK3KifFhZ4QDFMuyBRw+ 5C+w== X-Gm-Message-State: AAQBX9cR3+Xp9cyHSdqZ2G+BLm5J2pfc5aHQTXNyDNakGJ9M81Q8gkrG poOJ3iIVELkgJhE98uBHVvJewF6kjKgsRwkDesB8KA== X-Google-Smtp-Source: AKy350Zk8w7f3XgQCYMkl34J3NlpuHnyNyNYXrRWm8gTDigwGfPZot+sHz48cknTyymdrj8amY6wUA== X-Received: by 2002:a17:903:80f:b0:1a1:d655:1ce4 with SMTP id kr15-20020a170903080f00b001a1d6551ce4mr17773571plb.38.1680133282376; Wed, 29 Mar 2023 16:41:22 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v12 21/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Date: Wed, 29 Mar 2023 16:40:48 -0700 Message-Id: <20230329234049.11071-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Instead of using static type PIPELINE for logging in test application use stderr instead. If not testing RTE_LOG() better to not use it since log also goes to syslog. Signed-off-by: Stephen Hemminger --- app/test/test_table_acl.c | 50 ++++++++++++++++------------------ app/test/test_table_pipeline.c | 40 +++++++++++++-------------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index e66f06b84d0a..dff9bddfb948 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -165,7 +165,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -178,7 +178,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -190,7 +190,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -202,7 +202,7 @@ parse_cb_ipv4_rule(char *str, struct rte_table_acl_rule_add_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -254,7 +254,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRC_FIELD_IPV4].value.u32, &v->field_value[SRC_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read src address/mask: %s\n", + fprintf(stderr, "failed to read src address/mask: %s\n", in[CB_FLD_SRC_ADDR]); return rc; } @@ -267,7 +267,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DST_FIELD_IPV4].value.u32, &v->field_value[DST_FIELD_IPV4].mask_range.u32); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest address/mask: %s\n", + fprintf(stderr, "failed to read dest address/mask: %s\n", in[CB_FLD_DST_ADDR]); return rc; } @@ -279,7 +279,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[SRCP_FIELD_IPV4].value.u16, &v->field_value[SRCP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read source port range: %s\n", + fprintf(stderr, "failed to read source port range: %s\n", in[CB_FLD_SRC_PORT_RANGE]); return rc; } @@ -291,7 +291,7 @@ parse_cb_ipv4_rule_del(char *str, struct rte_table_acl_rule_delete_params *v) &v->field_value[DSTP_FIELD_IPV4].value.u16, &v->field_value[DSTP_FIELD_IPV4].mask_range.u16); if (rc != 0) { - RTE_LOG(ERR, PIPELINE, "failed to read dest port range: %s\n", + fprintf(stderr, "failed to read dest port range: %s\n", in[CB_FLD_DST_PORT_RANGE]); return rc; } @@ -346,7 +346,7 @@ setup_acl_pipeline(void) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -410,7 +410,7 @@ setup_acl_pipeline(void) table_params.f_action_miss = NULL; table_params.action_data_size = 0; - RTE_LOG(INFO, PIPELINE, "miss_action=%x\n", + printf("miss_action=%x\n", table_entry_miss_action); printf("RTE_ACL_RULE_SZ(%zu) = %zu\n", DIM(ipv4_defs), @@ -471,9 +471,8 @@ setup_acl_pipeline(void) ret = parser(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -513,9 +512,8 @@ setup_acl_pipeline(void) ret = parse_cb_ipv4_rule_del(line, &keys[n]); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -549,9 +547,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, - "line %u: parse_cb_ipv4vlan_rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse_cb_ipv4vlan_rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -575,8 +572,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule " - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -602,8 +599,8 @@ setup_acl_pipeline(void) ret = parser(line, &rule_params); if (ret != 0) { - RTE_LOG(ERR, PIPELINE, "line %u: parse rule" - " failed, error code: %d (%s)\n", + fprintf(stderr, + "line %u: parse rule failed, error code: %d (%s)\n", n, ret, strerror(-ret)); return ret; } @@ -667,7 +664,7 @@ test_pipeline_single_filter(int expected_count) memcpy(rte_pktmbuf_mtod(mbuf, char *), &five_tuple, sizeof(struct ipv4_5tuple)); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + printf("%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], mbuf); } @@ -702,9 +699,8 @@ test_pipeline_single_filter(int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets for ACL test, " - "expected %d, got %d\n", + fprintf(stderr, + "%s: Unexpected packets for ACL test, expected %d, got %d\n", __func__, expected_count, tx_count); goto fail; } diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index 7adbbffbf55d..960f730cf20d 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include "test_table.h" @@ -173,30 +172,31 @@ check_pipeline_invalid_params(void) p = rte_pipeline_create(NULL); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: configured pipeline with null params\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_1); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with NULL " - "name\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with NULL name\n", __func__); goto fail; } p = rte_pipeline_create(&pipeline_params_2); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with invalid " - "socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", __func__); goto fail; } if (rte_eal_has_hugepages()) { p = rte_pipeline_create(&pipeline_params_3); if (p != NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Configure pipeline with " - "invalid socket\n", __func__); + fprintf(stderr, + "%s: Configure pipeline with invalid socket\n", + __func__); goto fail; } } @@ -224,20 +224,20 @@ setup_pipeline(int test_type) .socket_id = 0, }; - RTE_LOG(INFO, PIPELINE, "%s: **** Setting up %s test\n", + fprintf(stderr, "%s: **** Setting up %s test\n", __func__, pipeline_test_names[test_type]); /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } ret = rte_pipeline_free(p); if (ret != 0) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to free pipeline\n", + fprintf(stderr, "%s: Failed to free pipeline\n", __func__); goto fail; } @@ -245,7 +245,7 @@ setup_pipeline(int test_type) /* Pipeline configuration */ p = rte_pipeline_create(&pipeline_params); if (p == NULL) { - RTE_LOG(INFO, PIPELINE, "%s: Failed to configure pipeline\n", + fprintf(stderr, "%s: Failed to configure pipeline\n", __func__); goto fail; } @@ -411,7 +411,7 @@ test_pipeline_single_filter(int test_type, int expected_count) int ret; int tx_count; - RTE_LOG(INFO, PIPELINE, "%s: **** Running %s test\n", + fprintf(stderr, "%s: **** Running %s test\n", __func__, pipeline_test_names[test_type]); /* Run pipeline once */ for (i = 0; i < N_PORTS; i++) @@ -420,7 +420,7 @@ test_pipeline_single_filter(int test_type, int expected_count) ret = rte_pipeline_flush(NULL); if (ret != -EINVAL) { - RTE_LOG(INFO, PIPELINE, + fprintf(stderr, "%s: No pipeline flush error NULL pipeline (%d)\n", __func__, ret); goto fail; @@ -445,7 +445,7 @@ test_pipeline_single_filter(int test_type, int expected_count) k32 = (uint32_t *) key; k32[0] = 0xadadadad >> (j % 2); - RTE_LOG(INFO, PIPELINE, "%s: Enqueue onto ring %d\n", + fprintf(stderr, "%s: Enqueue onto ring %d\n", __func__, i); rte_ring_enqueue(rings_rx[i], m); } @@ -487,9 +487,9 @@ test_pipeline_single_filter(int test_type, int expected_count) } if (tx_count != expected_count) { - RTE_LOG(INFO, PIPELINE, - "%s: Unexpected packets out for %s test, expected %d, " - "got %d\n", __func__, pipeline_test_names[test_type], + fprintf(stderr, + "%s: Unexpected packets out for %s test, expected %d, got %d\n", + __func__, pipeline_test_names[test_type], expected_count, tx_count); goto fail; } @@ -564,8 +564,8 @@ test_table_pipeline(void) connect_miss_action_to_table = 0; if (check_pipeline_invalid_params()) { - RTE_LOG(INFO, PIPELINE, "%s: Check pipeline invalid params " - "failed.\n", __func__); + fprintf(stderr, "%s: Check pipeline invalid params failed.\n", + __func__); return -1; } From patchwork Wed Mar 29 23:40:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 125614 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97CB442868; Thu, 30 Mar 2023 01:43:05 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FA0542DA5; Thu, 30 Mar 2023 01:41:31 +0200 (CEST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id C23D4410F3 for ; Thu, 30 Mar 2023 01:41:24 +0200 (CEST) Received: by mail-pj1-f54.google.com with SMTP id p3-20020a17090a74c300b0023f69bc7a68so17854709pjl.4 for ; Wed, 29 Mar 2023 16:41:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1680133283; 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=3GduaEJO85tMcNb+Ad5gJVBuZLPJOhi/Xoc8mAt2tZU=; b=6xRYHTv29NZk39yhV/1C+hCmlf5wvISAjgmHJgDZQ40LeyjLpB3jY9vzf5uiv2EA7J AOeVQnhaQbIwt6EXvcLXtz4tnAtKrKtNDN2klEkMikmRp0yoIsY+mGw2P6qxp1evTg2u 35ryM2HFP/6f0U6uejdKE4s65AucKWInecyeQkoNvmWMaZdQBKbLS8lOs/Pca+mcqfhh /qHMdTuktNP0K69KnD4VDGo69Sn/d++28enacE9gncc/SqToB2DTLiTfaLfUS29PWKl+ tKTpNP1YLs3VEiUO+4FoP6OvMCeZ1g0k3X6CxUtlVQLF8o4LX8EGAKuCytm81qhN4dXr c1Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680133283; 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=3GduaEJO85tMcNb+Ad5gJVBuZLPJOhi/Xoc8mAt2tZU=; b=aEL4rwKelHTo4W/uvwnvUBQzJO+RPRoNFMLXxjaCKBzRIYApiOGypRfycAstnhGJzs B9+/nYITWTb/Jc9MYz8bnS9C4IDe/WfJVG9vBL8mGeGN/cq6qBDxbpNKPWJ5euUi1oQS Aas4NXocOg6kGFl4kYPtaK5XlPdVV0aMk5AX6TvUJn1chPENacpwb8rQ4+JPUO3YQAdM yS4mmb+918wG1t4mfbXVNT5cdBHkTVrb1issw3ZKlLQKKqyh8/iDsiUGfQfy2r887ypP ZnjW8zbIYbHuYnW2GOOu3tMS14ZjjuwB2a7mN6E8zVbuVF/xEYvX/7SBplr6QgvXZbS7 WcGw== X-Gm-Message-State: AAQBX9ep56OiXIbDlg+8evuc29jpxQs4K+jXExv/nYh4ooMUM0ZCK/PW PXlnFgAn5TlShvZ1UwtVRcdv7EZLlSZQvGQ1hAi5sw== X-Google-Smtp-Source: AKy350bW+yzyle27Vf5qskcWFoDlGkYr7QQDDHCLWtWHhDyxQ6IC/FmLjwBRXAsKRHzcdigfrSL7wA== X-Received: by 2002:a17:903:2803:b0:19e:73df:b0e9 with SMTP id kp3-20020a170903280300b0019e73dfb0e9mr17441904plb.21.1680133283700; Wed, 29 Mar 2023 16:41:23 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b0019c2b1c4db1sm23360095plt.239.2023.03.29.16.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Mar 2023 16:41:23 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v12 22/22] pipeline: convert RTE_LOGTYPE_PIPELINE to dynamic type Date: Wed, 29 Mar 2023 16:40:49 -0700 Message-Id: <20230329234049.11071-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230329234049.11071-1-stephen@networkplumber.org> References: <20230329234049.11071-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/eal/common/eal_common_log.c | 1 - lib/eal/include/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/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 6c2d9bfc1950..704924e822d0 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 6418479ee266..29db07881a5a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -41,7 +41,7 @@ extern "C" { /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ + /* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c index ff86c7cf96bf..3b9b083b390d 100644 --- a/lib/pipeline/rte_pipeline.c +++ b/lib/pipeline/rte_pipeline.c @@ -1612,3 +1612,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 3cfb6868f727..ebae08de644f 100644 --- a/lib/pipeline/rte_pipeline.h +++ b/lib/pipeline/rte_pipeline.h @@ -841,6 +841,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