From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id B9DE816E for ; Thu, 18 May 2017 16:01:27 +0200 (CEST) Received: from pure.maildistiller.com (unknown [10.110.50.29]) by dispatch1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTP id 4250B60158; Thu, 18 May 2017 14:01:26 +0000 (UTC) X-Virus-Scanned: Proofpoint Essentials engine Received: from mx2-us1.ppe-hosted.com (unknown [10.110.49.251]) by pure.maildistiller.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 8B35B60061; Thu, 18 May 2017 14:01:23 +0000 (UTC) Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 2DC658008D; Thu, 18 May 2017 14:01:22 +0000 (UTC) Received: from [192.168.38.17] (84.52.89.52) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Thu, 18 May 2017 15:01:12 +0100 To: Ferruh Yigit , References: <1495023908-10977-1-git-send-email-arybchenko@solarflare.com> <1495023908-10977-2-git-send-email-arybchenko@solarflare.com> <2a7d4dc5-2306-b799-5fc1-c927dd07db53@intel.com> From: Andrew Rybchenko Message-ID: <6fea5c4b-61d9-21a3-872e-5f8ba27572b5@solarflare.com> Date: Thu, 18 May 2017 17:01:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <2a7d4dc5-2306-b799-5fc1-c927dd07db53@intel.com> X-Originating-IP: [84.52.89.52] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-11.0.0.1191-8.100.1062-23076.003 X-TM-AS-Result: No--13.485100-0.000000-31 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-MDID: 1495116084-KfOkoq20XP73 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 2/3] net/sfc: use locally stored data for logging 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: Thu, 18 May 2017 14:01:28 -0000 On 05/18/2017 01:59 PM, Ferruh Yigit wrote: > On 5/17/2017 1:25 PM, Andrew Rybchenko wrote: >> Required to be able to use logging in the secondary process >> where Ethernet device pointer stored in sfc_adapter is invalid. >> >> Signed-off-by: Andrew Rybchenko >> Reviewed-by: Andy Moreton > <...> > >> diff --git a/drivers/net/sfc/sfc_log.h b/drivers/net/sfc/sfc_log.h >> index d0f8921..6c43925 100644 >> --- a/drivers/net/sfc/sfc_log.h >> +++ b/drivers/net/sfc/sfc_log.h >> @@ -35,18 +35,16 @@ >> /* Log PMD message, automatically add prefix and \n */ >> #define SFC_LOG(sa, level, ...) \ >> do { \ >> - const struct rte_eth_dev *_dev = (sa)->eth_dev; \ >> - const struct rte_pci_device *_pci_dev = \ >> - RTE_ETH_DEV_TO_PCI(_dev); \ >> + const struct sfc_adapter *_sa = (sa); \ > Getting following build error with clang and icc [1]. I guess that is > because "_sa" declared on both sfc_log_init() and in the macro that > function uses (SFC_LOG). Thanks, I'll fix it in v2. > [1] > .../drivers/net/sfc/sfc_filter.c:121:2: > error: variable '_sa' is uninitialized when used within its own > initialization [-Werror,-Wuninitialized] > sfc_log_init(sa, "failed %d", rc); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > .../drivers/net/sfc/sfc_log.h:68:12: note: expanded from macro > 'sfc_log_init' > SFC_LOG(_sa, INFO, \ > ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > .../drivers/net/sfc/sfc_log.h:38:36: note: expanded from macro 'SFC_LOG' > const struct sfc_adapter *_sa = (sa); \ > ~~~ ^~