DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: Timothy Redaelli <tredaelli@redhat.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	 "dev@dpdk.org" <dev@dpdk.org>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	 Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] Build is broken in dpdk-next-net
Date: Fri, 30 Mar 2018 23:02:24 +0800	[thread overview]
Message-ID: <CAMDZJNWk0+OXo4fsZZLSqeYt8O-oc3vhQQibPTu8V=AJ6HTdqQ@mail.gmail.com> (raw)
In-Reply-To: <919879b3-2143-3f94-1ba1-736a4853f4dd@redhat.com>

On Fri, Mar 30, 2018 at 10:59 PM, Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
> Thanks Xiangxia,
>
> I can post it, do you agree if I add below comments?
yes, thanks.

> On 03/30/2018 04:47 PM, Tonghao Zhang wrote:
>>
>> I rebuild it on ubuntu 17.10 and cash it. I use the 'RTE_SET_USED' to fix
>> it.
>>
>>
>> diff --git a/lib/librte_vhost/fd_man.c b/lib/librte_vhost/fd_man.c
>> index 771675718..f11803191 100644
>> --- a/lib/librte_vhost/fd_man.c
>> +++ b/lib/librte_vhost/fd_man.c
>> @@ -279,7 +279,8 @@ fdset_pipe_read_cb(int readfd, void *dat __rte_unused,
>>                     int *remove __rte_unused)
>>   {
>>          char charbuf[16];
>> -       read(readfd, charbuf, sizeof(charbuf));
>> +       int r = read(readfd, charbuf, sizeof(charbuf));
>
> /* Just an optimization, we don't care if read() failed so ignore explicitly
> its return value to make the compiler happy */
>>
>> +       RTE_SET_USED(r);
>>   }
>>
>>   void
>> @@ -319,5 +320,6 @@ fdset_pipe_init(struct fdset *fdset)
>>   void
>>   fdset_pipe_notify(struct fdset *fdset)
>>   {
>> -       write(fdset->u.writefd, "1", 1);
>
> /* Just an optimization, we don't care if write() failed so ignore
> explicitly its return value to make the compiler happy */
>
>> +       int r = write(fdset->u.writefd, "1", 1);
>> +       RTE_SET_USED(r);
>>   }
>>
>> On Fri, Mar 30, 2018 at 10:28 PM, Timothy Redaelli <tredaelli@redhat.com>
>> wrote:
>>>
>>> On Fri, 30 Mar 2018 15:27:55 +0200
>>> Maxime Coquelin <maxime.coquelin@redhat.com> wrote:
>>>
>>>> Hi Andrew,
>>>>
>>>> On 03/30/2018 03:18 PM, Andrew Rybchenko wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> Build is broken in dpdk-next-net for me on Ubuntu 16.04.4:
>>>>>
>>>>> lib/librte_vhost/fd_man.c: In function ‘fdset_pipe_read_cb’:
>>>>> lib/librte_vhost/fd_man.c:284:2: error: ignoring return value of
>>>>> ‘read’, declared with attribute warn_unused_result
>>>>> [-Werror=unused-result] read(readfd, charbuf, sizeof(charbuf)); ^
>>>>> lib/librte_vhost/fd_man.c: In function ‘fdset_pipe_notify’:
>>>>> lib/librte_vhost/fd_man.c:324:2: error: ignoring return value of
>>>>> ‘write’, declared with attribute warn_unused_result
>>>>> [-Werror=unused-result] write(fdset->u.writefd, "1", 1); ^
>>>>>
>>>>> $ gcc --version
>>>>> gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
>>>>
>>>>
>>>> Thanks for reporting, I don't catch it with my Fedora build system:
>>>> $ gcc --version
>>>> gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
>>>
>>>
>>> Those kind of warnings are enabled by "-D_FORTIFY_SOURCE=2" (enabled by
>>> default in Ubuntu [1]).
>>>
>>> To have the same behavior on Fedora you need to set -D_FORTIFY_SOURCE=2
>>> by hand, for example with:
>>>
>>> # make EXTRA_CFLAGS="-D_FORTIFY_SOURCE=2"
>>>
>>> Usually I build dpdk with the flags we also use when we build the
>>> Fedora/RHEL package. To do that I have in my .bashrc (all in one line):
>>>
>>> export EXTRA_CFLAGS="-O2 -g -pipe -Werror=format-security
>>> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong
>>> --param=ssp-buffer-size=4 -grecord-gcc-switches
>>> -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic
>>> -fasynchronous-unwind-tables -Wformat"
>>>
>>>>>
>>>>> As I understand it is broken in
>>>>> ad94ade905454401b705be9e06b19e54a1c78148 vhost: add pipe event for
>>>>> optimizing negotiating
>>>>
>>>>
>>>> I confirm it is this patch.
>>>>
>>>> Xiangxia, can you provide a fix please?
>>>>
>>>> Ferruh, how do you want to proceed?
>>>> Would you revert it?
>>>>
>>>> Thanks,
>>>> Maxime
>>>>>
>>>>> Andrew.
>>>>>
>>>
>>> [1]
>>> https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-D_FORTIFY_SOURCE.3D2
>>>
>

  reply	other threads:[~2018-03-30 15:02 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-30 13:18 Andrew Rybchenko
2018-03-30 13:27 ` Maxime Coquelin
2018-03-30 14:13   ` Ferruh Yigit
2018-03-30 14:16     ` Tonghao Zhang
2018-03-30 14:17       ` Maxime Coquelin
2018-03-30 14:28   ` Timothy Redaelli
2018-03-30 14:47     ` Tonghao Zhang
2018-03-30 14:59       ` Maxime Coquelin
2018-03-30 15:02         ` Tonghao Zhang [this message]
2018-03-31 13:33       ` Neil Horman
2018-03-31 15:09         ` Gaëtan Rivet
2018-03-31 15:27           ` Neil Horman
2018-03-31 16:21             ` Gaëtan Rivet
2018-03-31 18:48               ` Neil Horman
2018-04-02 16:25                 ` Stephen Hemminger
2018-04-03  8:31                   ` Maxime Coquelin
2018-04-03 10:13                     ` Thomas Monjalon
2018-04-03 10:41                   ` Neil Horman
2018-04-03 13:14                     ` Wiles, Keith
2018-03-30 14:55     ` Maxime Coquelin

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='CAMDZJNWk0+OXo4fsZZLSqeYt8O-oc3vhQQibPTu8V=AJ6HTdqQ@mail.gmail.com' \
    --to=xiangxia.m.yue@gmail.com \
    --cc=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=thomas@monjalon.net \
    --cc=tredaelli@redhat.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).