From patchwork Tue Feb 14 22:47:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123909 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 6497A41C99; Tue, 14 Feb 2023 23:47:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54CE842FAE; Tue, 14 Feb 2023 23:47:51 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id B9EBA42FAA for ; Tue, 14 Feb 2023 23:47:50 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id d13-20020a17090ad3cd00b0023127b2d602so225311pjw.2 for ; Tue, 14 Feb 2023 14:47:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=L3aqaeK/W/k2B6TMYwTak/loUQqlYC0thUkEp6I0Mps=; b=5sHUj8NluqTIqQpu1VgKv630NrsV4pLwVJfF3PKitnCdlni7V4SvbApZpbfLKZQB6C CcNaigmNQ0BrhH6knHBtMbyc7cxRlvKxbM56IFSXG2ZG026TJHctyZm3OKCbQTCgmEeI q+SUicoGt7X0j/G3VPjjtsA6um7Fbo9zwj0uKgeZVAp2PdIo9bbI8FpNQS3tqLrf/hz6 bYuN6+tkS/5lq8Mjw7UnljL7Uj2V/u1bOsT59O/PCpWgS0RSe9ngQbloARxO+x4J9Ewa pLUk3bR8EnkU25aWnY4emStIZtNDgBRCMX3MUW6wr+zydKbCkF0deRvwKLWaqMiEr+Ll WePg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L3aqaeK/W/k2B6TMYwTak/loUQqlYC0thUkEp6I0Mps=; b=OWDebsKvY+lPcv2j4XnNG7pN8SPQq8AgOzhiur1jqLfovHEfLDegeVGr95GOEsog0D /AfSm+xikeKJkpQcRx5LLM4wZWEozNeK0bQApgk1isWxYkZBJcsLDxLni6E47bTSXk5w z4336121aG2LHNWUtSgQETSIkO/HceaOSafZDWhw6jTjQYyOdjAUE+RRgKgr5C/sr7Qf Hl0qm84njWeV5oEdh7+Z9ohuUNew1QmvTwEDYiR627EqHm6pjB8+/3IjZOXD+/naChUM n8oEjPCznckw/2Mrcpa5u8DIo+5hHVYOpJWYb3W1vNZWUKxlykYyHNWhV/FuhDwD+B5h JXpg== X-Gm-Message-State: AO0yUKVdWXYrlbUZ+J2nAX6YJhlhXWgK2i357a4arAWgUvCGZMgbO6J/ MRx6q4dySpQxosC1fHLQEEDwW7T2Gcq/ZsNpd88= X-Google-Smtp-Source: AK7set+n6SAdr7E7x0qf9zVLa/eHMLfZ/oRU0dqnHEmWbECEKzsVn5/U+mPWXfrdAaldAoTFoDfiRw== X-Received: by 2002:a17:903:22cd:b0:19a:aacf:92b6 with SMTP id y13-20020a17090322cd00b0019aaacf92b6mr252621plg.40.1676414869538; Tue, 14 Feb 2023 14:47:49 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:49 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , jiayu.hu@intel.com, Konstantin Ananyev , Mark Kavanagh Subject: [PATCH v6 01/22] gso: don't log message on non TCP/UDP Date: Tue, 14 Feb 2023 14:47:14 -0800 Message-Id: <20230214224735.1404326-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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") Cc: jiayu.hu@intel.com Signed-off-by: Stephen Hemminger --- lib/gso/rte_gso.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/gso/rte_gso.c b/lib/gso/rte_gso.c index 4b59217c16ee..c8e67c2d4b48 100644 --- a/lib/gso/rte_gso.c +++ b/lib/gso/rte_gso.c @@ -80,9 +80,8 @@ rte_gso_segment(struct rte_mbuf *pkt, ret = gso_udp4_segment(pkt, gso_size, direct_pool, indirect_pool, pkts_out, nb_pkts_out); } else { - /* unsupported packet, skip */ - RTE_LOG(DEBUG, GSO, "Unsupported packet type\n"); - ret = 0; + ret = -ENOTSUP; /* only UDP or TCP allowed */ + } if (ret < 0) { From patchwork Tue Feb 14 22:47:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123910 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 8F68341C99; Tue, 14 Feb 2023 23:47:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDBD042FDC; Tue, 14 Feb 2023 23:47:52 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 8549342FAA for ; Tue, 14 Feb 2023 23:47:51 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id z14-20020a17090abd8e00b00233bb9d6bdcso219705pjr.4 for ; Tue, 14 Feb 2023 14:47:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=V9Kt7oTF7UOze3PgNSFkM4Zjg2wOosJOCNnRu50oJkE=; b=NrCsbKpNZx7086Ad2/1JsbpUTkUOh0XGGJlnk8py5TTupPQUtlS0VeHc4cE7+LegFX l1MgVJXKx33YTBNBV2nYFxuF6gqUGTN2pv7ovGO+kKHjEgMp4w22CYMd2e4Paxncm3rn H0eLMDA9ZC1o8PGJ5ypla+F2RmOVV1EonIU0gT6CPEtbVHeb5ikZBQxq8Jq5eS2Zo133 /30EA2UyPLhaenwecUjpWCdPUUd4vXOU5y7AYD+TT407ZYjRCZQy7N915UiW/O0z9SKu 9LU8jCRXH3/ClriU5JP/6LpR1D1l+nI0H3JjfSeZvdT/pr8/YiX7x3DS96c8RAnvRdTn 06Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V9Kt7oTF7UOze3PgNSFkM4Zjg2wOosJOCNnRu50oJkE=; b=1ikH67Ja3Kw2VjNvgyhBqvpdslZ0DWRFut5tohA3ZJLnTT765okfXtT+/68faCCX55 Lga13NGbqgsEQhVqnduyayGj6unWX7ix3mNjoc43nPRYWzrEPz7TrebZoMJI3TX21UNO V7OwYX9rw/g13C9WryVlpgn6M7wInYLyZXec0whr47O71VO3V76RMFpxiTuwTgQf0LsI htiDOTlK4Y4wo9Rrd3iv+Gm6SoPyqGMLi3F2UW08lpEZ2FnsOQiOg7iivzMiiMd0KNq/ ey57PSMIkIfkpbiSfDkrS1ZU0OaJHSuqOEscwXFKO4rLHHU09pokHg7uwFvocTLQP3Vs GuIA== X-Gm-Message-State: AO0yUKXXY/ZKoTsILGviCjvyDqFedx8kHjp3pS+ZU8JpVNGKHf5YKozv t+TYc45bCKAkoUeS/wzSD59hiTn8WVpVyBY9mYA= X-Google-Smtp-Source: AK7set9PvKQTd8N6N6q+C2oyb4HNWp/MiqkMDQXqbULxEiEiMm+YMdt5Yq3QKw35p8QXuFd2L//Gtg== X-Received: by 2002:a17:902:e88e:b0:19a:95ab:6b2b with SMTP id w14-20020a170902e88e00b0019a95ab6b2bmr244498plg.69.1676414870544; Tue, 14 Feb 2023 14:47:50 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v6 02/22] eal: drop no longer used GSO logtype Date: Tue, 14 Feb 2023 14:47:15 -0800 Message-Id: <20230214224735.1404326-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Tue Feb 14 22:47:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123911 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 C0B3F41C99; Tue, 14 Feb 2023 23:48:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2858242FCA; Tue, 14 Feb 2023 23:47:57 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id A9B4842FD2 for ; Tue, 14 Feb 2023 23:47:52 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id ja21so10944026plb.13 for ; Tue, 14 Feb 2023 14:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KaYsu7gz7TO+vOUNdxRcqvUT1IJO0KThl+eic2e4JGE=; b=uNOnYCITSZZd1II8q39bqQhnv4wBzxHWvCGOuW6Id7mT4WdyZbbpFIg9iMxNmdx9TJ EtnHlzDfre+f8xqjlJHSp5ASvLIT/7+1HZipuw3e0mwr3FgywUo2QmrbqyQbB9wG7LQx cQPKwQt3AQYEUml8Dez/Iu8OaIOEak662XmLFI/pcRMEi3xTv96kRnfLUqCxpY0M8doF 6FEyTtT1iNEfsnCVkUTcA0Rx7OP8MCBn+uvBsIYY6+ekWqE8kw2gxiyJ0xp7heq9Cvw1 9q9FJelv64OEyJ38Es57FMefr0xhAVhA2PI/e8JYbaj4wzGRB3gR3ov+k6ahbOOuegWC nIMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KaYsu7gz7TO+vOUNdxRcqvUT1IJO0KThl+eic2e4JGE=; b=G/Mj71svbhhFWySVkF1tlc7izXEG7n0AhRQOzHem6+7RuBLOhmoIbwS0uSkBpC4MgI BimBqFfSw6NkRphtUGXgXRIZ/KKiM3w54IshXEc8RqP8qhxmjeI1TLy+NxszZQRim+ml 8DkAHcdsE/5Q7HK6i7Iao1i28ahSpLEDb5kPA/vpud2isEtCJgqNZM5oBEYJKcKxshcN u47qAStx4B9B5v+3IBCkomxmPqO1y2DgS7r3ZR1gqjU6wWNwe/oz/HW2aIb96U1GpEty UrEZV2a1VQiCQLDHtPQjQR6HDyeyADtMb9h/uUoqzFhDyU9F2g2pzq1/o07BcnWgjzpn K38Q== X-Gm-Message-State: AO0yUKWQy8wb8pv3R/8xNy/I9x4xTcmRKagmhG9YJtdPSulSVpmXK+JU ZNdwJCHWSjMVCl3XoioiGNZ6pihiaqKiZ1ms2CE= X-Google-Smtp-Source: AK7set9jXMipqUwrIKik1+gwlMSqVCqaFtElNCy4EQsnK+oYPDLtT6iupjhA6B1eXv3A8BBlOUMSpA== X-Received: by 2002:a17:903:22cb:b0:198:fded:3b69 with SMTP id y11-20020a17090322cb00b00198fded3b69mr273832plg.53.1676414871686; Tue, 14 Feb 2023 14:47:51 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:51 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v6 03/22] log: drop unused RTE_LOGTYPE_TIMER Date: Tue, 14 Feb 2023 14:47:16 -0800 Message-Id: <20230214224735.1404326-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Tue Feb 14 22:47:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123912 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 1610A41C99; Tue, 14 Feb 2023 23:48:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3C61842FEA; Tue, 14 Feb 2023 23:47:58 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id C271342FE2 for ; Tue, 14 Feb 2023 23:47:53 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id d13-20020a17090ad3cd00b0023127b2d602so225389pjw.2 for ; Tue, 14 Feb 2023 14:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FrfwLdhV+EIM8WzjRK5TTqwgqLcuffFo4XoPQSRVVwc=; b=i98GXfP6LKqAsYYX/TqDDyLqr13SqYymMkZE+J7J2WFUjYc5EYs4C5jAWBcu+Gyar5 yMz5zLd5Zr1kf8NYiQJXvt1fcoZxFuVJWOMzLzyz3bhmAtV0GW1LGc7Y9ZDem3T1Yfp3 lXzwhG8P4W+Bq+/Skxg/U+lonSQgE6iuqOB7AOleTf8TIq3YYVv3N9awUthxnuI4uBKj Ig6LrQm5Ucm1+7U1YqmKthkfmcyYmINAMrZ702s/pVQdFl47zCLSqkBP572Xj8PlXxgC q7z3MoDHawmmBE7ot1MS9C2fe3wFoUmBZGWC0XXILJUiHfQRpMTPpFSmD4Du0o9uBMVX Rr7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FrfwLdhV+EIM8WzjRK5TTqwgqLcuffFo4XoPQSRVVwc=; b=XmjSU2FwnsVOWL6xek4gQ6qDC/ddMNaC7C9GUVCnMZ/eH4V2JPj8rXLs1d2e56/T06 CSsBh3zCHa5o6DZIRhD0lV7IOimwNTHF9HZFybhrTXFbMTRjf7cIvLIIUda04mCC996M 7yxzhRHzIoEqmtblxE/+I6VXlo9RRW2zrylrKnmfkOZhsA+TU8EjzbY+iabDA43HpHzT 0oa4Kn6L/Pp5jvnWP6zIz5uFFtT92wUh2TyLQnnOIs7n5Yo0358mBguP0+N19r+mPvN1 qZmf/eDgTfDSxZWiwr0F6wTgtSiK3vyHUtDMZInY7eoFXCWZ+gruSa/8i2liLE/HruYr 0u4g== X-Gm-Message-State: AO0yUKXvH3Ks6Hxto+TUog6AnKzE17QdcUa81/IEJhyKAekF6OJ1IJg7 PFufBMSpZojz6qA2T5krOgh9y4VTIqqdTZeQ2Ug= X-Google-Smtp-Source: AK7set8YmxelGMKO8ByQHPlMelH1CoQxE1O+aRGYCr5nbcsrwN+BWEuVq8gDB6F+++f/svgK6OLNjw== X-Received: by 2002:a17:902:fb07:b0:199:4fcc:b358 with SMTP id le7-20020a170902fb0700b001994fccb358mr208590plb.51.1676414873072; Tue, 14 Feb 2023 14:47:53 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Byron Marohn , Yipeng Wang Subject: [PATCH v6 04/22] efd: replace RTE_LOGTYPE_EFD with dynamic type Date: Tue, 14 Feb 2023 14:47:17 -0800 Message-Id: <20230214224735.1404326-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 | 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 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..9cfa75bf93b0 100644 --- a/lib/efd/rte_efd.c +++ b/lib/efd/rte_efd.c @@ -28,6 +28,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 Tue Feb 14 22:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123913 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 A5C4141C99; Tue, 14 Feb 2023 23:48:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4ECFE42FF0; Tue, 14 Feb 2023 23:47:59 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 244A142FC0 for ; Tue, 14 Feb 2023 23:47:55 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id e12so1013881plh.6 for ; Tue, 14 Feb 2023 14:47:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=E9jB4a9XrLrsp8wixlLbjA92Gdx2l8vH2NguQCOazr6ow3o7zxohqkZHp+528nKW8j HJ01B2edAknmp643JKa0NlPdLzWtQmt9s5BuoLcgp58CwOZ7zNf3ALgmp5nwTbmOMwSY Oa0Y66fc6Nsr85eyqeUN3YqraSxj/Iv7JnZ0NrQHhNX1otwWUMhwIg1aKAVvhQZ4wGli ekjkYWbT7u4xz7E9wbNORWvbkB1zC+urQZqiPe6izwMgl4uljHNEUGKwJUHNjtcnNYAp uoFqMLRSnnbZbO0Kq3vkcx5OUDkkEmokJG4WJcLQIRA2qcO3JSd7p+2ufbOkMqmciahO /mfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XhWRpJQsp5imdcvq0PIuBzX1gbd/UZc8K08WO2FGJ+s=; b=NLbjPJ8bimS4BET+ofwd26v0/16DfbB3+l2rXdzhz5kSySSxliR4c0IS7fKn/bszII hrddGxXyziBmP0NdyakmhNrW7pMsZRlxCwHG0q/pP69j5cvrzRRQJz/S0PlkllWC1he0 ZB9tyyNk3q+al7PA1l6SqQ/wupNCO2rLl+B23lsoQv2+AFDpYe/EQ+Hj4xz9RnTwx/sL +ydybXtoI5XpNwWRUyru0ScGfNj8zqKzbFleM2ZjYAItMLkiYxRB/BBwX4NQlcadaMoC 71IVSGJLVGfY/sy8jiJ+I/f/dhGNNY57S19IttSVTa8/fyDpWNK14QSc/DS6iP29BcQS Y75Q== X-Gm-Message-State: AO0yUKX5GwNR1/l1Ul1PrpYH1jV9ci8vZ8+fnF7FBd1/JXwxjtHVhAFu zh3PNDDEPULZzu/Su8EyEe5YBzRje4hwXQMuFBc= X-Google-Smtp-Source: AK7set+YdoKhBCyXV7i5xHcV6t1tFi4HjJlWAnqTgaSugHnepd/CHa68py+gG0010YHgdphEfSuRUw== X-Received: by 2002:a17:902:f292:b0:193:38ce:7bb8 with SMTP id k18-20020a170902f29200b0019338ce7bb8mr218018plc.37.1676414874103; Tue, 14 Feb 2023 14:47:54 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:53 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz Subject: [PATCH v6 05/22] mbuf: replace RTE_LOGTYPE_MBUF with dynamic type Date: Tue, 14 Feb 2023 14:47:18 -0800 Message-Id: <20230214224735.1404326-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Introduce a new dynamic logtype for mbuf related messages. Since this is used in multiple files put one macro in mbuf_log.h Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/mbuf/mbuf_log.h | 4 ++++ lib/mbuf/rte_mbuf.c | 4 ++++ lib/mbuf/rte_mbuf_dyn.c | 2 ++ lib/mbuf/rte_mbuf_pool_ops.c | 2 ++ 6 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 lib/mbuf/mbuf_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 25bb17938cc1..d4389e436913 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -363,7 +363,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_PORT, "lib.port"}, {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, - {RTE_LOGTYPE_MBUF, "lib.mbuf"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 0b39795b4d06..941fbe51fd30 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -42,7 +42,7 @@ extern "C" { #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ #define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ -#define RTE_LOGTYPE_MBUF 16 /**< Log related to mbuf. */ + /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ diff --git a/lib/mbuf/mbuf_log.h b/lib/mbuf/mbuf_log.h new file mode 100644 index 000000000000..d759a9a25501 --- /dev/null +++ b/lib/mbuf/mbuf_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mbuf_logtype; +#define RTE_LOGTYPE_MBUF mbuf_logtype diff --git a/lib/mbuf/rte_mbuf.c b/lib/mbuf/rte_mbuf.c index cfd8062f1e6a..4a379a5185d5 100644 --- a/lib/mbuf/rte_mbuf.c +++ b/lib/mbuf/rte_mbuf.c @@ -20,6 +20,10 @@ #include #include +#include "mbuf_log.h" + +RTE_LOG_REGISTER_DEFAULT(mbuf_logtype, INFO); + /* * pktmbuf pool constructor, given as a callback function to * rte_mempool_create(), or called directly if using diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c index 35839e938cc5..01654db03fc8 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -17,6 +17,8 @@ #include #include +#include "mbuf_log.h" + #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn" struct mbuf_dynfield_elt { diff --git a/lib/mbuf/rte_mbuf_pool_ops.c b/lib/mbuf/rte_mbuf_pool_ops.c index 4c91f4ce8569..5318430126cb 100644 --- a/lib/mbuf/rte_mbuf_pool_ops.c +++ b/lib/mbuf/rte_mbuf_pool_ops.c @@ -8,6 +8,8 @@ #include #include +#include "mbuf_log.h" + int rte_mbuf_set_platform_mempool_ops(const char *ops_name) { From patchwork Tue Feb 14 22:47:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123914 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 9B2B041C99; Tue, 14 Feb 2023 23:48:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7487242FFA; Tue, 14 Feb 2023 23:48:00 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 4A21242FC6 for ; Tue, 14 Feb 2023 23:47:56 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id kk7-20020a17090b4a0700b00234463de251so246611pjb.3 for ; Tue, 14 Feb 2023 14:47:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ldJ1TGJozc5mJEWZuOvXWpF5n6V+gym2v8kL89wnvo=; b=Z27QZ9+r5NTI8G5qlOSImzRSv5+0CJy9v4fYLn0j4eLEAeYgwo2sOqjjAeu1dFlJV3 Q1KRxXjWznSEqIutRuX+5G3lIcb1zPcF9NNVrhacJObkp/IhgKfEzhyS9u8JcHe4L85R 5FgKXgcKO0N+P1Dt0Bl26IIGjZ/K0Yg5JYSYsHVwjlvKxrzjCgoEJnxKRTChnjF9tKGk v1UJirpJbX8jzG2hDnD1D9h1DoS+u8tKCR9QX2EQZOWEt/g5eeUBIYgg9d8Mgj2ne9IY G1gWYKhKcMTvo2tWjnZhltiXem7NSOeCLcHb01CQ/zKiuH3mqsWd0dXuVtQl0jPeLId3 XWeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ldJ1TGJozc5mJEWZuOvXWpF5n6V+gym2v8kL89wnvo=; b=a6YlDwrwIXXAX+BIZiVYb7Tq3kXaVwb1WZ2AOYqweoNVrTA+n9Bqq1uooywU9eh31o mYtby1njVj7ZO6ngopSWe2o6cQAJY0mcYnQXCS5NaBKQi7ooQqRCRVF+vuh9iogh03qA u3iqGPtr865gq2yLTmBpEZSacP2QSUReNkOFBAq+Usc99tPfSvM8DQp7ADtiP8qGo0re djW7xRPHUx1cdu/XoR6WPKUieFF3zWN2GITxyYAxbKjvaYxdomCxeLf0lwjCzqobqgCP WJXaeYohKHXlVicE6nK2CpIkuFhZMpVzVT/zov/Aj9fXt5Ph2g17IfyWkg7kZwnTOWXU Ituw== X-Gm-Message-State: AO0yUKWxvl38cur49HLG9uICqY9Dk8H0rr57kqaeDn8w/NxGo1LFB91v oGzI7k+iOvwaq1WcfZT9kAi/Kc9qm4p4hbkCixg= X-Google-Smtp-Source: AK7set/G+q6TcpROpSRbgSLK9G21uxfDpCwYNo/cCk6s7EnEbDYboG8oeL2OiRAbqlYLNo0O+Us8vQ== X-Received: by 2002:a17:902:d501:b0:196:704e:2c9a with SMTP id b1-20020a170902d50100b00196704e2c9amr425859plg.22.1676414875093; Tue, 14 Feb 2023 14:47:55 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:54 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH v6 06/22] acl: replace LOGTYPE_ACL with dynamic type Date: Tue, 14 Feb 2023 14:47:19 -0800 Message-Id: <20230214224735.1404326-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Tue Feb 14 22:47:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123915 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 2466441C99; Tue, 14 Feb 2023 23:48:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9813143000; Tue, 14 Feb 2023 23:48:04 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id 3B6F542FD8 for ; Tue, 14 Feb 2023 23:47:57 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id o13so16520036pjg.2 for ; Tue, 14 Feb 2023 14:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zJPaFh6URUfG4TrDmw5LEES1Qn5paWZCJx32V5GolN4=; b=GDrXUfv4jR/+mo1939RQtZyeLRwy/xBQzc0ST/FM8HhslwsX6sPpmb9EfF2tWJoS0A eNLxj0kAPEyideqSplj9eCA6mzmu6dtvyEpRth0FHxukbS7+lIMeqbv77siFlTHMaRqp vUfNuMzb8XPLRwj+/l8gEiowsjyEkcDxX0dW3jbi6fBDpePWRuj6C7yW896FFiLIcsPS WqnWC1nNPS8m1NR/o/eOGoEeueKLp8Wb5GP8I7PFlYAFiYuDqnUmc8aBTbt6vhRhZacl QpXdQQO4+Zi/I5UASAVNbTrzTE815Pr3JllOrsxcLCS97ApfbhJ5qEbFHxpHxk5agRQu xc0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zJPaFh6URUfG4TrDmw5LEES1Qn5paWZCJx32V5GolN4=; b=XHjat4x+StCUoFFMKR1OOek/iV5Kd6KX1o8hxYMaRE38ws8R8V4OvrW7iDUL0FRl57 wTaAAK9yAs2S3Qh2zqsvEg6j+gUEFSwCFiho89PTSXIIebvHKgKEDmu7cp5kw2dHpHTC mgDhCSRRA1cz6VsrtTVQOYYPcwEaKTS2WsPdFcQ9eOGyIta85l0xIghzWvEkyNiAiJve wkaA1m2Nrb7QknEHjXfJ80QQMOgJgTQ4vp8ZFL5eo4ti11nH13gRmqlpglPrLnkVobF2 HLXQLRJjt3thiAyJB5eKzRqOmKM+Lf9xtJuJDny9FGbvvTbQSYxrqHhru5VsUTMm6kTD HCIQ== X-Gm-Message-State: AO0yUKUEfsPiIOZQRKT066Te74e9XkpCRoCNg2DwPxu+Tul8uGuC0Nct 9Y6YewMXX9Nc+0FTl9KVDpeAQzcZBTjFRg+dlrs= X-Google-Smtp-Source: AK7set/qZxTtQ3iU7e3l88db4i9qAu9jAm44L0+9PlLyMi7+ivKMn/TmOwxl79vn07O7xzp6lrU+FA== X-Received: by 2002:a17:903:41c6:b0:19a:b9a8:3fbe with SMTP id u6-20020a17090341c600b0019ab9a83fbemr295925ple.48.1676414876096; Tue, 14 Feb 2023 14:47:56 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:55 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v6 07/22] examples/power: replace use of RTE_LOGTYPE_POWER Date: Tue, 14 Feb 2023 14:47:20 -0800 Message-Id: <20230214224735.1404326-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 static logtype in sample application. Signed-off-by: Stephen Hemminger --- examples/distributor/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 21304d661873..542f76cf9664 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -679,7 +679,7 @@ init_power_library(void) /* init power management library */ ret = rte_power_init(lcore_id); if (ret) { - RTE_LOG(ERR, POWER, + fprintf(stderr, "Library initialization failed on core %u\n", lcore_id); /* From patchwork Tue Feb 14 22:47:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123916 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 33C4641C99; Tue, 14 Feb 2023 23:48:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4FDA4300A; Tue, 14 Feb 2023 23:48:05 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 273F842FE0 for ; Tue, 14 Feb 2023 23:47:58 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id w20-20020a17090a8a1400b00233d7314c1cso238462pjn.5 for ; Tue, 14 Feb 2023 14:47:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oO3iVDr4h2M/eS/tybJFSy52r4go6bpNG8ZqgGJ1RVo=; b=x/e9j6vf4zOuWO3UCnjQIVzP93fMAyL6ZbmijjWncESMRJZlUvml8qHc0KqvGLluZc kj1yXjFQR2kgBjpYzn4HChbN65VPXfN+FDipmImBk7uCjxmjAzGC0dVei7KcEauBdcZI WrUFMWFKFf9ezERvqLlvN3w0wxbsZDMjWJRZYnku4T7JVFIAuj8jgBE4VmFrYC4JyzoY /eB0eYouV3fKBAYvxtMEVMTTTVgTihoQJiu+F6y0VIynlbrvUnbGkT8mhz07KDyFDA7V JNXx04yqs4cQT2wCLkkjnKULrBhyvd/LZE7jcJfbXQ4gYk4kl0EfUDVYev0ZsELqKf+q dc9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oO3iVDr4h2M/eS/tybJFSy52r4go6bpNG8ZqgGJ1RVo=; b=Ha2MsTezhD6p3jrdg1B58ahDsRQzHGyjQIp4x/gsOkS7Por9HdS6ZeAdeFCb3HP5Wk 0dSDgYroHwoLCZLKCna1MYw6m2h31Gshs96bQ2W9RLiGDfF0ckcwB92g5acLn+r1fqlp dZJ/o6VCWyv9uKKopzjAxAZTOTXDM2U7zOMste5ocBWfieYIuLjsjw5wl7NTy353oX8z KNxKirS+YcmpV/cfpjUTQjPcE4NMEjepvt0q4Z5FWRZ0MPBBWTXI1359WOn+WqTTDP8R ZVOoztkOuZaah09SByWWkHTzWIHNueKGn5eVGU2DU0yJHCJQBhtLdmYgt/ky1ES/34y8 O76w== X-Gm-Message-State: AO0yUKXfI7AZCs0/YwqfGElE/Zv8bEcN27kADVNnSFDcydoqzzRT3F3Z VsxIGjEmNcwKs9REt/HC1q8yGgdmCUBcc2X9i4c= X-Google-Smtp-Source: AK7set9anlrPlgbC4ffU8TT/VhF58RAUcztkniRkV8HabQebkfKh/PuJ9vutK+On6mkt/SVpJsRFIw== X-Received: by 2002:a17:902:d4cc:b0:199:16c6:8a24 with SMTP id o12-20020a170902d4cc00b0019916c68a24mr232879plg.61.1676414877095; Tue, 14 Feb 2023 14:47:57 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:56 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v6 08/22] examples/l3fwd-power: replace use of RTE_LOGTYPE_POWER Date: Tue, 14 Feb 2023 14:47:21 -0800 Message-Id: <20230214224735.1404326-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Convert to using a dynamic logtype for the application. Signed-off-by: Stephen Hemminger --- examples/l3fwd-power/main.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index caf26b373e8d..8e094c1bdda5 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -52,7 +52,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 @@ -2445,7 +2446,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; @@ -2454,7 +2455,7 @@ init_power_library(void) env = rte_power_get_env(); if (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ) { - RTE_LOG(ERR, POWER, + RTE_LOG(ERR, L3FWD_POWER, "Only ACPI and PSTATE mode are supported\n"); return -1; } @@ -2472,7 +2473,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; @@ -2541,7 +2542,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 @@ -2607,7 +2608,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"); if (app_mode == APP_MODE_EMPTY_POLL) empty_poll_setup_timer(); @@ -2626,7 +2627,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 Tue Feb 14 22:47:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123917 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 48E0941C99; Tue, 14 Feb 2023 23:48:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA0C543011; Tue, 14 Feb 2023 23:48:06 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 37B1D42FE0 for ; Tue, 14 Feb 2023 23:47:59 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id h4so10696280pll.9 for ; Tue, 14 Feb 2023 14:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ih9HmuklDDu9CqsJA9hCit/INNrThteUX+RMNcoZ7QE=; b=L8UTsDXqHsqMo/u2kyxoECeI+PYgjMo/x2eDNfYJ9SynXh4H3KXYzDRGs8Da2vNZZE ytxnbzQ+gNSWb9TvmozXEyttrPOqYJ2sOtsBAlIyudfwVvxSlfTkswVfpfh43fAhRO1a nFFWylLIt4a+FkyEb/X+TGq1HiYBgkiHlgBxq+kWavatcWB6DyTno9Gtg6z8Y29J9XxH 3lexgpWRHJdadjxvEKw3iePUfIptjbM5cepzy8vJINFhXji0RVTC44NXTOxZAe0xYj0x u2RbVmeaK/3U3bM8bbR4FVK+eAc8ue+NjNIvQkhjaTbTwqYS2hlPzEdHhOxmMTQRMKFo X1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ih9HmuklDDu9CqsJA9hCit/INNrThteUX+RMNcoZ7QE=; b=ghTIczg0c6whB65c+/b6LtfmjEESKQMzOIYXdzJ9ZrMe+yoOp68nzds03l1DMWHvi/ ndN3RUYtCLs40qU6yArlTtewU8urfX4xFgB/Pc8vHiTUwy6rfQcdZdr7dsrfUdOHzcsK xwta0s9Onk8rjzMUmdm9n7jRA+wMuWtytc2JaFc2ExXBF0ta3R+Ketdz7/pmTqFNAbVK oP7nGJqZG36PC0UjeCHSjptDIkDCKcpMcZ6h8nelog9tp+FDaSXLecBLyWGO+jbtPd0H ug7tQ/cZzsS/ZD+qbxpAmxFGW5hp7cge48p7aXHpTpMoO7vkOkr0fGKHosURFC4dnsAS y20g== X-Gm-Message-State: AO0yUKUETXHDjJqAk3aSdMeSG3SCzOVNye8gZGNvNRn4LYm/qTrR2XWE qjse5K295z0muCdhLE95oANnSshoRDaG7pyU9BQ= X-Google-Smtp-Source: AK7set/CgiQxptEetV59bOmo6/IXRTdVfItp6yzmM8TrZN4Q1/ftPeBuLR0OslGtfek6J8oUfiihuw== X-Received: by 2002:a17:902:fa0e:b0:19a:af11:a0c7 with SMTP id la14-20020a170902fa0e00b0019aaf11a0c7mr307759plb.3.1676414878175; Tue, 14 Feb 2023 14:47:58 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:57 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v6 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Date: Tue, 14 Feb 2023 14:47:22 -0800 Message-Id: <20230214224735.1404326-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use dynamic log type for power library. Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + lib/power/rte_power_empty_poll.c | 1 + 8 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 9e853addb717..39e1e6680dea 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 1408722b2c2f..7d4345acceca 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -36,7 +36,7 @@ extern "C" { #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ + /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index 969a9e5aaa06..efc326d520ca 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -17,7 +17,8 @@ #include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX(guest_channel_logtype, guest, INFO); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype /* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10 diff --git a/lib/power/power_common.c b/lib/power/power_common.c index 1e09facb863f..bf77eafa886b 100644 --- a/lib/power/power_common.c +++ b/lib/power/power_common.c @@ -12,6 +12,8 @@ #include "power_common.h" +RTE_LOG_REGISTER_DEFAULT(power_logtype, INFO); + #define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver" #define POWER_SYSFILE_GOVERNOR \ diff --git a/lib/power/power_common.h b/lib/power/power_common.h index c1c713927621..63a3a443509e 100644 --- a/lib/power/power_common.h +++ b/lib/power/power_common.h @@ -5,11 +5,12 @@ #ifndef _POWER_COMMON_H_ #define _POWER_COMMON_H_ - #include #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype #ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \ diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c index 6a8109d44959..db031f43105a 100644 --- a/lib/power/power_kvm_vm.c +++ b/lib/power/power_kvm_vm.c @@ -8,6 +8,7 @@ #include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c index 63a43bd8f5ae..db0e7705a9ef 100644 --- a/lib/power/rte_power.c +++ b/lib/power/rte_power.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h" diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c index 4a4db512474e..64e3b4b46d5e 100644 --- a/lib/power/rte_power_empty_poll.c +++ b/lib/power/rte_power_empty_poll.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "rte_power_empty_poll.h" +#include "power_common.h" #define INTERVALS_PER_SECOND 100 /* (10ms) */ #define SECONDS_TO_TRAIN_FOR 2 From patchwork Tue Feb 14 22:47:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123918 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 92B1B41C99; Tue, 14 Feb 2023 23:48:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E6AA643014; Tue, 14 Feb 2023 23:48:07 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 4D68D42FE6 for ; Tue, 14 Feb 2023 23:48:00 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id mg23so9943364pjb.0 for ; Tue, 14 Feb 2023 14:48:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W35+k0/nxGmPH0dP92jKXi26qn3G0Y4hBcnCM7qeAAg=; b=dhodrMlT9uk/QV+mAFoAtPRPrTGFX4zkM2tGOiThE47pFrhokxjK25pkqyjHzGBM1r BegNu2YZAFK4CRIdKcEZtpOjlmUM4uZNFk52SRA3ldae6nP5WV7EKkEML+rV4nThtNB3 SyV8gXFjVt2vw9wC9X/TdBtxIbRbz01dl5yYa+aAIo2iGE/2vHyp/z4+7ql4tFIeNmue x/WIu6VWg9vKQv1/mj2PPwn7GqDxwjVK3CFV+uq88G/I8itTE2d6kWX1T11xQF5ViCN2 IjjbUpsC3BJilc3qRcVgx7wzEsdsMSvjzwI5t61AAZMxyWzKkIXY6YQfQjwNss7e5KFI HtZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W35+k0/nxGmPH0dP92jKXi26qn3G0Y4hBcnCM7qeAAg=; b=NZKqUZlixr/0ATcOTTo8qoZEHzhS3T3qfTId6FaRpab++1lFieoPpreO1C48XbaWgB HOy4kHWO9dqHjApEYBaCjasK/NWfuBJ0z9vXXl2tbscPIxUReFpzxv1ltsbCuSU94Fgj LIY9iUPDilMhbuo8/JP1YNxEZRvcK6kM6GKaTyTqHCQc+2NGfmX/wy8HpjKnC48xR7nL zy/3OaAO1SlUPWsFViV4P3PCVDWs4VpbRdOI/Smq+u/HhKIdffPlSH3OsyfH0P9McSOD P/3YL0ECia8DbJaWJOArNtzlZIL92r/r7AE9jQP7YKnm57m4wtKWfwmNpntLNVRLOejS t6Sg== X-Gm-Message-State: AO0yUKUp8Wt4OMofhJZ+Bm13T8R4Uqb6Kk1JbNqS1OPprirhfCT3jP8k bkdYXqUHA/aDg7WorUbY8MSKlUeYjxnwy7ZrW4M= X-Google-Smtp-Source: AK7set9tWKTi21BevxfuS2a77D2D3owKuZL86Sp0KDfHp0az+uy9gWSaw3X77AYpBq7ZXy1FwQyv5g== X-Received: by 2002:a17:903:41c9:b0:19a:a9dd:ed34 with SMTP id u9-20020a17090341c900b0019aa9dded34mr171778ple.59.1676414879299; Tue, 14 Feb 2023 14:47:59 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Honnappa Nagarahalli , Konstantin Ananyev Subject: [PATCH v6 10/22] ring: replace RTE_LOGTYPE_RING with dynamic type Date: Tue, 14 Feb 2023 14:47:23 -0800 Message-Id: <20230214224735.1404326-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The logtype for ring only used in library. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/ring/rte_ring.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 39e1e6680dea..5f15e312f15b 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -349,7 +349,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, - {RTE_LOGTYPE_RING, "lib.ring"}, {RTE_LOGTYPE_MEMPOOL, "lib.mempool"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7d4345acceca..31a2ee2f6b6f 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -28,7 +28,7 @@ extern "C" { /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ /* was RTE_LOGTYPE_MALLOC */ -#define RTE_LOGTYPE_RING 2 /**< Log related to ring. */ + /* was RTE_LOGTYPE_RING */ #define RTE_LOGTYPE_MEMPOOL 3 /**< Log related to mempool. */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c index cddaf6b2876f..8c5f2575d6ef 100644 --- a/lib/ring/rte_ring.c +++ b/lib/ring/rte_ring.c @@ -26,6 +26,9 @@ #include "rte_ring.h" #include "rte_ring_elem.h" +RTE_LOG_REGISTER_DEFAULT(ring_logtype, INFO); +#define RTE_LOGTYPE_RING ring_logtype + TAILQ_HEAD(rte_ring_list, rte_tailq_entry); static struct rte_tailq_elem rte_ring_tailq = { From patchwork Tue Feb 14 22:47:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123919 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 2268F41C99; Tue, 14 Feb 2023 23:49:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0C7DF43019; Tue, 14 Feb 2023 23:48:09 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 28EB842FFC for ; Tue, 14 Feb 2023 23:48:01 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id mg23so9943400pjb.0 for ; Tue, 14 Feb 2023 14:48:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0i/gH84bdYkufpcWRlv8xuzd83PdQwvUvYcNDHhlb0Q=; b=YaHpmn8gUXMa+v6wJ3XrQzCBzRpYUne3caEmzmvBJd5qSGGIY5AfYA9wYpRcojh7Oj wC3841tWa5/K1jKA13J/N8mP4xQ4pYsvFuc/MdifkDmzZEivoAEmY7wZz4Xjk4omLof7 Ygl7zGkTl9scqA2E1n/GwwLCvFaoMYMa1QGn6kackJ+dN71w0vZQe9Fl+Erd8T3VkNT1 R2ODspSUl4CDPvphANIuBADHJZ7uMalRcVDIYuvssXM6sOzBsI3lqoklC59ddzp33H0s zIxYA89zdaLFS9QpG/7xLE5L2qGqPBugPifLyp1TBGMhRYWp2Cdd90cE6MwSzxh5KXIS 3A1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0i/gH84bdYkufpcWRlv8xuzd83PdQwvUvYcNDHhlb0Q=; b=VwJCFW3Qv7/r+yHA+2H043gv3nKmjPG17HiEItnjgpWcpoGIwaRNkwxCTp/1ZOKXLs a7JEo1SZyvMb7oyaQg5t0sTNJAzymLBxbOTj5Lpz4d+JBGbuL0wAW8TCTeukZR1lHz5d egE+Fwq6f3wHk3CKgVvJ2nldxHSfBQAK2ncTE8F8ps+7bt++dq5VKXMvWMbgqCzGVJWN +XT+qPTbSw0wIQGvAR3WTmP8KZ9HgL0RkyBGdHMfL4V6WX9B24zITlxcbo1LSpo2apFU EqncJ6VHl+Ro/9kpoM0ZQCyXJQoBL/vNew3nW3PE/7351PJPiUOYCOmqa3att50PcRQO w+DQ== X-Gm-Message-State: AO0yUKUkkgC+PX09kEnwu81r6UQpYsXs52Iahzll8xch8kHuQxbF5bnY OiP7KHIbgTIaSVYOMzgFT0J5mvrMo6hYmb2xh4Q= X-Google-Smtp-Source: AK7set+tRxx/Ry5Gj4B8X2DsdggDBzsXymLUQYUxTU5c55q55PoqU2idp6CRUbNX6T6KIMTyG75CoA== X-Received: by 2002:a17:903:284:b0:19a:9859:be26 with SMTP id j4-20020a170903028400b0019a9859be26mr955889plr.22.1676414880381; Tue, 14 Feb 2023 14:48:00 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.47.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:47:59 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Olivier Matz , Andrew Rybchenko Subject: [PATCH v6 11/22] mempool: replace RTE_LOGTYPE_MEMPOOL with dynamic type Date: Tue, 14 Feb 2023 14:47:24 -0800 Message-Id: <20230214224735.1404326-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 | 3 +++ lib/mempool/rte_mempool_log.h | 4 ++++ lib/mempool/rte_mempool_ops.c | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 lib/mempool/rte_mempool_log.h 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 45b5df6199b0..841abe53e3b9 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -30,6 +30,9 @@ #include "rte_mempool.h" #include "rte_mempool_trace.h" +#include "rte_mempool_log.h" + +RTE_LOG_REGISTER_DEFAULT(mempool_logtype, INFO); TAILQ_HEAD(rte_mempool_list, rte_tailq_entry); diff --git a/lib/mempool/rte_mempool_log.h b/lib/mempool/rte_mempool_log.h new file mode 100644 index 000000000000..216401c9f2cd --- /dev/null +++ b/lib/mempool/rte_mempool_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int mempool_logtype; +#define RTE_LOGTYPE_MEMPOOL mempool_logtype diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c index 3b43edc548a0..ad7c81823ce1 100644 --- a/lib/mempool/rte_mempool_ops.c +++ b/lib/mempool/rte_mempool_ops.c @@ -12,6 +12,7 @@ #include #include "rte_mempool_trace.h" +#include "rte_mempool_log.h" /* indirect jump table to support external memory pools. */ struct rte_mempool_ops_table rte_mempool_ops_table = { From patchwork Tue Feb 14 22:47:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123920 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 54F4A41C99; Tue, 14 Feb 2023 23:49:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 189314301F; Tue, 14 Feb 2023 23:48:10 +0100 (CET) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 814DC42FE8 for ; Tue, 14 Feb 2023 23:48:02 +0100 (CET) Received: by mail-pl1-f170.google.com with SMTP id e17so9682326plg.12 for ; Tue, 14 Feb 2023 14:48:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Bxb5uefAC8sqO7rt+ILDAJRxu/qHVtoXVH3T56wvEmo=; b=EEFObvx3qtaa/0zkbuHFkoin6gdBiZs6Rck54T0sbezpQreQtKMCMRwD1CFN9J65yW jaOeAgGnl8LgBgk45xEo49Sf7/qS4nIPLJ1iN1T50Hx2iaLzjE4cEtSFfJar/RTPhkgt 4Ii1MH9pMYfg9Baxyzvwq+MDlr1q4QZ7NAI2c1Dv3fw1YaWY2v7RVTVa2F7larwjn6ij +A882BappL4iV1095nvPJazdokCK9thzwr64qr3HwSGsl6/OvS2kGh1W5PX6fmw9FQns GBFOGyplQ/KpxX3bbOlCdzbzIGavjSenkbaaJwRyKjIoSatKeic516lGv9uEjm0EMEVJ o3Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Bxb5uefAC8sqO7rt+ILDAJRxu/qHVtoXVH3T56wvEmo=; b=SN4SfB+hLyunN+4aLoNrKQjCuVxqO8L/hsDHGB9Pd/Z0IueVdswr08EVLBeuo9oa5r UZrUbXXNeOvluHbnjbIuOrwisdNGVNsxt2Rc7a8kPY3q+LModO4Xb4UmfU6BruRCwHre UNkku+TEyUjtalbFm0K3LK8Phn5Ju/jDxBmqmioiyu/BTvxUnKPGr8XQDSE1HYOZm5fe WPjwYMMM1eCs+k4pcwxZQwhaBkSO+Q6FWmPpQK+LmHfkgqh72kuOGY9ASsze8ycYvFwp FTi76vwgIlhUjYqLvNVU2k3SrKOXCg/BIyahLqnRVWPAo28/gHNfGZRQ26JUpEPhSrkR O+OQ== X-Gm-Message-State: AO0yUKUrmrXEH6lV9gxgtOshu0qhayAL2bdMLHdSvasEZxoDS1ozk7Zi YU4jceUoOxuLNna2sXp7UuHpGok7ZoOnyb4Y6+0= X-Google-Smtp-Source: AK7set+lr/vzIrHlI0b0ZmRUsT2mSoQ941bPMTlSLJtJa2drOhkJJ1fZAf/d07hqUeMXIN5/WgVlDA== X-Received: by 2002:a17:903:884:b0:19a:a404:af47 with SMTP id kt4-20020a170903088400b0019aa404af47mr383810plb.4.1676414881493; Tue, 14 Feb 2023 14:48:01 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Vladimir Medvedkin , Bruce Richardson Subject: [PATCH v6 12/22] lpm: replace RTE_LOGTYPE_LPM with dynamic types Date: Tue, 14 Feb 2023 14:47:25 -0800 Message-Id: <20230214224735.1404326-13-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Split lpm and lpm6 into separate log types since they are in different files and user may want to change log levels for IPv4 vs IPv6. For rib and fib libraries give them own types as well. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/fib/fib_log.h | 4 ++++ lib/fib/rte_fib.c | 3 +++ lib/fib/rte_fib6.c | 2 ++ lib/lpm/lpm_log.h | 4 ++++ lib/lpm/rte_lpm.c | 3 +++ lib/lpm/rte_lpm6.c | 1 + lib/rib/rib_log.h | 4 ++++ lib/rib/rte_rib.c | 3 +++ lib/rib/rte_rib6.c | 3 +++ 11 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 lib/fib/fib_log.h create mode 100644 lib/lpm/lpm_log.h create mode 100644 lib/rib/rib_log.h diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 4025d2039d55..6e2007e6ed4f 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 9f86bfdd0198..115a48bf05f5 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -33,7 +33,7 @@ extern "C" { /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ -#define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ + /* was RTE_LOGTYPE_LPM */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ diff --git a/lib/fib/fib_log.h b/lib/fib/fib_log.h new file mode 100644 index 000000000000..c731c820f621 --- /dev/null +++ b/lib/fib/fib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int fib_logtype; +#define RTE_LOGTYPE_LPM fib_logtype diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c index 8af4c4091908..5b1815881415 100644 --- a/lib/fib/rte_fib.c +++ b/lib/fib/rte_fib.c @@ -16,6 +16,9 @@ #include #include "dir24_8.h" +#include "fib_log.h" + +RTE_LOG_REGISTER_DEFAULT(fib_logtype, INFO); TAILQ_HEAD(rte_fib_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib_tailq = { diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c index 4b8e22b142b9..762d195fb798 100644 --- a/lib/fib/rte_fib6.c +++ b/lib/fib/rte_fib6.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -16,6 +17,7 @@ #include #include "trie.h" +#include "fib_log.h" TAILQ_HEAD(rte_fib6_list, rte_tailq_entry); static struct rte_tailq_elem rte_fib6_tailq = { diff --git a/lib/lpm/lpm_log.h b/lib/lpm/lpm_log.h new file mode 100644 index 000000000000..a0621b70a5fe --- /dev/null +++ b/lib/lpm/lpm_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int lpm_logtype; +#define RTE_LOGTYPE_LPM lpm_logtype diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c index cdcd1b7f9e47..0ca82147866a 100644 --- a/lib/lpm/rte_lpm.c +++ b/lib/lpm/rte_lpm.c @@ -18,6 +18,9 @@ #include #include "rte_lpm.h" +#include "lpm_log.h" + +RTE_LOG_REGISTER_DEFAULT(lpm_logtype, INFO); TAILQ_HEAD(rte_lpm_list, rte_tailq_entry); diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c index 8d21aeddb83c..873cc8bc267d 100644 --- a/lib/lpm/rte_lpm6.c +++ b/lib/lpm/rte_lpm6.c @@ -20,6 +20,7 @@ #include #include "rte_lpm6.h" +#include "lpm_log.h" #define RTE_LPM6_TBL24_NUM_ENTRIES (1 << 24) #define RTE_LPM6_TBL8_GROUP_NUM_ENTRIES 256 diff --git a/lib/rib/rib_log.h b/lib/rib/rib_log.h new file mode 100644 index 000000000000..f3ee513ca854 --- /dev/null +++ b/lib/rib/rib_log.h @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ + +extern int rib_logtype; +#define RTE_LOGTYPE_LPM rib_logtype diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c index b0794edf66f5..5597c8b899c8 100644 --- a/lib/rib/rte_rib.c +++ b/lib/rib/rte_rib.c @@ -15,6 +15,9 @@ #include +RTE_LOG_REGISTER_DEFAULT(rib_logtype, INFO); +#define RTE_LOGTYPE_LPM rib_logtype + TAILQ_HEAD(rte_rib_list, rte_tailq_entry); static struct rte_tailq_elem rte_rib_tailq = { .name = "RTE_RIB", diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c index 19e4ff97c479..917bede27d24 100644 --- a/lib/rib/rte_rib6.c +++ b/lib/rib/rte_rib6.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,6 +16,8 @@ #include +#include "rib_log.h" + #define RTE_RIB_VALID_NODE 1 #define RIB6_MAXDEPTH 128 /* Maximum length of a RIB6 name. */ From patchwork Tue Feb 14 22:47:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123921 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 58F0941C99; Tue, 14 Feb 2023 23:49:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2C37F43022; Tue, 14 Feb 2023 23:48:11 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 440C742FFE for ; Tue, 14 Feb 2023 23:48:03 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id d2so16476467pjd.5 for ; Tue, 14 Feb 2023 14:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M8pRnn6UCXMDXQ5HMMtTZAPC9+D5OPOOwBhGsqw2t6A=; b=YisPMRv6Qin1K+phXCnHvrqkUajMjJ3DnP6a01V0gueT3U67qWitTJW3BQ3j3rJb/l wzNvh4qBLUcOubOv0lTGeUZeTrQ0s4vs1qignRmEuKkA1RHMdL694DpEzVxEjzwaXmN4 3mczBeAsc0kOBpMUagPI23PFGZHEYEKwwMav1gxBDzQjLK3RkcZ+sRnmJgoKUIBFy0ua 1aO5UHhq2PS/EXBtAmYnqlI/ADQKOIk+gup5Ew/qnMTSwDa1pCfbWnUsuTkNIgeefnG/ E+XEcug/JXP75+w4ujFN3RnXWqfz7hZFx1LbYZ5Sv+F/WMrD0+0KE0O5VN/yty1IQcbV PSAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M8pRnn6UCXMDXQ5HMMtTZAPC9+D5OPOOwBhGsqw2t6A=; b=l0loWAoNQd8/IV1eY/salioXTABG+hiKyFzn7BI4e1BpPT6sidFT5ay9C13465U4bn HJ+NzeGSrXzeZqpIG5CdSGRYCDalN4y201rFwFJyCOJFNENgSCf22Z2D6fBs0d/9ft7c qhKgwzbfvWJPFoDDgbDDxjhaKaF3lffJm1eoTrqMtrFkypycq9d2fV7TABiKtUAW8RSQ v5RZWWZ8mi7G/Y3FrQIMP/uTzx38DCtX4bVh4TTtQMFOyalSIfa5HspLaEsUtYwaawty O8qLSAWE7JQac+MfaBQSV1L4W0KNeCR6IHAnVjztaTaE777hFoMdyvt9pyNLyY+IN6wi tAVw== X-Gm-Message-State: AO0yUKXLIUcMakCF7/sPyFf30ooNOfA4RqWtN7NIqngFtlURpUFrFkjZ SDjvj4WdPbwN3ubgw3uPsaF6pWGtHpsC86X/5N4= X-Google-Smtp-Source: AK7set8SBNUkLnKVxbV+l49Sn2c+p6EUG3HqNaDhmLrCrTV4DtwF/dleycvQ+JeuhWeGW658od4MuA== X-Received: by 2002:a17:902:e40c:b0:19a:787e:87bc with SMTP id m12-20020a170902e40c00b0019a787e87bcmr222671ple.10.1676414882318; Tue, 14 Feb 2023 14:48:02 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v6 13/22] kni: replace RTE_LOGTYPE_KNI with dynamic type Date: Tue, 14 Feb 2023 14:47:26 -0800 Message-Id: <20230214224735.1404326-14-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Even though KNI will eventually disappear, fix the logtype now. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/kni/rte_kni.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 6e2007e6ed4f..70d5bb7b1951 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_KNI, "lib.kni"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 115a48bf05f5..dc2454a0d9de 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -34,7 +34,7 @@ extern "C" { #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ #define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ /* was RTE_LOGTYPE_LPM */ -#define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ + /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ diff --git a/lib/kni/rte_kni.c b/lib/kni/rte_kni.c index 8ab6c4715314..9c37bcabcadd 100644 --- a/lib/kni/rte_kni.c +++ b/lib/kni/rte_kni.c @@ -23,6 +23,9 @@ #include #include "rte_kni_fifo.h" +RTE_LOG_REGISTER_DEFAULT(kni_logtype, INFO); +#define RTE_LOGTYPE_KNI kni_logtype + #define MAX_MBUF_BURST_NUM 32 /* Maximum number of ring entries */ From patchwork Tue Feb 14 22:47:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 123922 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 150DB41C99; Tue, 14 Feb 2023 23:49:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 140A543032; Tue, 14 Feb 2023 23:48:15 +0100 (CET) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id 3F74B42FE8 for ; Tue, 14 Feb 2023 23:48:04 +0100 (CET) Received: by mail-pj1-f47.google.com with SMTP id fu4-20020a17090ad18400b002341fadc370so270582pjb.1 for ; Tue, 14 Feb 2023 14:48:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EBXd7hlidEUeOKZgcvWvewq4rKwneIJHCAR/EMsgr2w=; b=nQFg+/+mF/C85nHAKO2QvJ6z9rZhir/dmmMR/EacFZXU4YDp7hPllw0mN2LMSyk+No aIyVRd84gkEMm0CZ3WFI0bbtW4WGqcFQ1ZHvdJJj2poy3SQNqRYwPUHzx0bth8oiPoZp SnIJ5wY4E9st4/JdT1ctqTfStN6R0HxwC3OX+ndnNEhnOzsqTUxKcXyJc4NQa7OeE/ZH jU3LIVlzdDricg62a0H71y5ngCyX/s5qBk48OpTEK6NPAuFwjfFxHZuBwzBszM/exJTU OSHwt5gGkpFpT3yYOGcRRuZ1c/DV4WMPZnOOEVGrhapqie8tsbwTaw7jaQUrgeVctchs MGXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EBXd7hlidEUeOKZgcvWvewq4rKwneIJHCAR/EMsgr2w=; b=Jpw/OZpliZrxO4wxBkJjqlKsiLFzQ872vu/V8vwTXX8Qs2vsXaVjVWuIdnOx7TXjsm xowS2pBLOByqCCFREUMJOdPgRcGC9JQpXrGfPejEVvB8UCkLTMBPLU1BzklkhJWGuhvu paLfcivZnqPIoDB4og8nFA93s+sf7R4gypJAR8DXcOcHNcNagGgO5QvNms8lVOFV1ctF gQxYMRez6+DWj/CeGSSeilUKyGXZgQgi+6F8mIPnnT4nhjlnKwcNjXUIJUfgd2+/uix3 /LY+for2wLvKMmRzqBYGkk1S2HuhZxPT8hNssMm+FLQEhJNjvfCN6y+ObeuzeF+BbB+K g7cg== X-Gm-Message-State: AO0yUKWqd29zlLwTbIDsXSpjr9RK9QjB8yPIjct8628wh6HIIpTSf9vR 3A4PviHXbafWkyLcW4NLXAh4cZA100AcCtts16A= X-Google-Smtp-Source: AK7set88g0DnebhL9XxDsWKgB7yaN8k6a9gdB8OgokBYezKeL1IG1xAeZBKd8BM69pkcDAvyyqNkHQ== X-Received: by 2002:a17:902:fb46:b0:19a:96f0:b13 with SMTP id lf6-20020a170902fb4600b0019a96f00b13mr232848plb.31.1676414883233; Tue, 14 Feb 2023 14:48:03 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:02 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v6 14/22] sched: replace RTE_LOGTYPE_SCHED with dynamic type Date: Tue, 14 Feb 2023 14:47:27 -0800 Message-Id: <20230214224735.1404326-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 c91697131d3e..c2bd8c785fcd 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 Tue Feb 14 22:47: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: 123923 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 348FA41C99; Tue, 14 Feb 2023 23:49:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24E0143021; Tue, 14 Feb 2023 23:48:16 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 39A2243004 for ; Tue, 14 Feb 2023 23:48:05 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id d8-20020a17090ad98800b002344fa17c8bso216167pjv.5 for ; Tue, 14 Feb 2023 14:48:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kFRl8j+YQC8GSnvt8uJaAlHH4NW76fDU6O3JskDGXTA=; b=Uhjz+bWMoYEICGoJSsxrH6uGIZNCc3BPtixSkXHyKPFfXqWlhrYcvD6mM90XgkzjDL +TX2zluUjJ/34N1fAlddDEoZw2/mTr8iKdJsIY8CxjjS3+wD7ogpmp/xWokM9u5xD+Fi fS2Q4KPRLQ5W2H+GEc2vbtu51Xv/a5/CCuvM5DqJm7nnJuo5rt+9yoljVjGIUwkdY98J Q0Xlhfs8M7CKghfwdkBH4x4np/LGWX3qW9qq1fHkuvEvu1USkUnQrvZpLAvhctjdDkvp EaXShON0Y+Ym/vFwkOpWdp6tSq/GBdbyiRWMRvyRo1PXB4ne+UufwWkLE7JCkgRHHXv5 zCpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kFRl8j+YQC8GSnvt8uJaAlHH4NW76fDU6O3JskDGXTA=; b=1hwpJSRG3Ep7y6u9RJskYj24UiRRUs7fitTdvYQpc8ee9FluYESxayavK9BsDZCTwO TrcDP93/m4hRwEP7KXgm7dinHupJpdp5jLYH9Ziu4ocWaIageqyGRKTMPOdZMshVuZ02 2/86RcZ01WkKBxwKcahRP1sfJ0VmcFnz+hqr0X7uR6YdLb18HirijmWNpT3YCq6lTE0H sP2lEYtQe+NlarYowmQGEb+5wpEunKgoJktv09e4eggAmsIjZbJAmW8aratsRlVlV7f1 Ki9HvcCeOegK+Q+9FidsxVp+gl2nZz3JrCVafnu0NQaHpeu/cKL+eOeiVt8ClXq4GXrR GAaQ== X-Gm-Message-State: AO0yUKVp/gC/rFDPDEWFVRWtXp0G4bvGBV5EiApplzCtNtVm+5ykZdAY gH+bUcOykpQEOEP7bjsco4gxPEz5oauQKrKNGX4= X-Google-Smtp-Source: AK7set9NndU/y+7+ND3UEOFlpcbxHRvhAohFw+N9BzBZZkVy2XAPaJbwJuetvGVexI+nrfv8ovTZCw== X-Received: by 2002:a17:903:7c6:b0:19a:9605:b95f with SMTP id ko6-20020a17090307c600b0019a9605b95fmr153044plb.61.1676414884192; Tue, 14 Feb 2023 14:48:04 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , akhil.goyal@nxp.com, Radu Nicolau , Akhil Goyal , Declan Doherty , Aviad Yehezkel , Boris Pismenny Subject: [PATCH v6 15/22] examples/ipsecgw: replace RTE_LOGTYPE_PORT Date: Tue, 14 Feb 2023 14:47:28 -0800 Message-Id: <20230214224735.1404326-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Looks like some code got copy/paste in to the IPSEC gateway example from another place. Shouldn't be using RTE_LOGTYPE_PORT here. Fixes: ec17993a145a ("examples/ipsec-secgw: support security offload") Cc: akhil.goyal@nxp.com Signed-off-by: Stephen Hemminger --- examples/ipsec-secgw/sa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 7da9444a7b8a..67327fda8dbc 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -1127,7 +1127,7 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) if (inbound) { if ((dev_info.rx_offload_capa & RTE_ETH_RX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware RX IPSec offload is not supported\n"); return -EINVAL; } @@ -1135,13 +1135,13 @@ check_eth_dev_caps(uint16_t portid, uint32_t inbound, uint32_t tso) } else { /* outbound */ if ((dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_SECURITY) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TX IPSec offload is not supported\n"); return -EINVAL; } if (tso && (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_TCP_TSO) == 0) { - RTE_LOG(WARNING, PORT, + RTE_LOG(WARNING, IPSEC, "hardware TCP TSO offload is not supported\n"); return -EINVAL; } From patchwork Tue Feb 14 22:47: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: 123924 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 04B7041C99; Tue, 14 Feb 2023 23:49:39 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3322543037; Tue, 14 Feb 2023 23:48:17 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 433004300E for ; Tue, 14 Feb 2023 23:48:06 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id f16-20020a17090a9b1000b0023058bbd7b2so254278pjp.0 for ; Tue, 14 Feb 2023 14:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XyBK7Y4Qa7SsWybX079Rpa71uKduJ/PSYw3ilBvphh0=; b=fsA84Za9WYvMumsUkRvi0L89HS+gGQInLbPvqscCQry7tcygaTVV7ukQTxwHdF2n+/ Adr1MZsp/WpufwPwd7iNi9w7nuO6O8TitV+R9IcXKFdsFOSQ+SOu1JJ/bne35f+axKOS u08clc62y4OpVA62x3hj2Nx+OAuU7s+rhcXEU1abLappbsxMwR9aculKCF73k9cu995F tyu+jQ+CbKAmBtbtLKsPuigPogFB7Snn9+KiiB7L2vskONz1X/scPTHS6wWI/i30nODp GaK6NveSMFEjHuW6s7OmFEYHDJLVdsbIsE6puXN98Ei/SxFnv4lNF1RMfW6si2ThYRCy wTXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XyBK7Y4Qa7SsWybX079Rpa71uKduJ/PSYw3ilBvphh0=; b=j3rbetaQJgsS/pfxT5AldePuyAtk5ytBRTqioGnDs9ZUDs4aqggOxWE/SN5GqPU6Bq fUbWiSq0XGOHUMe17fyrFu0RkuWmHlLVZl9tTymYG+Rs5Oz2t9Hz1dmgZ7Y9SQn5XBZ7 KS1963nUfRozw7jpHvORNoVQjnPNOli3lLSzMG2bT08dAHayBfjsbR60ST+VVUUiEezK zBs7de1wrwBok30lNpCtQtmvab/t1XTFRvOLHs0/QrXOXcg397+DdRFaZbA3JOr7MSvS kQSW497ZJI+g8uow54b40ZPcIE1Sc3S0L4ixGjsUwuMHQ39tYIZDhWyCWXbMGKP+zO2I aUKQ== X-Gm-Message-State: AO0yUKUtWp/NldtWinm4xBdDO4dRFQOjwCo3lp/vUd9IkYO78UBXk9qR 7F85piFD49D9UyHugtzxEeS7IKGCp/ZB23250pg= X-Google-Smtp-Source: AK7set+M3J9h5ShbBcvL5Bo9lNRx6OamFK4GTVKyQnpnLlToySYM3HQhayyvEpk8qfUXTFqINr+i5g== X-Received: by 2002:a17:903:283:b0:19a:80c9:2cdf with SMTP id j3-20020a170903028300b0019a80c92cdfmr266185plr.49.1676414885173; Tue, 14 Feb 2023 14:48:05 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:04 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v6 16/22] port: replace RTE_LOGTYPE_PORT with dynamic type Date: Tue, 14 Feb 2023 14:47:29 -0800 Message-Id: <20230214224735.1404326-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Tue Feb 14 22:47: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: 123925 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 8029D41C99; Tue, 14 Feb 2023 23:49:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 456B543008; Tue, 14 Feb 2023 23:48:18 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 0572943013 for ; Tue, 14 Feb 2023 23:48:07 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id z14-20020a17090abd8e00b00233bb9d6bdcso220190pjr.4 for ; Tue, 14 Feb 2023 14:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oVUrp0GCMkTK1yUJ+jrtCRyLKPkzZ/+SmyGcwBFg3qM=; b=nTDFgTHwRHpsw3e12DxcrmGFKDmMV5Zat9oFlTzZS6Fm/80IhovU7QQOg7NuD0fMPX I02dkCamc8MgIcdeTPOdyeqow1kBPz/IJajDGuZo3hGnl3RPSW1T7XCcpCoHRQ6dkYnL Nbf/oJf94Pz0A0f5ER+NLBPk+xiD4RGjkpt+m3IJ1PCkCuO+MRvd+FwQ6Bdy6qlBwzy1 8gKHWxI4Es/1igTAMES+eajFcxtNF14ee4+F1t+Vr4wxshNUwCT2LTP/ia/zDd+OFH0j pcIqRL7T0n2V/Ki39wDqQhtUXCAYsYb3TJgIhNi61xSyQXjuTjEm55Qeo8I2r4jFFV8n 6x8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oVUrp0GCMkTK1yUJ+jrtCRyLKPkzZ/+SmyGcwBFg3qM=; b=ZsyJ2tgBrvTW+BoFCi0AnWpT7l5bM24PHfylNj58JHIy6xksP/8Q4niOsYSFo553ba GKgLeHaMCFC/1Beav1C92Kdr1/DQN4N9rX+t4f34S8rmPKdBLxaaYwKgUk5W83je7q8d YTJ7Z5MEqEIKRVGfLWoG02QdUPRHcukHntzluPrMROWhoXr/Bv3+JGRMCy2gUkprS6rF QpWdVifj444Tk0zg4Wd0jcrahfc9ubZWqvJBF4xafMBMSua0p4g+NxNQ/qn8FfoeRL0b c4ZuRtmSTwlm7C+A+I9WPEOh6im+6i8IEBiTNVvGSGnOzVHTIf6ANNrtsBrq75obo0hL 7g2A== X-Gm-Message-State: AO0yUKXdDWb+pXOXd1WzaFOC1ashw9Y+isbmxRhjrrTMyGd4tXgMGhuv 2SDT6cTNO90nmBABwpLvQTz1R2q1GffWcJJ4mxY= X-Google-Smtp-Source: AK7set/ndv91rmr7mYba/JIASoxlsYVTnUENWqWFmV7iUusH4h26X0K+QWLqrkgOqAkt/ZAnorBSew== X-Received: by 2002:a17:902:fa0c:b0:199:11c3:cc4f with SMTP id la12-20020a170902fa0c00b0019911c3cc4fmr281583plb.44.1676414886237; Tue, 14 Feb 2023 14:48:06 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:05 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v6 17/22] table: convert RTE_LOGTYPE_TABLE to dynamic logtype Date: Tue, 14 Feb 2023 14:47:30 -0800 Message-Id: <20230214224735.1404326-18-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use logtype suffixes for various components of this library. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/table/rte_table_acl.c | 3 +++ lib/table/rte_table_array.c | 3 +++ lib/table/rte_table_hash_cuckoo.c | 3 +++ lib/table/rte_table_hash_ext.c | 3 +++ lib/table/rte_table_hash_key16.c | 3 +++ lib/table/rte_table_hash_key32.c | 5 ++++- lib/table/rte_table_hash_key8.c | 5 ++++- lib/table/rte_table_hash_lru.c | 3 +++ lib/table/rte_table_lpm.c | 3 +++ lib/table/rte_table_lpm_ipv6.c | 3 +++ lib/table/rte_table_stub.c | 3 +++ 13 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 7f1d2c8a256d..d640ed3c88b9 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_TABLE, "lib.table"}, {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index b11aec69af78..934bddff9dfa 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -40,7 +40,7 @@ extern "C" { /* was RTE_LOGTYPE_METER */ /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ -#define RTE_LOGTYPE_TABLE 14 /**< Log related to table. */ + /* was RTE_LOGTYPE_TABLE */ #define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ diff --git a/lib/table/rte_table_acl.c b/lib/table/rte_table_acl.c index 53fd5c66adb5..f44a25a89405 100644 --- a/lib/table/rte_table_acl.c +++ b/lib/table/rte_table_acl.c @@ -11,6 +11,9 @@ #include "rte_table_acl.h" +RTE_LOG_REGISTER_SUFFIX(table_acl_logtype, acl, INFO); +#define RTE_LOGTYPE_TABLE table_acl_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ACL_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_array.c b/lib/table/rte_table_array.c index 54a0c42f7dd2..a7849beaecd6 100644 --- a/lib/table/rte_table_array.c +++ b/lib/table/rte_table_array.c @@ -11,6 +11,9 @@ #include "rte_table_array.h" +RTE_LOG_REGISTER_SUFFIX(table_array_logtype, array, INFO); +#define RTE_LOGTYPE_TABLE table_array_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_ARRAY_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_hash_cuckoo.c b/lib/table/rte_table_hash_cuckoo.c index c77eccf52722..12db0b84142f 100644 --- a/lib/table/rte_table_hash_cuckoo.c +++ b/lib/table/rte_table_hash_cuckoo.c @@ -10,6 +10,9 @@ #include "rte_table_hash_cuckoo.h" +RTE_LOG_REGISTER_SUFFIX(table_hash_logtype, hash, INFO); +#define RTE_LOGTYPE_TABLE table_hash_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_CUCKOO_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_hash_ext.c b/lib/table/rte_table_hash_ext.c index 70ea84fa2e51..147ecdf082cb 100644 --- a/lib/table/rte_table_hash_ext.c +++ b/lib/table/rte_table_hash_ext.c @@ -11,6 +11,9 @@ #include "rte_table_hash.h" +RTE_LOG_REGISTER_SUFFIX(table_hash_ext_logtype, hash.ext, INFO); +#define RTE_LOGTYPE_TABLE table_hash_ext_logtype + #define KEYS_PER_BUCKET 4 struct bucket { diff --git a/lib/table/rte_table_hash_key16.c b/lib/table/rte_table_hash_key16.c index 04d7fd64bd97..09fef5f14ce7 100644 --- a/lib/table/rte_table_hash_key16.c +++ b/lib/table/rte_table_hash_key16.c @@ -11,6 +11,9 @@ #include "rte_table_hash.h" #include "rte_lru.h" +RTE_LOG_REGISTER_SUFFIX(table_hash16_logtype, hash16, INFO); +#define RTE_LOGTYPE_TABLE table_hash16_logtype + #define KEY_SIZE 16 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_key32.c b/lib/table/rte_table_hash_key32.c index 88d8f69c72ed..1abc459eee87 100644 --- a/lib/table/rte_table_hash_key32.c +++ b/lib/table/rte_table_hash_key32.c @@ -11,7 +11,10 @@ #include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 32 +RTE_LOG_REGISTER_SUFFIX(table_hash32_logtype, hash32, INFO); +#define RTE_LOGTYPE_TABLE table_hash32_logtype + +#define KEY_SIZE 32 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_key8.c b/lib/table/rte_table_hash_key8.c index 035d24276946..d4ccccbcdf9e 100644 --- a/lib/table/rte_table_hash_key8.c +++ b/lib/table/rte_table_hash_key8.c @@ -11,7 +11,10 @@ #include "rte_table_hash.h" #include "rte_lru.h" -#define KEY_SIZE 8 +RTE_LOG_REGISTER_SUFFIX(table_hash8_logtype, hash8, INFO); +#define RTE_LOGTYPE_TABLE table_hash8_logtype + +#define KEY_SIZE 8 #define KEYS_PER_BUCKET 4 diff --git a/lib/table/rte_table_hash_lru.c b/lib/table/rte_table_hash_lru.c index c31acc11cf23..d0d2c8ba44df 100644 --- a/lib/table/rte_table_hash_lru.c +++ b/lib/table/rte_table_hash_lru.c @@ -14,6 +14,9 @@ #define KEYS_PER_BUCKET 4 +RTE_LOG_REGISTER_SUFFIX(table_hash_lru_logtype, hash_lru, INFO); +#define RTE_LOGTYPE_TABLE table_hash_lru_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_HASH_LRU_STATS_PKTS_IN_ADD(table, val) \ diff --git a/lib/table/rte_table_lpm.c b/lib/table/rte_table_lpm.c index 9de9e8a20d77..4a5c4a343c77 100644 --- a/lib/table/rte_table_lpm.c +++ b/lib/table/rte_table_lpm.c @@ -13,6 +13,9 @@ #include "rte_table_lpm.h" +RTE_LOG_REGISTER_SUFFIX(table_lpm_logtype, lpm, INFO); +#define RTE_LOGTYPE_TABLE table_lpm_logtype + #ifndef RTE_TABLE_LPM_MAX_NEXT_HOPS #define RTE_TABLE_LPM_MAX_NEXT_HOPS 65536 #endif diff --git a/lib/table/rte_table_lpm_ipv6.c b/lib/table/rte_table_lpm_ipv6.c index 8fde2c012f7c..236eac4238d9 100644 --- a/lib/table/rte_table_lpm_ipv6.c +++ b/lib/table/rte_table_lpm_ipv6.c @@ -12,6 +12,9 @@ #include "rte_table_lpm_ipv6.h" +RTE_LOG_REGISTER_SUFFIX(table_lpm6_logtype, lpm6, INFO); +#define RTE_LOGTYPE_TABLE table_lpm6_logtype + #define RTE_TABLE_LPM_MAX_NEXT_HOPS 256 #ifdef RTE_TABLE_STATS_COLLECT diff --git a/lib/table/rte_table_stub.c b/lib/table/rte_table_stub.c index 23d0de5c79b0..e74044032f7d 100644 --- a/lib/table/rte_table_stub.c +++ b/lib/table/rte_table_stub.c @@ -8,6 +8,9 @@ #include "rte_table_stub.h" +RTE_LOG_REGISTER_SUFFIX(table_stub_logtype, stub, INFO); +#define RTE_LOGTYPE_TABLE table_stub_logtype + #ifdef RTE_TABLE_STATS_COLLECT #define RTE_TABLE_LPM_STATS_PKTS_IN_ADD(table, val) \ From patchwork Tue Feb 14 22:47: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: 123926 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 D0D4741C99; Tue, 14 Feb 2023 23:49:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3745643042; Tue, 14 Feb 2023 23:48:19 +0100 (CET) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 7497C43017 for ; Tue, 14 Feb 2023 23:48:08 +0100 (CET) Received: by mail-pj1-f44.google.com with SMTP id w20-20020a17090a8a1400b00233d7314c1cso238800pjn.5 for ; Tue, 14 Feb 2023 14:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=; b=Y4M5VPxuc8sYPH7uPNfQYt+VTf6rnhVHp+vpb4cN+LEyPtIkMJJjC9A3jS/eQA3fVk dKPXmbSnW50/6mi+ZmdrbUmfAaatusrgnJXnn7ekIURyXWU6maQGw5W53w7cU10apAq3 XfQQWJx1ojkvJcGPN7Idq9iR98bU6E79IiUuRVichxVisrmEfdoG4QRTgjaguRnKIkXw lmBGYwZCnt655WrTiD2XXOjbDW0OI6x6+6U1nMpDzrLxJjKWArfr86tyfx5LRPCI+0kE 0dT9OCEQmi2IghyvxELLkupviTTU+7gB9RzTZ/nphRh5BvsYzEYwR24ZjHWdTHL7iuFA yiAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4mpg7EHU1GKkOQjzVZUElKNmEdc7NTwiOoyGC3ebHU=; b=K2JjEBCQNxvKAINIGHfKQAMe2Q2CP++1C1EwkW6py4kkTYy0VvWh7xpqucJaYWRdfK 0/PGnURnhCEOwEoYn/+T1vSpuRLCbR0YvJWLa4cash/uZSdnwjI5CxrckGRMUpwA36HT Ay+vkeej9Dkz71gAaVMHm5pXQOlVlS01oQ6c4+Boq4SEcDtlm5E/bwC4QqUA2+K0CRj3 vvD1Jtelstd0qZc+T0i/WY2hRuNfTYpRqlmeETEP3uT4Jp/u7YpzbY8VgxnK3DS3EPw8 JKYgdFMb/6b/UjPH3XY+2QCec0sbyK9Ua1+x86pyiAeUrgVfc5tys7l7zkO2L+j6I0vG LNjQ== X-Gm-Message-State: AO0yUKX6/B4h3L4+d/fd3Vf/iixpeit7xQ68bRDr6GPmlEBwp/nemhRL 1DfrRfD154YNY6xPnQLX0AyOJeTYaFMHHQICZHk= X-Google-Smtp-Source: AK7set9cFYlHkWSIqFyVZtMyC6HL7sc0m5B5kDYKg0ukP/nJv+nUikcHhpsdymZNi6+c9amb0rsc7A== X-Received: by 2002:a17:902:f9c5:b0:19a:6acc:1de1 with SMTP id kz5-20020a170902f9c500b0019a6acc1de1mr275009plb.4.1676414887531; Tue, 14 Feb 2023 14:48:07 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:07 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v6 18/22] app/test: remove use of RTE_LOGTYPE_PIPELINE Date: Tue, 14 Feb 2023 14:47:31 -0800 Message-Id: <20230214224735.1404326-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 Tue Feb 14 22:47: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: 123927 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 97C5C41C99; Tue, 14 Feb 2023 23:49:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 349B243046; Tue, 14 Feb 2023 23:48:20 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id D35CE4301C for ; Tue, 14 Feb 2023 23:48:09 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id oa11-20020a17090b1bcb00b002341a2656e5so229671pjb.1 for ; Tue, 14 Feb 2023 14:48:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eECXXGmntrXbA8+7KcILaCKIy+GGF4blhlaA75UYdDk=; b=BGIGLT/7Qohulw/xHW2ta9Wpp08NsOMkPjnZ7qHt7WgEh/faog8Tvw4IJKuAE+qLcB w8Ea/EoOc+/vZCop6jbrvYGzRPiL3UCDFclpg/7ooTiOQ6/SJkl3wQsuAUVg8dfDSZPN Fp2MEK57zubNbEvh5nINrkaEcUQ2pAhriIXxNz5JHfNxGtUYX9DD8uMSMN3neylsLw26 G1uIzGhbOWxkfuDPckhNWSFJAU8jEOGXsRiHZXhS+J/qgTUIR1+iW0DpPZaryLXXULoU E9TB4Rb+RfF/L9dbzeYrKC9+jw4TpHsanUdVDnrV3aFZkdJ017DVLFkVafAMGCi6oBaN qetQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eECXXGmntrXbA8+7KcILaCKIy+GGF4blhlaA75UYdDk=; b=zHNA2vT1j2RhrTeKM8DrRnxZypFbUkk+DB3dhlMzgSA1i2WAevGdoYWFxcuKS8gWak 7hpdytBggm4byky1hmgBIsh/wc5O5UDEBMqwEsMyr0LLlRwslXgN4OnlqNtuKB6hmxw7 P3nwNF0F37hncmmhFc9p0HyHSNZfhUGs2/v6iQ+nKc7Rn8wI8OnoriHTmHeKBWJAKlwA J6MCINUxBeh/BpCSGgt7MdQhJ6YAkzT0+kliyfH1tmSPrR1PQ21CzQdq0xqeeUV2ZkLB k4mmhb7vKPFRKkjPhuZRylBv0qDNbbBfC4s4IVEt47Ke5Rkp7xA2/akCTHCxwpBWyEue W21w== X-Gm-Message-State: AO0yUKX8w0Vs1XtMmZE5f/n4ZKrktNFGgWpFg589lntKgO/Jw2oW0p35 +mcc53X7mCj8YpiC0xCoCVMWbgSL7a2FjanVjLw= X-Google-Smtp-Source: AK7set+JknDW3ryCQObGtAsrMyxbg83MjK5bT/E4/WWcRmRRe5yfLbMXlVHi7lYSL8J6Y+RJuanoKg== X-Received: by 2002:a17:903:2445:b0:198:fca8:2108 with SMTP id l5-20020a170903244500b00198fca82108mr314020pls.44.1676414888896; Tue, 14 Feb 2023 14:48:08 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Cristian Dumitrescu Subject: [PATCH v6 19/22] pipeline: replace RTE_LOGTYPE_PIPELINE with dynamic type Date: Tue, 14 Feb 2023 14:47:32 -0800 Message-Id: <20230214224735.1404326-20-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use a dynamically allocated logtype. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/pipeline/rte_pipeline.c | 3 +++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index d640ed3c88b9..a3498d1a2faf 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -351,7 +351,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, {RTE_LOGTYPE_HASH, "lib.hash"}, - {RTE_LOGTYPE_PIPELINE, "lib.pipeline"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 934bddff9dfa..7473fd53505a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -41,7 +41,7 @@ extern "C" { /* was RTE_LOGTYPE_SCHED */ /* was RTE_LOGTYPE_PORT */ /* was RTE_LOGTYPE_TABLE */ -#define RTE_LOGTYPE_PIPELINE 15 /**< Log related to pipeline. */ + /* was RTE_LOGTYPE_PIPELINE */ /* was RTE_LOGTYPE_MBUF */ #define RTE_LOGTYPE_CRYPTODEV 17 /**< Log related to cryptodev. */ /* was RTE_LOGTYPE_EFD */ diff --git a/lib/pipeline/rte_pipeline.c b/lib/pipeline/rte_pipeline.c index ff86c7cf96bf..30919cd9fe30 100644 --- a/lib/pipeline/rte_pipeline.c +++ b/lib/pipeline/rte_pipeline.c @@ -12,6 +12,9 @@ #include "rte_pipeline.h" +RTE_LOG_REGISTER_DEFAULT(pipeline_logtype, INFO); +#define RTE_LOGTYPE_PIPELINE pipeline_logtype + #define RTE_TABLE_INVALID UINT32_MAX #ifdef RTE_PIPELINE_STATS_COLLECT From patchwork Tue Feb 14 22:47: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: 123928 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 E3AD441C99; Tue, 14 Feb 2023 23:50:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 487BC43040; Tue, 14 Feb 2023 23:48:21 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id B874643021 for ; Tue, 14 Feb 2023 23:48:10 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id mg23so9943698pjb.0 for ; Tue, 14 Feb 2023 14:48:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=AwDNBcm73V1Yqa4Lf6HUkggeOzlxIlyb5wvVX7eFTkOWpslM87Nn7JMWHXYYeA16wI EGzLdQqGlxyjrMDmkXgKcxUVoveBwU8/X5vqfIZf3qyAIzVTfQTG1xVJ6GMgLSjHCaYt +fQfrH3ZHHQdMNreXIHJe2FJr04VxheTM+VcrpCoO88pgEzHOPUIJGdSlJlXMavg65GD FszxRzDQekKy75OKn6oD22WA1UcZOvPn+s0X6v6F+7FLgd51tChwjMpske6onNeT/SMj NdhRlSHM6coOwOJfb63bavjXJ6WUDSxRWOQJ12+iUCoyDPH2wIUaRp3EbVYgouySBKcC aFQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dGm9hn4jY/wq6ATDlBoMznoK+SGsfKps427n+SePoU8=; b=PeBhmRfJuGHcrzGMRT9cdsF742o+fRm3du0NRrn3tKhrsE25hRDT+O3uR/Bf9v4Vo7 fcpZD4AN0+InzpahEae/IVVb2Xt9GBrrWLGEsO0IeAIneeVVFQ6R+AANOPMdw/mThK0a BvUnaSWhLwozomJkCX4iDtggBPcv9XhWtP4Xh4E8Xi4v4sBHlE05ww4Dn2aV1jrLHCTa C7H605R/Wj1EtKHqjbd4vyuBHR9EzYUbAkD1N22Q8BoMpCs3i43d2qF3x50W1HsuLYU8 2Yj2K2cvok69MiXZ7wxZpZRmtJovYoVdJ2OJwjSxf0cNi2uECdbBKaqEs0W5pisnMof8 KtVA== X-Gm-Message-State: AO0yUKWn1vJaHfO84Gb0k6D9Hb3fx8KreDQEUM8VySYPUql28/9+VKM3 qgQdipZ/BNElW1DI3xekxsCxlbMaawE2qCP+pwI= X-Google-Smtp-Source: AK7set9Gvz20UDIK4kagVuYi02gkg95EUsyW1L3GVHTfhV+kXOEWe8XNrwCVFQ4mN9ERRKMss60DxQ== X-Received: by 2002:a05:6a20:158b:b0:bc:59e9:f3d9 with SMTP id h11-20020a056a20158b00b000bc59e9f3d9mr4676535pzj.0.1676414889969; Tue, 14 Feb 2023 14:48:09 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v6 20/22] hash: move rte_thash_gfni stubs out of header file Date: Tue, 14 Feb 2023 14:47:33 -0800 Message-Id: <20230214224735.1404326-21-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Having stubs in header file makes it harder to update RTE_LOG(). Also modify to only print warning once. Signed-off-by: Stephen Hemminger --- lib/hash/meson.build | 8 +++++++- lib/hash/rte_thash_gfni.c | 43 +++++++++++++++++++++++++++++++++++++++ lib/hash/rte_thash_gfni.h | 28 +++++-------------------- lib/hash/version.map | 4 ++++ 4 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 lib/hash/rte_thash_gfni.c diff --git a/lib/hash/meson.build b/lib/hash/meson.build index 2f757d45f9bc..e56ee8572564 100644 --- a/lib/hash/meson.build +++ b/lib/hash/meson.build @@ -17,7 +17,13 @@ indirect_headers += files( 'rte_thash_x86_gfni.h', ) -sources = files('rte_cuckoo_hash.c', 'rte_fbk_hash.c', 'rte_thash.c') +sources = files( + 'rte_cuckoo_hash.c', + 'rte_fbk_hash.c', + 'rte_thash.c', + 'rte_thash_gfni.c' +) + deps += ['net'] deps += ['ring'] deps += ['rcu'] diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c new file mode 100644 index 000000000000..7617b9d4f630 --- /dev/null +++ b/lib/hash/rte_thash_gfni.c @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ + +#include + +#include +#include +#include + +uint32_t +rte_thash_gfni(const uint64_t *mtrx __rte_unused, + const uint8_t *key __rte_unused, int len __rte_unused) +{ + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + return 0; +} + +void +rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, + int len __rte_unused, uint8_t *tuple[] __rte_unused, + uint32_t val[], uint32_t num) +{ + unsigned int i; + + static bool warned; + + if (!warned) { + warned = true; + RTE_LOG(ERR, HASH, + "%s is undefined under given arch\n", __func__); + } + + for (i = 0; i < num; i++) + val[i] = 0; +} diff --git a/lib/hash/rte_thash_gfni.h b/lib/hash/rte_thash_gfni.h index ef90faa302d1..86208eb45ebb 100644 --- a/lib/hash/rte_thash_gfni.h +++ b/lib/hash/rte_thash_gfni.h @@ -9,13 +9,8 @@ extern "C" { #endif -#include -#include - #ifdef RTE_ARCH_X86 - #include - #endif #ifndef RTE_THASH_GFNI_DEFINED @@ -38,13 +33,8 @@ extern "C" { * Calculated Toeplitz hash value. */ __rte_experimental -static inline uint32_t -rte_thash_gfni(const uint64_t *mtrx __rte_unused, - const uint8_t *key __rte_unused, int len __rte_unused) -{ - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - return 0; -} +uint32_t +rte_thash_gfni(const uint64_t *mtrx, const uint8_t *key, int len); /** * Bulk implementation for Toeplitz hash. @@ -67,17 +57,9 @@ rte_thash_gfni(const uint64_t *mtrx __rte_unused, * Number of tuples to hash. */ __rte_experimental -static inline void -rte_thash_gfni_bulk(const uint64_t *mtrx __rte_unused, - int len __rte_unused, uint8_t *tuple[] __rte_unused, - uint32_t val[], uint32_t num) -{ - unsigned int i; - - RTE_LOG(ERR, HASH, "%s is undefined under given arch\n", __func__); - for (i = 0; i < num; i++) - val[i] = 0; -} +void +rte_thash_gfni_bulk(const uint64_t *mtrx, int len, uint8_t *tuple[], + uint32_t val[], uint32_t num); #endif /* RTE_THASH_GFNI_DEFINED */ diff --git a/lib/hash/version.map b/lib/hash/version.map index bdcebd19c29b..f03b047b2eec 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -51,4 +51,8 @@ EXPERIMENTAL { rte_thash_complete_matrix; rte_thash_get_gfni_matrices; rte_thash_gfni_supported; + + # added in 22.07 + rte_thash_gfni; + rte_thash_gfni_bulk; }; From patchwork Tue Feb 14 22:47: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: 123929 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 E3F9041C99; Tue, 14 Feb 2023 23:50:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5649E4304D; Tue, 14 Feb 2023 23:48:22 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id ACA7C43025 for ; Tue, 14 Feb 2023 23:48:11 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id d13-20020a17090ad3cd00b0023127b2d602so225926pjw.2 for ; Tue, 14 Feb 2023 14:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dfb1E0xn1XyQ4s+b+w1zmOSAvjvFm4bNTCC6e3Z0zDw=; b=2befi7DrtOuoz6QDzcYgJ4rMY6dw27ruMtXa43vuVnsK1UBy6ER/Yjpevln2jAza0x jncNjB7wkvy7YPKiXJAAvcC2R2WLusZKDNbwFW46RiAi5oEld4XBDRX8TnOB4VLpL4Eu UGceeOcb3yuRJXtgArLNytFF8qdgzsARFGQvCoKQej2s1QXIZNqwNiM1pOSwOGiyGVBd jYik71WQyDB0wcdVfYctvfhFdtrR+soY58YUAdgzK1oAbxu4CoizPoh05dGzOgHUlnHz MycY3i9wxl/pwECOv6bAGKL4E8LkJsTAEigRck7BLIskXZLRAR2mkwHv74y27T3kdnim l9uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dfb1E0xn1XyQ4s+b+w1zmOSAvjvFm4bNTCC6e3Z0zDw=; b=JyCOr5k7AybcweFuVcqZ9u2znv6YpcJDtdiQAImeiKmtBE9PQ8UOX1R+aP3aSOnWJ9 m5ykyuVAUOjC6ZCD1nBCPrTr8Z5I+WpFXmktudMXwoBikgvH19xLQu7yRnHQwzloc5ol 0RNRZuSD3FlCHjqjf+IsoWBZlb6mW6yroUIuBhOEPQUv8L06pn2D4e62UHSmXnmiwbkH lps5iwF1vtq2+rkUHhmQgr5DcIV2+uOVhUsssbUTl3sW1ucanQWZlOHXWOwQdYpEpTRU UR377wqjClVy8g1MbunnBAkLbnpGGI1+pKwj/d1ZZUXYXn3/6n0GoqdNcerHBQmeFxiN x++g== X-Gm-Message-State: AO0yUKW0wRVpww4a5jK7sDPvgbay7pzxY6NFs8hPQxTXBBVutp7b2bQP XqwR6ZFzXzMSA03rQPDARhTQF2EdEp1/DT8ttDo= X-Google-Smtp-Source: AK7set9qxBxhclHced6NfF7HKc/c8GRkVIrzBFeYU8lGeJUsq7XzAbOUqv8Lu0Ffy1gdLJ3cRaHz2g== X-Received: by 2002:a17:902:ea0a:b0:199:4362:93f2 with SMTP id s10-20020a170902ea0a00b00199436293f2mr290155plg.65.1676414890979; Tue, 14 Feb 2023 14:48:10 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v6 21/22] hash: move rte_hash_set_alg out header Date: Tue, 14 Feb 2023 14:47:34 -0800 Message-Id: <20230214224735.1404326-22-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-1-stephen@networkplumber.org> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The code for setting algorithm for hash is not at all perf sensitive, and doing it inline has a couple of problems. First, it means that if multiple files include the header, then the initialization gets done multiple times. But also, it makes it harder to fix usage of RTE_LOG(). Despite what the checking script say. This is not an ABI change, the previous version inlined the same code; therefore both old and new code will work the same. Signed-off-by: Stephen Hemminger --- lib/hash/meson.build | 1 + lib/hash/rte_hash_crc.c | 63 +++++++++++++++++++++++++++++++++++++++++ lib/hash/rte_hash_crc.h | 46 ++---------------------------- lib/hash/version.map | 1 + 4 files changed, 67 insertions(+), 44 deletions(-) create mode 100644 lib/hash/rte_hash_crc.c diff --git a/lib/hash/meson.build b/lib/hash/meson.build index e56ee8572564..c345c6f561fc 100644 --- a/lib/hash/meson.build +++ b/lib/hash/meson.build @@ -19,6 +19,7 @@ indirect_headers += files( sources = files( 'rte_cuckoo_hash.c', + 'rte_hash_crc.c', 'rte_fbk_hash.c', 'rte_thash.c', 'rte_thash_gfni.c' diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c new file mode 100644 index 000000000000..c59eebccb1eb --- /dev/null +++ b/lib/hash/rte_hash_crc.c @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2014 Intel Corporation + */ + +#include +#include + +#include "rte_hash_crc.h" + +/** + * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash + * calculation. + * + * @param alg + * An OR of following flags: + * - (CRC32_SW) Don't use SSE4.2/ARMv8 intrinsics (default non-[x86/ARMv8]) + * - (CRC32_SSE42) Use SSE4.2 intrinsics if available + * - (CRC32_SSE42_x64) Use 64-bit SSE4.2 intrinsic if available (default x86) + * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8) + * + */ +void +rte_hash_crc_set_alg(uint8_t alg) +{ + crc32_alg = CRC32_SW; + + if (alg == CRC32_SW) + return; + +#if defined RTE_ARCH_X86 + if (!(alg & CRC32_SSE42_x64)) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); + if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) + crc32_alg = CRC32_SSE42; + else + crc32_alg = CRC32_SSE42_x64; +#endif + +#if defined RTE_ARCH_ARM64 + if (!(alg & CRC32_ARM64)) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) + crc32_alg = CRC32_ARM64; +#endif + + if (crc32_alg == CRC32_SW) + RTE_LOG(WARNING, HASH, + "Unsupported CRC32 algorithm requested using CRC32_SW\n"); +} + +/* Setting the best available algorithm */ +RTE_INIT(rte_hash_crc_init_alg) +{ +#if defined(RTE_ARCH_X86) + rte_hash_crc_set_alg(CRC32_SSE42_x64); +#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) + rte_hash_crc_set_alg(CRC32_ARM64); +#else + rte_hash_crc_set_alg(CRC32_SW); +#endif +} diff --git a/lib/hash/rte_hash_crc.h b/lib/hash/rte_hash_crc.h index 0249ad16c5b6..e4acd99a0c81 100644 --- a/lib/hash/rte_hash_crc.h +++ b/lib/hash/rte_hash_crc.h @@ -20,8 +20,6 @@ extern "C" { #include #include #include -#include -#include #include "rte_crc_sw.h" @@ -53,48 +51,8 @@ static uint8_t crc32_alg = CRC32_SW; * - (CRC32_ARM64) Use ARMv8 CRC intrinsic if available (default ARMv8) * */ -static inline void -rte_hash_crc_set_alg(uint8_t alg) -{ - crc32_alg = CRC32_SW; - - if (alg == CRC32_SW) - return; - -#if defined RTE_ARCH_X86 - if (!(alg & CRC32_SSE42_x64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_x64/CRC32_SSE42\n"); - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_EM64T) || alg == CRC32_SSE42) - crc32_alg = CRC32_SSE42; - else - crc32_alg = CRC32_SSE42_x64; -#endif - -#if defined RTE_ARCH_ARM64 - if (!(alg & CRC32_ARM64)) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_ARM64\n"); - if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_CRC32)) - crc32_alg = CRC32_ARM64; -#endif - - if (crc32_alg == CRC32_SW) - RTE_LOG(WARNING, HASH, - "Unsupported CRC32 algorithm requested using CRC32_SW\n"); -} - -/* Setting the best available algorithm */ -RTE_INIT(rte_hash_crc_init_alg) -{ -#if defined(RTE_ARCH_X86) - rte_hash_crc_set_alg(CRC32_SSE42_x64); -#elif defined(RTE_ARCH_ARM64) && defined(__ARM_FEATURE_CRC32) - rte_hash_crc_set_alg(CRC32_ARM64); -#else - rte_hash_crc_set_alg(CRC32_SW); -#endif -} +void +rte_hash_crc_set_alg(uint8_t alg); #ifdef __DOXYGEN__ diff --git a/lib/hash/version.map b/lib/hash/version.map index f03b047b2eec..a1d81835399c 100644 --- a/lib/hash/version.map +++ b/lib/hash/version.map @@ -9,6 +9,7 @@ DPDK_23 { rte_hash_add_key_with_hash; rte_hash_add_key_with_hash_data; rte_hash_count; + rte_hash_crc_set_alg; rte_hash_create; rte_hash_del_key; rte_hash_del_key_with_hash; From patchwork Tue Feb 14 22:47: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: 123930 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 435C141C99; Tue, 14 Feb 2023 23:50:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6C27543050; Tue, 14 Feb 2023 23:48:23 +0100 (CET) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id E5A5642F88 for ; Tue, 14 Feb 2023 23:48:12 +0100 (CET) Received: by mail-pl1-f171.google.com with SMTP id m2so18541425plg.4 for ; Tue, 14 Feb 2023 14:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fv/Zf9MqkBAhObUGSX70onEs/rVmNuW3gBelMtg90IQ=; b=BZ7Nicwt37PtJClSCMsCbzZOft56TdCg4eyI7BXWtl+hozVWpo7cPpN9RK7Q31Ev/W lSzbIRuEUggMlc5gvsJf49fXJmsJ/myYMrWKNOnbcU8HNmy/qZ1sSRa3bkIUexPctTuD d62vU8r2lWjjKlZce+M74gK+oS9OeIis/5LkmdcFyUhzGvUChnQyE/MW8jmW8HhnT9Yy h8mcg4QL0iugWoXl3y8I6PVXbIBXTrzD+ukYmtHyFkdzRxRYDTWUEuI1i8L5ibp3KthV amhDeUkEpgNTdQoLaaw5LBNROlr3qeuU/Up8wXtaD174edVRMs6phLEh+tpp2Yz22GLN OWPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fv/Zf9MqkBAhObUGSX70onEs/rVmNuW3gBelMtg90IQ=; b=tFO5bF9AWvCWZi/OWyRy3zA1SJDOpCo+rbUAHwMAFDHFMf1lhmhgaXMRYOHU/rDpMZ pKvMicIKXq+zfWEWq2btYisvHoRia77sAZHAUlM2+y6S/ma8h0MrJwuGDUm0p1QaBa7D kWArZ3EbZfCdpBAWTl6EW7qXUT+NcdNybFUkWAv7tSKnjhOASAtMCz+hUHYtLSuo6MGQ WzmmnUZ9mLzruRlk5Pp7NL+rDkdMXkud1iBxRVU80pUTZ4UokHRR1/RFxd5PVmkNWE2o la7CE2Y0xs0v/ZcvskiO7B6K+lIeF4NrwQtGUm/dxaJJnQ6dHCNcBSKzuNGInEA1NvYC O8Ow== X-Gm-Message-State: AO0yUKUXccL0mHLJJngfN1K6xGwCiJ0CY8h7BA9JrCFJhWkZvhqj8WJT Nrog65zNRfqz3dxFodTIE3ukKJuFj1hBYgw4xDc= X-Google-Smtp-Source: AK7set+K8XuJg8NZG2tRVotoYD2uqzajn34W6nqzjcmgZB4JWKnffDPN/E336zxONOn+hWznVf6/HA== X-Received: by 2002:a17:902:f683:b0:19a:6e98:b0e2 with SMTP id l3-20020a170902f68300b0019a6e98b0e2mr204729plg.67.1676414891917; Tue, 14 Feb 2023 14:48:11 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id u9-20020a17090341c900b0019607984a5esm10735785ple.95.2023.02.14.14.48.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 14:48:11 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Yipeng Wang , Sameh Gobriel , Bruce Richardson , Vladimir Medvedkin Subject: [PATCH v6 22/22] hash: convert RTE_LOGTYPE_HASH to dynamic type Date: Tue, 14 Feb 2023 14:47:35 -0800 Message-Id: <20230214224735.1404326-23-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214224735.1404326-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230214224735.1404326-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 | 3 +++ lib/hash/rte_hash_crc.c | 3 +++ lib/hash/rte_thash.c | 3 +++ lib/hash/rte_thash_gfni.c | 3 +++ 7 files changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index a3498d1a2faf..704924e822d0 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -350,7 +350,6 @@ struct logtype { static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EAL, "lib.eal"}, {RTE_LOGTYPE_PMD, "pmd"}, - {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_CRYPTODEV, "lib.cryptodev"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_USER1, "user1"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 7473fd53505a..29db07881a5a 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -32,7 +32,7 @@ extern "C" { /* was RTE_LOGTYPE_MEMPOOL */ /* was RTE_LOGTYPE_TIMER */ #define RTE_LOGTYPE_PMD 5 /**< Log related to poll mode driver. */ -#define RTE_LOGTYPE_HASH 6 /**< Log related to hash table. */ + /* was RTE_LOGTYPE_HASH */ /* was RTE_LOGTYPE_LPM */ /* was RTE_LOGTYPE_KNI */ /* was RTE_LOGTYPE_ACL */ diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c index 829b79c89a27..e2b07bfbad71 100644 --- a/lib/hash/rte_cuckoo_hash.c +++ b/lib/hash/rte_cuckoo_hash.c @@ -24,6 +24,11 @@ #include #include "rte_hash.h" + +/* needs to be before rte_cuckoo_hash.h */ +RTE_LOG_REGISTER_DEFAULT(hash_logtype, INFO); +#define RTE_LOGTYPE_HASH hash_logtype + #include "rte_cuckoo_hash.h" /* Mask of all flags supported by this version */ diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c index 538b23a4030a..a5026193070a 100644 --- a/lib/hash/rte_fbk_hash.c +++ b/lib/hash/rte_fbk_hash.c @@ -18,6 +18,9 @@ #include "rte_fbk_hash.h" +RTE_LOG_REGISTER_SUFFIX(fbk_hash_logtype, fbk, INFO); +#define RTE_LOGTYPE_HASH fbk_hash_logtype + TAILQ_HEAD(rte_fbk_hash_list, rte_tailq_entry); static struct rte_tailq_elem rte_fbk_hash_tailq = { diff --git a/lib/hash/rte_hash_crc.c b/lib/hash/rte_hash_crc.c index c59eebccb1eb..7c544a669f8a 100644 --- a/lib/hash/rte_hash_crc.c +++ b/lib/hash/rte_hash_crc.c @@ -7,6 +7,9 @@ #include "rte_hash_crc.h" +RTE_LOG_REGISTER_SUFFIX(hash_crc_logtype, crc, INFO); +#define RTE_LOGTYPE_HASH hash_crc_logtype + /** * Allow or disallow use of SSE4.2/ARMv8 intrinsics for CRC32 hash * calculation. diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c index 0249883b8d07..c1fd2e34c9d4 100644 --- a/lib/hash/rte_thash.c +++ b/lib/hash/rte_thash.c @@ -13,6 +13,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(thash_logtype, thash, INFO); +#define RTE_LOGTYPE_HASH thash_logtype + #define THASH_NAME_LEN 64 #define TOEPLITZ_HASH_LEN 32 diff --git a/lib/hash/rte_thash_gfni.c b/lib/hash/rte_thash_gfni.c index 7617b9d4f630..f17ca222dc32 100644 --- a/lib/hash/rte_thash_gfni.c +++ b/lib/hash/rte_thash_gfni.c @@ -8,6 +8,9 @@ #include #include +RTE_LOG_REGISTER_SUFFIX(hash_gfni_logtype, gfni, INFO); +#define RTE_LOGTYPE_HASH hash_gfni_logtype + uint32_t rte_thash_gfni(const uint64_t *mtrx __rte_unused, const uint8_t *key __rte_unused, int len __rte_unused)