From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CDD6F436E3; Wed, 13 Dec 2023 17:41:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8DD5842FAD; Wed, 13 Dec 2023 17:40:25 +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 782B842F79 for ; Wed, 13 Dec 2023 17:40:17 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1d345b187bbso14961415ad.0 for ; Wed, 13 Dec 2023 08:40:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702485616; x=1703090416; darn=dpdk.org; 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=a+EUxTi++V2AI8QEzuBAtt/lqNXDgxcYRnbREuTh0RQ=; b=CRbpUPxPa5uveZQAMzmpNiojfKe0PK3bf+tR9YXS408pBjDSug9G0ja3BpvD2AJ4ig 2Oh4jJ6kWvorFlQhn+QAKq0ufN7Wpg08YOAggoRoEs64XEgL7DoIid+4pss9iOmI/kFg zCeiDCyPKDLaklePMyG5TORxvhaJl5TS4RF390gCp2J5RQZHfNqyeB/uIf/8TVKvGLpi juWXvLY2cTbgRwA/NNStCMaFvfp/4L3YPvo6bWSjaRUnRbuQRM5rT2EVBJDQ8S4NpfJU FdjvXZyM2LWGOW7zvsUhd2Nf7nEbX/vCk2qzUQ+nCyqhNRPUB4og0b7nc7MIaxcsjO/y I8mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702485616; x=1703090416; 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=a+EUxTi++V2AI8QEzuBAtt/lqNXDgxcYRnbREuTh0RQ=; b=S4ozbsR7GvfiJ5S/VZVHHFk0fDmUj1kgmjH8su1F+2RT5XJiGnxbpyNcE2/EeI51/h 3x9LnmjQwt4I9IQpdreU88wPdOQAGw52qkFEO3J+PWUUA86ZiVR9C5H+TrEGhhAU1aKh MgZkoUOPR0vpKtoUWgaT2Yom7AQXKIZ56dWVVgMmRQJWDYTHQ+VxALcQovx5gZGqjfai Mzhrnb1vke5rnaNz9GS166I4E/fIDNAaWNRI6rT1RY8842dXpcgkpEgxR81O0qsWkfsO /MlykbPIKsLlUIBMYJST9d2DNfOEQX06yoEdOG+5vmTTw0P/DRBLHS4nNUXtw+R+o0aR 59Og== X-Gm-Message-State: AOJu0YztpWYs/niDvDxayA9tU+zL3UkU01/Hbu3iBVxnLcZnhYkW/xgP z23Da8B8UaRzV83EneHUt7XD8zf+ej6rNPXugkI= X-Google-Smtp-Source: AGHT+IGV/tZ+vuoicu4V2lmZemGTVGtY5RF/CTUfHbW2CV7BJBGfGUf9GUIeVUIOdVwMApPvQBnt9g== X-Received: by 2002:a17:903:32c8:b0:1d0:5806:f45d with SMTP id i8-20020a17090332c800b001d05806f45dmr9023938plr.42.1702485616679; Wed, 13 Dec 2023 08:40:16 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id 4-20020a170902c24400b001d0a6f31519sm10749593plg.188.2023.12.13.08.40.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 08:40:16 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Xiao Wang Subject: [PATCH v3 26/37] vdpa/ifc: replace use of RTE_LOGTYPE_PMD Date: Wed, 13 Dec 2023 08:36:00 -0800 Message-ID: <20231213163820.894987-27-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213163820.894987-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231213163820.894987-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 This driver is using RTE_LOGTYPE_PMD, fix to have a dynamic type. Signed-off-by: Stephen Hemminger --- drivers/vdpa/ifc/base/ifcvf.c | 14 +++++++------- drivers/vdpa/ifc/base/ifcvf_osdep.h | 9 +++++++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.c index 53e982a52e9d..d8c1595cdb02 100644 --- a/drivers/vdpa/ifc/base/ifcvf.c +++ b/drivers/vdpa/ifc/base/ifcvf.c @@ -224,11 +224,10 @@ ifcvf_enable_mq(struct ifcvf_hw *hw) if (mq_cfg) { if (hw->device_type == IFCVF_BLK) { *(u32 *)mq_cfg = nr_queue; - RTE_LOG(INFO, PMD, "%d queues are enabled\n", nr_queue); + IFCVF_LOG(INFO, "%d queues are enabled", nr_queue); } else { *(u32 *)mq_cfg = nr_queue / 2; - RTE_LOG(INFO, PMD, "%d queue pairs are enabled\n", - nr_queue / 2); + IFCVF_LOG(INFO, "%d queue pairs are enabled", nr_queue / 2); } } } @@ -246,7 +245,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg; if (!cfg) { - RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n"); + IFCVF_LOG(ERR, "common_cfg in HW is NULL."); return -1; } @@ -258,8 +257,7 @@ ifcvf_enable_vring_hw(struct ifcvf_hw *hw, int i) IFCVF_WRITE_REG16(i + 1, &cfg->queue_msix_vector); msix_vector = IFCVF_READ_REG16(&cfg->queue_msix_vector); if (msix_vector == IFCVF_MSI_NO_VECTOR) { - RTE_LOG(ERR, PMD, "queue %d, msix vec alloc failed\n", - i); + IFCVF_LOG(ERR, "queue %d, msix vec alloc failed", i); return -1; } } @@ -307,7 +305,7 @@ ifcvf_disable_vring_hw(struct ifcvf_hw *hw, int i) cfg = hw->common_cfg; if (!cfg) { - RTE_LOG(ERR, PMD, "common_cfg in HW is NULL.\n"); + IFCVF_LOG(ERR, "common_cfg in HW is NULL."); return; } @@ -531,3 +529,5 @@ ifcvf_get_queue_notify_off(struct ifcvf_hw *hw, int qid) return (u8 *)hw->notify_addr[qid] - (u8 *)hw->mem_resource[hw->notify_region].addr; } + +RTE_LOG_REGISTER_DEFAULT(ifcvf_logtype, INFO); diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h index dd2ff08f77cc..7100a8b968a4 100644 --- a/drivers/vdpa/ifc/base/ifcvf_osdep.h +++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h @@ -13,8 +13,13 @@ #include #include -#define WARNINGOUT(S, args...) RTE_LOG(WARNING, PMD, S, ##args) -#define DEBUGOUT(S, args...) RTE_LOG(DEBUG, PMD, S, ##args) +extern int ifcvf_logtype; + +#define IFCVF_LOG(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, ifcvf_logtype, fmt "\n", ## args) + +#define WARNINGOUT(S, args...) IFCVF_LOG(WARNING, S, ##args) +#define DEBUGOUT(S, args...) IFCVF_LOG(DEBUG, S, ##args) #define STATIC static #define msec_delay(x) rte_delay_us_sleep(1000 * (x)) -- 2.43.0