From patchwork Mon Feb 20 18:49:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 124212 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 6F4C941CEE; Mon, 20 Feb 2023 19:50:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D118430CE; Mon, 20 Feb 2023 19:50:08 +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 1F0A6430C6 for ; Mon, 20 Feb 2023 19:50:05 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id qi12-20020a17090b274c00b002341621377cso2209020pjb.2 for ; Mon, 20 Feb 2023 10:50: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=FhY2/8JKip9jE5AnJD2e45pWIw7FlQwNHfxGqa7xcIY=; b=NGu/QXa/sHMgHu+dJlNhNxl3XMEbD0YCpLsezJWV0cOAHWt+1ORK7UbwfjXqUYayCi iHxIhoqEHX5qjV9Zh9QK3mLDBtSDEKqBJS+x8xyslhNqOPjOc9lMy22YgTkyTLpfXZT3 stl73JGt4psyn37EGObIkF1Rnqx3p7WhS7CSMCik/ubWm1LGCwzpr8/aAMvWsEMQ7az3 w29mxMoB6+CpQnIkiHP+QVVRc07/AnY0cgEftwjoJPCOlkXvR2z0H8yUP+Jcn+gIN31e ofoT2uSfGzPcCSYex/aN5H8uSXr/qoJiVcCZdjV8yIkzwW5DM/azkVXDwJZxMJWZpVWP q5Lw== 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=FhY2/8JKip9jE5AnJD2e45pWIw7FlQwNHfxGqa7xcIY=; b=TCOql2o53r+jXIO0wItuAIrNea7p9i1/sTdFpOe2Lu9tgEhmQpfF9804ys6fo8mrsG aP1PJEPpNexAeU8zs3Jvy7XoONmqFlV7Bpfpbeyr7qNQXyhpqVE136J8krEUwuUjGebQ vN7CVVVlRlVMAVzgtE3G0F9TNDexzwEAQQ9l16DNkW/c9qlt5ukS8F6GdRfanDFelGZv tpu6i1AZPciONltyNtQ/1GLTFlzpW6YUGgFg7qDlXPrvB86OH/BDP6Cri7+RzoZtZm/S HLiVjhCDA71kJAcQAoLtntAK/aO/BXn3LOQMyh7g67vmitQ/cGx9mYc7UF/pO41rpcJg 5QMA== X-Gm-Message-State: AO0yUKX2yZ1opbUeV0cqxFBHsNyysHK0LNjLihVnSVWNSLi86QaADaj6 adDYDxVf8oDgZvkl0guQBOEVJNzO00TA3HIeE2Y= X-Google-Smtp-Source: AK7set+RdILqK1hptZC2ymqDqx/R2JrvJlpZpqr0PKKwagerDFmTnWszgCq94ijYGWGMy1x9CaJK8Q== X-Received: by 2002:a17:903:687:b0:19a:7548:da22 with SMTP id ki7-20020a170903068700b0019a7548da22mr1774426plb.50.1676919003985; Mon, 20 Feb 2023 10:50:03 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id n21-20020a170902969500b0019607547f29sm2020798plp.304.2023.02.20.10.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 10:50:03 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Konstantin Ananyev Subject: [PATCH v6 1/5] ip_frag: use a dynamic logtype Date: Mon, 20 Feb 2023 10:49:57 -0800 Message-Id: <20230220185001.50714-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220185001.50714-1-stephen@networkplumber.org> References: <20230208044825.1682620-1-stephen@networkplumber.org> <20230220185001.50714-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 DPDK libraries should not be reusing RTE_LOGTYPE_USER1 in lieu of doing proper logtype registration. Acked-by: Konstantin Ananyev Fixes: 416707812c03 ("ip_frag: refactor reassembly code into a proper library") Signed-off-by: Stephen Hemminger --- lib/ip_frag/ip_frag_common.h | 5 ++++- lib/ip_frag/rte_ip_frag_common.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h index 9c0dbdeb6eb9..95f1689d476d 100644 --- a/lib/ip_frag/ip_frag_common.h +++ b/lib/ip_frag/ip_frag_common.h @@ -8,9 +8,12 @@ #include "rte_ip_frag.h" #include "ip_reassembly.h" +extern int ipfrag_logtype; +#define RTE_LOGTYPE_IPFRAG ipfrag_logtype + /* logging macros. */ #ifdef RTE_LIBRTE_IP_FRAG_DEBUG -#define IP_FRAG_LOG(lvl, fmt, args...) RTE_LOG(lvl, USER1, fmt, ##args) +#define IP_FRAG_LOG(lvl, fmt, args...) RTE_LOG(lvl, IPFRAG, fmt, ##args) #else #define IP_FRAG_LOG(lvl, fmt, args...) do {} while(0) #endif /* IP_FRAG_DEBUG */ diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c index c1de2e81b6d0..e4af8d23ad10 100644 --- a/lib/ip_frag/rte_ip_frag_common.c +++ b/lib/ip_frag/rte_ip_frag_common.c @@ -7,6 +7,8 @@ #include +RTE_LOG_REGISTER_DEFAULT(ipfrag_logtype, INFO); + #include "ip_frag_common.h" #define IP_FRAG_HASH_FNUM 2