From patchwork Fri Jan 8 20:30:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 59412 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp758307lbb; Fri, 8 Jan 2016 11:54:35 -0800 (PST) X-Received: by 10.55.77.2 with SMTP id a2mr145712490qkb.108.1452282875051; Fri, 08 Jan 2016 11:54:35 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f11si2978702qgf.11.2016.01.08.11.54.34; Fri, 08 Jan 2016 11:54:35 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 65ED761658; Fri, 8 Jan 2016 19:54:34 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=eXCZ7iEO; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id C8A4661D09; Fri, 8 Jan 2016 19:38:17 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 5187C6195C; Fri, 8 Jan 2016 19:36:02 +0000 (UTC) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) by lists.linaro.org (Postfix) with ESMTPS id 3897261C9B for ; Fri, 8 Jan 2016 19:32:06 +0000 (UTC) Received: by mail-lf0-f47.google.com with SMTP id d17so15380296lfb.1 for ; Fri, 08 Jan 2016 11:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=utDyVlN38PghaJqX0rGid95Mxo+F98Bdf7I5haC8R+0=; b=eXCZ7iEOZ0bx0RUSUAsakI54FOlHSWdeq5iqK0zWqCt6L9CdQP7rK0qoP2HynBQ2Gt t6MlIL+br2l3bfjx9IkLN0kT/y/ykoswRFQ9XxMoJcNmDxU4v+xORaW6+kUwceInTmN0 vJP2QLXQ7eqaW/W6JixEnHw/G4/t1AJ3/KtAg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=utDyVlN38PghaJqX0rGid95Mxo+F98Bdf7I5haC8R+0=; b=jM8B0PzWc4JQuPq31hgKEsiyzznCchCJSpbh9xrn7AJfrstnBVhAVPk4YIc8tulBiH rOMhYGdCnoFaZyW84dn8GJ7IQZ4vwJcIuqxIq8B/e8IjKrI+UL+oDShsyUQ7WRfGPvv9 bXau8mqUF3gZ1cBZcT4IBsSsfDv/LC1CbEeJVL5LU1kqgx5zTShYnfeq0FRgU3ruUFIC 0AK7IL6sOuXoeysY5rTTrOI2Z0aUeJXB9xLLitxWXBVsT6aOEmlI2oFZHbSMk+aiZkee 9wYHmI7SiBkz37jqylU6eKDWTxt6Sh3kIFhVJJJeJlwPfotz4+hADFYbmTfCqzgPh7yQ r2Eg== X-Gm-Message-State: ALoCoQl6SS2wDoxCWWtLy+066sNN31SlTIIaglRQovOjbyWXdWhs6srm6ulA8H4+QobKUnIRWJKhiBFqICfA6/yWtDnbZjjdpA== X-Received: by 10.25.86.2 with SMTP id k2mr42674056lfb.5.1452281525169; Fri, 08 Jan 2016 11:32:05 -0800 (PST) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-90-46.cust.bredband2.com. [83.233.90.46]) by smtp.gmail.com with ESMTPSA id l204sm2085534lfg.49.2016.01.08.11.32.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 11:32:04 -0800 (PST) From: Christophe Milard To: anders.roxell@linaro.org, mike.holmes@linaro.org, stuart.haslam@linaro.org, maxim.uvarov@linaro.org, bill.fischofer@linaro.org, petri.savolainen@linaro.org, edavis@broadcom.com Date: Fri, 8 Jan 2016 21:30:08 +0100 Message-Id: <1452285014-60320-26-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452285014-60320-1-git-send-email-christophe.milard@linaro.org> References: <1452285014-60320-1-git-send-email-christophe.milard@linaro.org> Cc: lng-odp@lists.linaro.org Subject: [lng-odp] [API-NEXT RFC 25/31] drivers: ixgbe: adding logging macros X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Christophe Milard --- drivers/ixgbe/ixgbe_logs.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 drivers/ixgbe/ixgbe_logs.h diff --git a/drivers/ixgbe/ixgbe_logs.h b/drivers/ixgbe/ixgbe_logs.h new file mode 100644 index 0000000..82261ef --- /dev/null +++ b/drivers/ixgbe/ixgbe_logs.h @@ -0,0 +1,67 @@ +/*- + * BSD LICENSE + * + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _IXGBE_LOGS_H_ +#define _IXGBE_LOGS_H_ +#include "../driver_log.h" + +/* debugging driver initialisation: */ +#ifdef IXGBE_DEBUG_INIT +#define PMD_INIT_LOG_ERR(fmt, args...) DRV_ERR("INIT: " fmt "\n", ##args) +#define PMD_INIT_LOG_DBG(fmt, args...) DRV_DBG("INIT: " fmt "\n", ##args) +#define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG_DBG(" >>") +#else +#define PMD_INIT_FUNC_TRACE() do { } while (0) +#define PMD_INIT_LOG_ERR(fmt, args...) do { } while (0) +#define PMD_INIT_LOG_DBG(fmt, args...) do { } while (0) +#endif + +/* debugging driver RX function: */ +#ifdef IXGBE_DEBUG_RX +#define PMD_RX_LOG_ERR(fmt, args...) DRV_ERR("RX: " fmt "\n", ##args) +#define PMD_RX_LOG_DBG(fmt, args...) DRV_DBG("RX: " fmt "\n", ##args) +#else +#define PMD_RX_LOG_ERR(fmt, args...) do { } while (0) +#define PMD_RX_LOG_DBG(fmt, args...) do { } while (0) +#endif + +/* debugging driver TX function: */ +#ifdef IXGBE_DEBUG_TX +#define PMD_TX_LOG_ERR(fmt, args...) DRV_ERR("TX: " fmt "\n", ##args) +#define PMD_TX_LOG_DBG(fmt, args...) DRV_DBG("TX: " fmt "\n", ##args) +#else +#define PMD_TX_LOG_ERR(fmt, args...) do { } while (0) +#define PMD_TX_LOG_DBG(fmt, args...) do { } while (0) +#endif + +#endif /* _IXGBE_LOGS_H_ */