From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f180.google.com (mail-qt0-f180.google.com [209.85.216.180]) by dpdk.org (Postfix) with ESMTP id 90ACF6A6E for ; Tue, 28 Mar 2017 23:11:37 +0200 (CEST) Received: by mail-qt0-f180.google.com with SMTP id n21so75617010qta.1 for ; Tue, 28 Mar 2017 14:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=atomicrules-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/zJ0Mm5PK5GxUJxVRqDze2vfkSTyErph24bz9OEqYF4=; b=LQ/ewL4LXIsS+mWBb5nGBGcqbmuyftjCX/lDwIQC1vCy841yXkKo6VTkF+JSv9/h2J 0k6BqNM5TfSy39o1UZ2C9hgwXEv/ttXsimmt0+OxzY7teDxy5IS95yMZxb0za8jThe56 IzIpgprCU8s6S92jiVVVA75cY5zMqQyRbim8kOU3pwo10fekmeIopTtgdkDXytnbQzr0 nH4cXKHbZn+eWEtkMTGwwn2WbHv+CmPa6zVY1iaMRkaTxnHEcbvabamzwszaaHzKkGWh YnrLWLf1njeEBjeZt4Vjbr4yd98S76szlohzQ2QatA4dGiyd0US4i1pNbjfNYJBdzINT p4Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/zJ0Mm5PK5GxUJxVRqDze2vfkSTyErph24bz9OEqYF4=; b=Z7JOHkjYY7BaTfQklyGj6MSwkIS0aYEysMfVi2Az+0aapn4D9r9OdwgqFcdpcIkyJb FylBtZpXkPkDncLK0tjuYLWGT7SZSPnD5Gu23SKF8c6hBWMeeMWnjEIpUCWpcW8wmass mC4gtMRtxTJ+0UEjIqeIzTLYqvyGe2pq3xo6fJyvhitcPzsmzZ+YLGXNpt9gXqjzqJOK Y7WwKGUUYDi9qQ0aGQ8NvSuHUhAmYha2Kf0upgAdv8sooPM/kl19v+FHV7EvNETuzRhu 6jtVBEBat9MzK1EoepZk7S1zf4+kPGZJusvqGJpWibx8btkpXccbl7ebHryjRQFFztsH +CAg== X-Gm-Message-State: AFeK/H3d001clwhH7V7OMParCbD4+otAjjdVjw2cIacH54Sf0VWyEEFOV3XUmHzRB1EsNW+YqMW/7Jkja3n5jg== X-Received: by 10.237.36.44 with SMTP id r41mr28329782qtc.258.1490735496848; Tue, 28 Mar 2017 14:11:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.1.131 with HTTP; Tue, 28 Mar 2017 14:11:16 -0700 (PDT) In-Reply-To: <8625c310-943c-14b5-8215-b1f66bb94bb2@intel.com> References: <1490231015-31748-1-git-send-email-ed.czeck@atomicrules.com> <0d1c21b6-6163-12f0-cbe4-d23c06a809e9@intel.com> <8625c310-943c-14b5-8215-b1f66bb94bb2@intel.com> From: Ed Czeck Date: Tue, 28 Mar 2017 17:11:16 -0400 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v4 1/7] net/ark: PMD for Atomic Rules Arkville driver stub 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: , X-List-Received-Date: Tue, 28 Mar 2017 21:11:37 -0000 On Tue, Mar 28, 2017 at 8:58 AM, Ferruh Yigit wrote: > On 3/23/2017 7:46 PM, Ed Czeck wrote: > > >> > +#define ARK_TRACE_ON(fmt, ...) \ > >> > + PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__) > >> > + > >> > +#define ARK_TRACE_OFF(fmt, ...) \ > >> > + do {if (0) PMD_DRV_LOG(ERR, fmt, ##__VA_ARGS__); } while (0) > >> why not just "do { } while(0)" ? > > > > A do while body always executes at least once. The if (0) is required. > > Are you sure about this? > > I believe "do { } while(0)" also removed completely during compile. > I verified that the if (0) is required. > > > >> dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE; > > > > I do not understand your comment. > > This flag also should be added, all eth devices by are detachable. > Flag has been added. > > > >> The general usage of DEBUG_TRACE is providing backtrace log, function > >> enterance / exit informations. I guess, that is why it has been > >> controlled by different config option. > >> Here what you need looks like regular debugging functions, PMD_DRV_LOG / > >> RTE_LOG variant. > > > > I'm unclear on your request or comment. Are you suggesting that we use > > the dpdk versions of debug? The advantage of a local version is that > > they can be enabled without all the debug traces. > > In many drivers there are independent log macros, two of them are: > 1) PMD_.._TRACE > 2) PMD_.._LOG > > Those above controlled by different config option. > > As name suggest, first one lets you to get function trace logs, many > PMDs don't use them, since you can get this information from debugger. > > Second one is PMD wise log macro, controlled by its specific config option. > > It is possible enable / disable tracing logs (1), without effecting > general logging macros (2). > > In ARK PMD, both ARK_DEBUG_TRACE and PMD_DRV_LOG macros are used for > regular logging. > > a) I believe it is wrong to use ARK_DEBUG_TRACE for regular logging, all > should be PMD_DRV_LOG > > b) And PMD_DRV_LOG should be controlled by a config option. > > As far as I can see ARK_DEBUG_TRACE never used for tracing really, so > you can rename all occurrences to PMD_DRV_LOG, and remove > ARK_DEBUG_TRACE and its config option. > > And introduce a config option for PMD_DRV_LOG > > Thank you. I refactored the messaging and logging code to a set of macros named PMD__LOG, where XX is one of {DEBUG, STATS, RX, TX,DRV}. This follows the code pattern from the Intel PMDs. Much of the logging has been changed throughout the other patches as well.