From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 60FD6A04B7; Tue, 13 Oct 2020 15:50:14 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B6A21DBD4; Tue, 13 Oct 2020 15:46:24 +0200 (CEST) Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 236B91DB8B for ; Tue, 13 Oct 2020 15:46:04 +0200 (CEST) Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.137]) by dispatch1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 2BC49200C5 for ; Tue, 13 Oct 2020 13:46:02 +0000 (UTC) Received: from us4-mdac16-55.at1.mdlocal (unknown [10.110.50.140]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 27D70600A7 for ; Tue, 13 Oct 2020 13:46:02 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx1-us1.ppe-hosted.com (unknown [10.110.50.7]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 8F82E220072 for ; Tue, 13 Oct 2020 13:46:01 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTPS id 5949F4C006B for ; Tue, 13 Oct 2020 13:46:01 +0000 (UTC) Received: from ukex01.SolarFlarecom.com (10.17.10.4) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 13 Oct 2020 14:45:56 +0100 Received: from opal.uk.solarflarecom.com (10.17.10.1) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 13 Oct 2020 14:45:56 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (ukv-loginhost.uk.solarflarecom.com [10.17.10.39]) by opal.uk.solarflarecom.com (8.13.8/8.13.8) with ESMTP id 09DDjulv006040 for ; Tue, 13 Oct 2020 14:45:56 +0100 Received: from ukv-loginhost.uk.solarflarecom.com (localhost [127.0.0.1]) by ukv-loginhost.uk.solarflarecom.com (Postfix) with ESMTP id 09DAF1613A9 for ; Tue, 13 Oct 2020 14:45:56 +0100 (BST) From: Andrew Rybchenko To: Date: Tue, 13 Oct 2020 14:45:32 +0100 Message-ID: <1602596753-32282-16-git-send-email-arybchenko@solarflare.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1602596753-32282-1-git-send-email-arybchenko@solarflare.com> References: <1602596753-32282-1-git-send-email-arybchenko@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.6.1012-25722.003 X-TM-AS-Result: No-9.494000-8.000000-10 X-TMASE-MatchedRID: ceEONRK33iqRyUXgTydza3Gg/sD2gWLWjp+gEx9nJ9KGToisPp3j9RxS cgjK3TZJAtkU2kJ6d29TvVffeIwvQyHhSBQfglfsA9lly13c/gFvV3/OnMClWhRnkhLZOCK9jmN 2pm25LqwC5LQarM45T+pTB3iVvkxyHxPMjOKY7A8LbigRnpKlKSPzRlrdFGDwI9dmWWoGSsofLz rNIa6vfgl8Ymdz95YuUKohCwOaKJeTRDpzG3k69Q== X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--9.494000-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.6.1012-25722.003 X-MDID: 1602596762-i_cebnbB-2N2 X-PPE-DISP: 1602596762;i_cebnbB-2N2 Subject: [dpdk-dev] [PATCH 15/36] net/sfc: support datapath logs which may be compiled out X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add datapath log level which limits logs included in build since on datapath it is too expensive to dive into rte_log() function even if it does nothing. Signed-off-by: Andrew Rybchenko --- drivers/net/sfc/sfc_dp.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/sfc/sfc_dp.h b/drivers/net/sfc/sfc_dp.h index 47487d1f1f..df76f3f2bb 100644 --- a/drivers/net/sfc/sfc_dp.h +++ b/drivers/net/sfc/sfc_dp.h @@ -51,6 +51,11 @@ void sfc_dp_queue_init(struct sfc_dp_queue *dpq, uint16_t port_id, uint16_t queue_id, const struct rte_pci_addr *pci_addr); +/* Maximum datapath log level to be included in build. */ +#ifndef SFC_DP_LOG_LEVEL +#define SFC_DP_LOG_LEVEL RTE_LOG_NOTICE +#endif + /* * Helper macro to define datapath logging macros and have uniform * logging. @@ -60,6 +65,8 @@ void sfc_dp_queue_init(struct sfc_dp_queue *dpq, const struct sfc_dp_queue *_dpq = (dpq); \ const struct rte_pci_addr *_addr = &(_dpq)->pci_addr; \ \ + if (RTE_LOG_ ## level > SFC_DP_LOG_LEVEL) \ + break; \ SFC_GENERIC_LOG(level, \ RTE_FMT("%s " PCI_PRI_FMT \ " #%" PRIu16 ".%" PRIu16 ": " \ -- 2.17.1