DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>, <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 2/3] net/sfc: use locally stored data for logging
Date: Thu, 18 May 2017 17:01:08 +0300	[thread overview]
Message-ID: <6fea5c4b-61d9-21a3-872e-5f8ba27572b5@solarflare.com> (raw)
In-Reply-To: <2a7d4dc5-2306-b799-5fc1-c927dd07db53@intel.com>

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 <arybchenko@solarflare.com>
>> Reviewed-by: Andy Moreton <amoreton@solarflare.com>
> <...>
>
>> 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);           \
>                                   ~~~    ^~

  reply	other threads:[~2017-05-18 14:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 12:25 [dpdk-dev] [PATCH 1/3] net/sfc: carefully cleanup on init failure and shutdown Andrew Rybchenko
2017-05-17 12:25 ` [dpdk-dev] [PATCH 2/3] net/sfc: use locally stored data for logging Andrew Rybchenko
2017-05-18 10:59   ` Ferruh Yigit
2017-05-18 14:01     ` Andrew Rybchenko [this message]
2017-05-17 12:25 ` [dpdk-dev] [PATCH 3/3] net/sfc: support multi-process Andrew Rybchenko
2017-05-18 14:00 ` [dpdk-dev] [PATCH v2 1/3] net/sfc: carefully cleanup on init failure and shutdown Andrew Rybchenko
2017-05-18 14:00   ` [dpdk-dev] [PATCH v2 2/3] net/sfc: use locally stored data for logging Andrew Rybchenko
2017-05-18 14:00   ` [dpdk-dev] [PATCH v2 3/3] net/sfc: support multi-process Andrew Rybchenko
2017-05-22 11:29     ` Ferruh Yigit
2017-05-22 12:07       ` Andrew Rybchenko
2017-05-22 12:36         ` Ferruh Yigit
2017-05-22 12:44           ` Andrew Rybchenko
2017-05-22 12:54             ` Ferruh Yigit
2017-05-22 15:18           ` Sergio Gonzalez Monroy
2017-05-22 15:42   ` [dpdk-dev] [PATCH v2 1/3] net/sfc: carefully cleanup on init failure and shutdown Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fea5c4b-61d9-21a3-872e-5f8ba27572b5@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).