From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by dpdk.org (Postfix) with ESMTP id BC3DF2C8 for ; Wed, 23 May 2018 14:11:05 +0200 (CEST) Received: by mail-wr0-f194.google.com with SMTP id a15-v6so18784724wrm.0 for ; Wed, 23 May 2018 05:11:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=COPE5xptAq1aXMQBcB81hQyFVjwcB9sAfQNqZKtnE00=; b=bOahNJ0ChkowNOxxZYDdWqCh8xM2L+cvQo0J14RGHFMj5g8+da0jmkiWPiB8B3bkj5 o/+Otsbc/J0Bc+sABkpI48+eDtChTfZKMyikUiqkpSiMDcVslAEYc40am4BSP58XK0cQ 0tx+RMPZJ66m4Ybx4mXBSEO2zPA//oCScnou5TFV77uPGxYVOa2NfXrgUSzIbLScAs4U X6Ft5ZRigzztmDe5eVnq9pWursO3LhXBag71yngH5+nF9eCLR5MR5SO08/Ix/NK7FgcY rrKHr5mEMBqHE80q3ZbfbTpov69+eK0uVKBZNAKKVCLRtcqlciAbpsqjJ99+KK9KOAUj EvDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=COPE5xptAq1aXMQBcB81hQyFVjwcB9sAfQNqZKtnE00=; b=Tri1X5509+4epW3lEdqGdTi+BOGoddTHDtjs5P9W/CrxixCWjiU07YlcdTKdv5B4JS qFOiFH1VrXZZ3mGPhX5JpiQGxcM6l1ohYGTQSXLOh/WEgACgjuXwGsdro91HQLkptiDd qvQReyw7/cgD/fUa82q80Sg6B7dtWrHd0e3EZM6kTU3iLrqwF7teoh4ANejYHFwpmyj2 haniibrCz07jPo5D6pX9c8gxFRMQ6nzPv5XxF5m2TjLVofQFZ48NG1OtmMxxXVQjV3bT Zqgsdvxmwi9opXxvuZxE+va53PsAgKlJ4cSwYuYLEAersvR+FL6SVNYtdzynPVMwfgWq Pciw== X-Gm-Message-State: ALKqPwdGQlAPcyx/bWp8AAJqw1ywoDOg9q4xq6aHzSCBz9sz9AxRidBX nq1/RJ9Cow5vBfkK7PVpzvU= X-Google-Smtp-Source: AB8JxZqIIRN0YtfdEL0UvAnxtbcuK0+ArMVCNrUeznzrQ6UqCCyEz0TmwVzJ27o2ypyqn5mHtnzdnw== X-Received: by 2002:adf:ae02:: with SMTP id x2-v6mr2003796wrc.201.1527077465476; Wed, 23 May 2018 05:11:05 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id 90-v6sm18407440wrl.79.2018.05.23.05.11.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:11:04 -0700 (PDT) From: luca.boccassi@gmail.com To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Wed, 23 May 2018 13:09:41 +0100 Message-Id: <20180523121010.8385-30-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523121010.8385-1-luca.boccassi@gmail.com> References: <20180516101323.2234-2-luca.boccassi@gmail.com> <20180523121010.8385-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'mbuf: avoid implicit demotion in 64-bit arithmetic' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 May 2018 12:11:06 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/25/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From b4e46189cb23c80752ab197a466f8f7dc013f705 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 May 2018 09:24:32 +0800 Subject: [PATCH] mbuf: avoid implicit demotion in 64-bit arithmetic [ upstream commit ef5092e16b137fd5e23d19b4b17b32f330d4a4ad ] GCC 8.1 warned: In function 'rte_validate_tx_offload': rte_mbuf.h:2112:19: warning: conversion to 'uint64_t' {aka 'long unsigned int'} from 'int' may change the sign of the result [-Wsign-conversion] inner_l3_offset += m->outer_l2_len + m->outer_l3_len; ^~ uint64_t inner_l3_offset... /* fields for TX offloading of tunnels */ uint64_t outer_l3_len:9; /**< Outer L3 (IP) Hdr Length. */ uint64_t outer_l2_len:7; /**< Outer L2 (MAC) Hdr Length. */ We want to do the arithmetic entirely in uint64_t space, but with the +=, the rhs type becomes int since the bitfields will fit in int. Elaborate the artithmetic to be u64 = u64 + int + int, so the type of the result is correct to be stored in the u64. Fixes: 4fb7e803eb ("ethdev: add Tx preparation") Signed-off-by: Andy Green Acked-by: Bruce Richardson --- lib/librte_mbuf/rte_mbuf.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 741204193..38299992e 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -1890,7 +1890,11 @@ rte_validate_tx_offload(const struct rte_mbuf *m) return 0; if (ol_flags & PKT_TX_OUTER_IP_CKSUM) - inner_l3_offset += m->outer_l2_len + m->outer_l3_len; + /* NB: elaborating the addition like this instead of using + * += gives the result uint64_t type instead of int, + * avoiding compiler warnings on gcc 8.1 at least */ + inner_l3_offset = inner_l3_offset + m->outer_l2_len + + m->outer_l3_len; /* Headers are fragmented */ if (rte_pktmbuf_data_len(m) < inner_l3_offset + m->l3_len + m->l4_len) -- 2.14.2