From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 435642BF3 for ; Wed, 23 May 2018 14:10:28 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id f6-v6so8319058wmc.4 for ; Wed, 23 May 2018 05:10:28 -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=027mWxIL10Dhf3AOctMMGRZVLZrLVZ93r/RhPHJkRHA=; b=kzzPHR4x+YfAFjYtNSQgN5QmWNLjLBxg4sD4MUQEcJMLKCjTzGPJUnF/eN1US5Rik4 CtbZTi5BeMXqR63nem9+iCD5sTO/ve+xqwfqFHPHHwAYIo+NkPqGpinwgb4VJGi3916u GjmRad5FD0Ju1Q0U/6jExE91DXibOMNh7fQxt5XctUPkA9O0G06zvFAC1FAxZGoy5LSU 8UNpQt3NG6aa6hRvlAg11XGB0CP/NtiX7yZ/NX4ju9Ij/hT6BPcKfLtVMQ/AIEsHeN81 21MGVbbwzCaJ/24+yFEwoH53OrMVstIu6VVGOB7kEemwmTLEy5BlXuhE3rBRP3bMQ2zo VPBA== 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=027mWxIL10Dhf3AOctMMGRZVLZrLVZ93r/RhPHJkRHA=; b=UheIbmfZYRYNR0xFLPbIe+j7m65nXLWn+C0rttTPEol5DPQQeDoAwb1mgr/lXHBIri dfX3VtKyWNM1mMb4WCsWer/3oTOK0xDtWqyKKVRrQnyOb1wAbjh/ecMmo7ALS9EDpEnj rGNUIb59vc9OepqE+Bxk3yOQTJkQj5Q4fvcCbOdz/89VTjdSsaxAkpwf9MgG0WMOeXN6 IpgfP3oOOZRB8EPQsoM26/L3RPLf58EbEtKYXwJN4twY9NzIs55JbXWViq6diqbL3RxM wW/Om3hyPwwxZkohUxW4ySOi7sUsLyEJUb8383wbrnXCCUfLr6emK7ZhfkRjhFy0OSCR olGA== X-Gm-Message-State: ALKqPweRkmy6+2TpEw0B4vonA8PCrpLSV/+9pMVrk9ZrSwFw9Dwa7w4M cOrXkbRsN8mDDshHiT2aIiTxtAPb X-Google-Smtp-Source: AB8JxZq/Evo3sql3d9/u5wM7w2nBVpHp9Z0P3JkEQacVxkSsuJw+rD7Z8XtymPTJa1J3mgoM+HpK9g== X-Received: by 2002:a1c:e906:: with SMTP id q6-v6mr1929827wmc.23.1527077427977; Wed, 23 May 2018 05:10:27 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id m134-v6sm2564914wmg.4.2018.05.23.05.10.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:10:27 -0700 (PDT) From: luca.boccassi@gmail.com To: Adrien Mazarguil Cc: Ferruh Yigit , dpdk stable Date: Wed, 23 May 2018 13:09:18 +0100 Message-Id: <20180523121010.8385-7-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 'net/mlx4: fix shifts of signed values in Tx' 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:10:28 -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 dc32ae8e71017a3d7a0fd0016fa02656668ac058 Mon Sep 17 00:00:00 2001 From: Adrien Mazarguil Date: Wed, 16 May 2018 18:20:54 +0200 Subject: [PATCH] net/mlx4: fix shifts of signed values in Tx [ upstream commit 911bbb0f7cae2c182471bebb4d72895083ce9fb9 ] This patch addresses the following issues reported by cppcheck: [drivers/net/mlx4/mlx4_rxtx.c:266]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour [drivers/net/mlx4/mlx4_rxtx.c:624]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour [drivers/net/mlx4/mlx4_txq.c:89]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour [drivers/net/mlx4/mlx4_txq.c:91]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour Fixes: 78e81a9844f8 ("net/mlx4: merge Tx queue rings management") Reported-by: Ferruh Yigit Signed-off-by: Adrien Mazarguil --- drivers/net/mlx4/mlx4_rxtx.c | 4 ++-- drivers/net/mlx4/mlx4_txq.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx4/mlx4_rxtx.c b/drivers/net/mlx4/mlx4_rxtx.c index 8ca8b77cc..0cff1067f 100644 --- a/drivers/net/mlx4/mlx4_rxtx.c +++ b/drivers/net/mlx4/mlx4_rxtx.c @@ -263,7 +263,7 @@ mlx4_txq_stamp_freed_wqe(struct mlx4_sq *sq, volatile uint32_t *start, } while (start != (volatile uint32_t *)sq->eob); start = (volatile uint32_t *)sq->buf; /* Flip invalid stamping ownership. */ - stamp ^= RTE_BE32(0x1 << MLX4_SQ_OWNER_BIT); + stamp ^= RTE_BE32(1u << MLX4_SQ_OWNER_BIT); sq->stamp = stamp; if (start == end) return size; @@ -639,7 +639,7 @@ mlx4_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) ctrl_next = (volatile struct mlx4_wqe_ctrl_seg *) ((volatile uint8_t *)ctrl_next - sq->size); /* Flip HW valid ownership. */ - sq->owner_opcode ^= 0x1 << MLX4_SQ_OWNER_BIT; + sq->owner_opcode ^= 1u << MLX4_SQ_OWNER_BIT; } /* * For raw Ethernet, the SOLICIT flag is used to indicate diff --git a/drivers/net/mlx4/mlx4_txq.c b/drivers/net/mlx4/mlx4_txq.c index 071b2d5d8..d1977a735 100644 --- a/drivers/net/mlx4/mlx4_txq.c +++ b/drivers/net/mlx4/mlx4_txq.c @@ -144,9 +144,9 @@ mlx4_txq_fill_dv_obj_info(struct txq *txq, struct mlx4dv_obj *mlxdv) uint32_t headroom_size = 2048 + (1 << dqp->sq.wqe_shift); /* Continuous headroom size bytes must always stay freed. */ sq->remain_size = sq->size - headroom_size; - sq->owner_opcode = MLX4_OPCODE_SEND | (0 << MLX4_SQ_OWNER_BIT); + sq->owner_opcode = MLX4_OPCODE_SEND | (0u << MLX4_SQ_OWNER_BIT); sq->stamp = rte_cpu_to_be_32(MLX4_SQ_STAMP_VAL | - (0 << MLX4_SQ_OWNER_BIT)); + (0u << MLX4_SQ_OWNER_BIT)); sq->db = dqp->sdb; sq->doorbell_qpn = dqp->doorbell_qpn; cq->buf = dcq->buf.buf; -- 2.14.2