From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 38A381BAAE for ; Thu, 10 May 2018 14:35:52 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id a137-v6so27269984wme.1 for ; Thu, 10 May 2018 05:35:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=pIy7m3Yq8nFBqmdj3r/sdJhQWgEbL9BIvHyVS3CrtXo=; b=Ib72VSGO8e0GIOIoRaJrycMposPcRIWEz2nHqYYaF52s2kp4u9eNBPHS/lf2oGAqRs eIvEzcJaO04Tv2ZXddPtp9+nHOel+F3Eq2vST72GHRgumiACIms8wCwRbRJ+PvpeOLeg sFQGxa6MU3UAUU0Xqg+iLU23FD6XkUgYQTRZicKcprLdl2EZF/Fe5KUd0Z7oc2GkYQGB TtCOBTHkG4xj5qMeb9/jWEJzDeKmdnmCiVpYW8oVOLLPhglR9IVEJahkXPcI9Wh5+NMX 1rtCMwu+HOdTxKTBaKvoKgRS7jxhJ8/2kmz6Xzk2HM3f9SFwGrF3GRYGUJ/I6MHg5+qn BUcg== X-Gm-Message-State: ALKqPwdGw/ebO1t3TCtT4FcaTgJDj03AbWDrF/glhJ4cjEqe05LS0sfS qhB1iUxVNbBShbiJLL3cUCkLpRdk X-Google-Smtp-Source: AB8JxZq/HshU5SW7bmvojCdEBrHU2pm57WWWifP2KA8OBOAc649+xOQfEm3gEnd9gcRyGm4nSmk1tA== X-Received: by 2002:a1c:b7d7:: with SMTP id h206-v6mr1230679wmf.2.1525955751781; Thu, 10 May 2018 05:35:51 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v15-v6sm657767wmf.47.2018.05.10.05.35.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 05:35:50 -0700 (PDT) Message-ID: <1525955749.23337.103.camel@debian.org> From: Luca Boccassi To: Andy Green , dev@dpdk.org Date: Thu, 10 May 2018 13:35:49 +0100 In-Reply-To: <86b6bbc1-6ce8-cd51-7f55-6ec967cff647@warmcat.com> References: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> <1525947662.23337.101.camel@debian.org> <86b6bbc1-6ce8-cd51-7f55-6ec967cff647@warmcat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v3 00/40] Fix build on gcc8 and various bugs 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, 10 May 2018 12:35:52 -0000 On Thu, 2018-05-10 at 20:23 +0800, Andy Green wrote: >=20 > On 05/10/2018 06:21 PM, Luca Boccassi wrote: > > On Thu, 2018-05-10 at 10:46 +0800, Andy Green wrote: > > > The following series gets current master able to build > > > itself, and allow lagopus to build against it, on Fedora 28 + > > > x86_64 using gcc 8.0.1. > > >=20 > > > The first 17 patches have already been through two spins and > > > this time are corrected for all the comment (thanks to > > > everybody who commented) since v2, and have tested-by / > > > acked-bys applied.=C2=A0=C2=A0The first workaround patch for the hash > > > function cast problem is dropped since something has already > > > been applied in master since yesterday to address it. > > >=20 > > > The additional 23 patches are fixes for problems found > > > actually trying to build lagopus using current master. > > > These are almost entirely related to signed / unsigned > > > or truncation without explicit casts inside dpdk > > > headers. > > >=20 > > > --- > > >=20 > > > Andy Green (40): > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/bus/pci: fix strncp= y dangerous code > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/bus/dpaa: fix incon= sistent struct alignment > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/axgbe: fix brok= en eeprom string comp > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp/nfpcore: fi= x strncpy misuse > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp/nfpcore: fi= x off-by-one and no NUL on > > > strncpy > > > use > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp: don't memc= py out of source range > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp: fix buffer= overflow in fw_name > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/qede: fix strnc= py constant and NUL > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/qede: fix broke= n strncpy > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/sfc: fix strncp= y length > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/sfc: fix strncp= y size and NUL > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/vdev: readlink = inputs cannot be aliased > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/vdev: fix 3 x s= trncpy misuse > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/test-pmd: can't find in= clude > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/proc-info: fix sprintf = overrun bug > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/test-bbdev: test-bbdev:= strcpy ok for allocated string > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/test-bbdev: strcpy ok f= or allocated string > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_common.h: cast gcc buil= tin result to avoid complaints > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_memcpy.h: explicit tmp = cast > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0lib/librte_eal/common/inclu= de/rte_lcore.h: explicit cast > > > for > > > signed change > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/lib/librte_eal/common/incl= ude/rte_random.h: stage cast > > > from > > > uint64_t to long > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_spinlock.h: stack decla= rations before code > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ring_generic.h: stack d= eclarations before code > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ring.h: remove signed t= ype flipflopping > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_dev.h: stack declaratio= n at top of own basic block > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: avoid truncatio= n warnings from inadvertant > > > int16_t > > > to int promotion > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit casts = for flipping between int16_t > > > and > > > uint16_t > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: make sure RTE_M= IN compares same types > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit cast r= estricting ptrdiff to uint16_t > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit cast f= or size_t to uint32_t > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit casts = to uint16_t to avoid truncation > > > warnings > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_byteorder.h: explicit c= ast for return promotion > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ether.h: explicit cast = avoiding truncation warning > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ether.h: stack vars dec= lared at top of function > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: fix sign and = scope of temp var > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: explicit cast= for return type > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: explicit cast= for truncation > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_hash_crc.h: stack vars = declared at top of function > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_hash_crc.h: explicit ca= sts for truncation > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_string_fns.h: explicit = cast for int return to size_t > >=20 > > Hi, > >=20 > > I've built-tested this series on Debian Stretch (gcc 6.3) and > > Debian > > Sid (gcc 8.1). > >=20 > > The series builds fine with the default config, but the bnx2x and > > mlx5 > > PMDs still have errors with gcc-8: >=20 > Yes I just built it with defconfig for x86_64 on Fedora 28 with > default=C2=A0 > tools and cleared out everything that came up. >=20 > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c: In function > > 'bnx2x_alloc_hsi_mem': > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:176:29: error: '%s' directive > > writing up to 31 bytes into a region of size between 15 and 25 [- > > Werror=3Dformat-overflow=3D] > > =C2=A0=C2=A0=C2=A0=C2=A0sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pci= e_device, msg, > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^~ > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:8874:7: > > =C2=A0=C2=A0=C2=A0=C2=A0if (bnx2x_dma_alloc(sc, sizeof(union > > bnx2x_host_hc_status_block), > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ~~ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&fp->sb_dma, buf, RTE_C= ACHE_LINE_SIZE) !=3D 0) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~ > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:176:3: note: 'sprintf' output > > between 10 and 66 bytes into a destination of size 32 > > =C2=A0=C2=A0=C2=A0=C2=A0sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pci= e_device, msg, > > =C2=A0=C2=A0=C2=A0=C2=A0^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_get_timer_cycles()); > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~~~~~~~~~ > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:173:29: error: '%s' directive > > writing up to 31 bytes into a region of size between 23 and 25 [- > > Werror=3Dformat-overflow=3D] > > =C2=A0=C2=A0=C2=A0=C2=A0sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_= FUNC(sc), msg, > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0^~ > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:8874:7: > > =C2=A0=C2=A0=C2=A0=C2=A0if (bnx2x_dma_alloc(sc, sizeof(union > > bnx2x_host_hc_status_block), > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ~~ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0&fp->sb_dma, buf, RTE_C= ACHE_LINE_SIZE) !=3D 0) { > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~~ > > /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:173:3: note: 'sprintf' output > > between 10 and 58 bytes into a destination of size 32 > > =C2=A0=C2=A0=C2=A0=C2=A0sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_= FUNC(sc), msg, > > =C2=A0=C2=A0=C2=A0=C2=A0^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~~~~~~~~~~~ > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_get_timer_cycles()); > >=20 > >=20 > > /tmp/dpdk/drivers/net/mlx5/mlx5.c: In function 'mlx5_pci_probe': > > /tmp/dpdk/drivers/net/mlx5/mlx5.c:920:13: error: 'vf' may be used > > uninitialized in this function [-Werror=3Dmaybe-uninitialized] > > =C2=A0=C2=A0=C2=A0=C2=A0config.vf =3D vf; > >=20 > > Hope this can be useful. >=20 > I think gcc 8.0.1 is capable to show that and I am willing to look > at=C2=A0 > them.=C2=A0=C2=A0But can you help me with exactly what changes you made s= o > these=C2=A0 > things built and made trouble, compared to the defconfig I have used=C2= =A0 > until now? If you already have a build directory you are using, the simplest way is to edit the .config file in there and change the following from =3Dn to =3Dy: CONFIG_RTE_LIBRTE_MLX4_PMD CONFIG_RTE_LIBRTE_MLX5_PMD CONFIG_RTE_LIBRTE_BNX2X_PMD Then rebuild and you should see the errors. --=20 Kind regards, Luca Boccassi