From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id 5B8601BA30 for ; Thu, 10 May 2018 12:21:04 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id a12-v6so1438657wrn.13 for ; Thu, 10 May 2018 03:21:04 -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:cc:date:in-reply-to :references:content-transfer-encoding:mime-version; bh=IWMemf1cLj/OBz05G9YXziHfs+lRKn8SRQccBA2KVmA=; b=Vv/mnvVkvLTFWRFlrrS6oFlpKHo/YuGw4oEXBEESXpI4M6uExkk0+vqki9+p+oOUFT iL9rDc64yiSyApAwYLkn+wGruSSAa9UM29pmD8mISOymEZYak4ORm2uYjalgyz9VMcMf cUA6REiI0ngwvJngz6YcOnKTiiqGRBiqt2yTwnpvzQxgnuhicT+WZrqPhQJKVHCtq01P bmHDkd5rffPeRmgS1EvcRgX66Rj624Xcp2u91KJpVhK8JKkXIn8atXR6gmCMnc2xh6Uq TNydy1GseP9kPLFmMyt9zLzYx6L4KC/aG/tmpJhxYDxnS77JyZSJvLotSJnN01DmEzpM S2Aw== X-Gm-Message-State: ALKqPweZe52BEAD+5sTmTyDzVYanK4QCJMEUxnU84NRjTXsaCeIrG5Xh R+7b868Ya6L15LHRli+LBguTTTZm X-Google-Smtp-Source: AB8JxZppwSao8aNuovm9RuMuOytitYaQOyALYhzMb4A+xUazNGelppmsv2H/uKiqwwwFYQwEi46LZA== X-Received: by 2002:adf:dc90:: with SMTP id r16-v6mr794815wrj.218.1525947663813; Thu, 10 May 2018 03:21:03 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v192-v6sm903539wme.45.2018.05.10.03.21.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 03:21:02 -0700 (PDT) Message-ID: <1525947662.23337.101.camel@debian.org> From: Luca Boccassi To: Andy Green , dev@dpdk.org Cc: john.mcnamara@intel.com Date: Thu, 10 May 2018 11:21:02 +0100 In-Reply-To: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> References: <152591991920.119328.14523975619615362920.stgit@localhost.localdomain> 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 10:21:04 -0000 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=A0drivers/bus/pci: fix strncpy dangerou= s code > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/bus/dpaa: fix inconsistent st= ruct alignment > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/axgbe: fix broken eeprom = string comp > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp/nfpcore: fix strncpy = misuse > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp/nfpcore: fix off-by-o= ne and no NUL on strncpy > use > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/nfp: don't memcpy out of = source range > =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=A0drivers/net/qede: fix strncpy constan= t and NUL > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/qede: fix broken strncpy > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/sfc: fix strncpy length > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/sfc: fix strncpy size and= NUL > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/vdev: readlink inputs can= not be aliased > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0drivers/net/vdev: fix 3 x strncpy mis= use > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/test-pmd: can't find include > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0app/proc-info: fix sprintf overrun bu= g > =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=A0app/test-bbdev: strcpy ok for allocat= ed string > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_common.h: cast gcc builtin result= to avoid complaints > =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=A0lib/librte_eal/common/include/rte_lco= re.h: explicit cast for > signed change > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/lib/librte_eal/common/include/rte_ra= ndom.h: stage cast from > uint64_t to long > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_spinlock.h: stack declarations be= fore code > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ring_generic.h: stack declaration= s before code > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ring.h: remove signed type flipfl= opping > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_dev.h: stack declaration at top o= f own basic block > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: avoid truncation warnings= from inadvertant int16_t > to int promotion > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit casts for flippi= ng between int16_t and > uint16_t > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: make sure RTE_MIN compare= s same types > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit cast restricting= ptrdiff to uint16_t > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_mbuf.h: explicit cast for size_t = to uint32_t > =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=A0rte_byteorder.h: explicit cast for re= turn promotion > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ether.h: explicit cast avoiding t= runcation warning > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ether.h: stack vars declared at t= op of function > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: fix sign and scope of t= emp var > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: explicit cast for retur= n type > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_ethdev.h: explicit cast for trunc= ation > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_hash_crc.h: stack vars declared a= t top of function > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_hash_crc.h: explicit casts for tr= uncation > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0rte_string_fns.h: explicit cast for i= nt return to size_t Hi, I've built-tested this series on Debian Stretch (gcc 6.3) and Debian Sid (gcc 8.1). The series builds fine with the default config, but the bnx2x and mlx5 PMDs still have errors with gcc-8: /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 u= p to 31 bytes into a region of size between 15 and 25 [-Werror=3Dformat-ove= rflow=3D] sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg, ^~ /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:8874:7: if (bnx2x_dma_alloc(sc, sizeof(union bnx2x_host_hc_status_block), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &fp->sb_dma, buf, RTE_CACHE_LINE_SIZE) !=3D 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:176:3: note: 'sprintf' output between 1= 0 and 66 bytes into a destination of size 32 sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, sc->pcie_device, msg, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rte_get_timer_cycles()); ~~~~~~~~~~~~~~~~~~~~~~~ /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:173:29: error: '%s' directive writing u= p to 31 bytes into a region of size between 23 and 25 [-Werror=3Dformat-ove= rflow=3D] sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg, ^~ /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:8874:7: if (bnx2x_dma_alloc(sc, sizeof(union bnx2x_host_hc_status_block), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ &fp->sb_dma, buf, RTE_CACHE_LINE_SIZE) !=3D 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /tmp/dpdk/drivers/net/bnx2x/bnx2x.c:173:3: note: 'sprintf' output between 1= 0 and 58 bytes into a destination of size 32 sprintf(mz_name, "bnx2x%d_%s_%" PRIx64, SC_ABS_FUNC(sc), msg, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rte_get_timer_cycles()); /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 uninitial= ized in this function [-Werror=3Dmaybe-uninitialized] config.vf =3D vf; Hope this can be useful. --=20 Kind regards, Luca Boccassi