From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot0-f196.google.com (mail-ot0-f196.google.com [74.125.82.196]) by dpdk.org (Postfix) with ESMTP id 9290044CF for ; Fri, 30 Mar 2018 17:02:26 +0200 (CEST) Received: by mail-ot0-f196.google.com with SMTP id f47-v6so863868oth.2 for ; Fri, 30 Mar 2018 08:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=3vQw+TGvMDPqmcsdow24aCVtDxG29bfMBXspDTT/a0o=; b=mPJLnd7NQfP1uaxpvVSvz9QuaWbMua1R8GLkL+pC6b9/t+PZxmUQjDMual6h5jPQdl zhDbg1SKWhp9qS+DfnbsadaUr4ktli+8EBUHqRhh4xoZJ3MA951TrjMowqaC4j7QrWKJ RAYIvlIElZ71bcOlXQjE2Z1wkphtL1r8qsjA1ku+gK6Fjw5Hmy1f/vJCROkq4nLqwNco Y/5vgm3NuPluvK0wWF6he5u0iM4lSn9+WtW/WToQ9RBu0eu8EBOUP2exxORbwAiXhxs9 viKKoZUJtOXlflZMlDtLqRhcbmCHy8MGLUEsTBj+w93qcNl2JA/ZVT4QeI7jrD4gYszN m9Ag== 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:content-transfer-encoding; bh=3vQw+TGvMDPqmcsdow24aCVtDxG29bfMBXspDTT/a0o=; b=lvPpMqb8eTcNjOb2MsJmB33hosRSj7DeAI//OPfbpiWV1aXLNRPmsUOKi0FN/Jgrsw GT9eIxnguPohVsLBosj+mniXm/L2EbD2Q+n602cy2ljD4xH5ajMnQwnpKFO1EpUU6QIN QWiCu+YsItJ2YbK1bYt1ABmRjnt4jvlCmeHvZnltsxDGCGScgA9XFOLH9KAP6CmAfKZK lck3VBuM0kJIWeNhCk8qhmCE14wZKyZ7rQ2MRoeUc4e+SrezA/27lKggSkxqm8UUWcmC LA7TqgeG11YOeS5+2Y+Ptt46bEp73j6oA8l+vJgkam6eeo7SAK6Uy8hlno1U5NwEtOqr pkzA== X-Gm-Message-State: ALQs6tCA5FPSWKYrhTEF6emqNFqY5/JRHvPSGnRebjy2EcHH9sUvStJf d8djR523+EC57eaPrL9LAu8FSQjHvQ4MbzIaYlc= X-Google-Smtp-Source: AIpwx4+KPbB/GvYjsqF7gdtjW7YbuN2G7dea1lPC5aNkm4sbHtPZOsMmrabISt6OyX8hhhcTvufVD4cy069dzM6Lta0= X-Received: by 2002:a9d:3398:: with SMTP id u24-v6mr61843otc.193.1522422144782; Fri, 30 Mar 2018 08:02:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.198.16 with HTTP; Fri, 30 Mar 2018 08:02:24 -0700 (PDT) In-Reply-To: <919879b3-2143-3f94-1ba1-736a4853f4dd@redhat.com> References: <93d00a28-d52d-25b3-42d0-84b1d95c756a@redhat.com> <20180330162830.1d7ccba2@redhat.com> <919879b3-2143-3f94-1ba1-736a4853f4dd@redhat.com> From: Tonghao Zhang Date: Fri, 30 Mar 2018 23:02:24 +0800 Message-ID: To: Maxime Coquelin Cc: Timothy Redaelli , Andrew Rybchenko , "dev@dpdk.org" , Ferruh Yigit , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] Build is broken in dpdk-next-net 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: Fri, 30 Mar 2018 15:02:26 -0000 On Fri, Mar 30, 2018 at 10:59 PM, Maxime Coquelin 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 fi= x >> 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_unuse= d, >> int *remove __rte_unused) >> { >> char charbuf[16]; >> - read(readfd, charbuf, sizeof(charbuf)); >> + int r =3D read(readfd, charbuf, sizeof(charbuf)); > > /* Just an optimization, we don't care if read() failed so ignore explici= tly > 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 =3D write(fdset->u.writefd, "1", 1); >> + RTE_SET_USED(r); >> } >> >> On Fri, Mar 30, 2018 at 10:28 PM, Timothy Redaelli >> wrote: >>> >>> On Fri, 30 Mar 2018 15:27:55 +0200 >>> Maxime Coquelin 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 =E2=80=98fdset_pipe_read_cb=E2= =80=99: >>>>> lib/librte_vhost/fd_man.c:284:2: error: ignoring return value of >>>>> =E2=80=98read=E2=80=99, declared with attribute warn_unused_result >>>>> [-Werror=3Dunused-result] read(readfd, charbuf, sizeof(charbuf)); ^ >>>>> lib/librte_vhost/fd_man.c: In function =E2=80=98fdset_pipe_notify=E2= =80=99: >>>>> lib/librte_vhost/fd_man.c:324:2: error: ignoring return value of >>>>> =E2=80=98write=E2=80=99, declared with attribute warn_unused_result >>>>> [-Werror=3Dunused-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=3D2" (enabled = by >>> default in Ubuntu [1]). >>> >>> To have the same behavior on Fedora you need to set -D_FORTIFY_SOURCE= =3D2 >>> by hand, for example with: >>> >>> # make EXTRA_CFLAGS=3D"-D_FORTIFY_SOURCE=3D2" >>> >>> 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=3D"-O2 -g -pipe -Werror=3Dformat-security >>> -Wp,-D_FORTIFY_SOURCE=3D2 -fexceptions -fstack-protector-strong >>> --param=3Dssp-buffer-size=3D4 -grecord-gcc-switches >>> -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=3Dgeneric >>> -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 >>> >