From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 52D7C2C8 for ; Wed, 23 May 2018 16:34:18 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id 94-v6so26911632wrf.5 for ; Wed, 23 May 2018 07:34:18 -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=AcLAUx3knZtUGcfABFTOeoZojL0f98K4Ulb/DwaDJ9g=; b=fVFhFx9cBDJxt1rVw0r8x9TLSQvNM75MeiIXIiGP0bJz4GQFjz9S+RZoewjZTXvEV0 NDQYZix+hWDbILDtr3l527+b2yUpos9fCPQzwZBn1fToBC9ucyPzsNoL72Av39Td8xl/ Q95m/KutKVjv439gRhPF0SoCaM648aFWi08+VBsoVmHPjsUR2x+i/dZoROg7Y42snkwb 6gF0ffkYh875ipm7cI8N3+3jM0xZSOzK/DOp6zfMECW3RDl+Bug5D1b7ChUrcWZJcjSN bd0wimuLxpTfr0o7OAz06wrS0UgNH8mZi+WR8dAiroiwSr6Ea431EF/j8YivdG/TjjJQ gljg== 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=AcLAUx3knZtUGcfABFTOeoZojL0f98K4Ulb/DwaDJ9g=; b=Wx5z9hl5hqWtqpQseClhI7ms/SLdsIFRm1wDZ4FSoKaSQ1GdUjIXEIhCiKXnAOi0KY b/OxIjsYxMkVFGdsjwDS/wU6nt42YczTG4OPhXBBw/widC7qdB7OXnghQrril5NIY6+b 3SiXywK35orNpn6pubC/5/oqhLqzWNf7pt11qIgLPuiR9FCjykal5V+9zlsFPvsgFQrx e4y6i2kgZyLX01cfLCzE3+IzCa4WWVnxVz3DvqYuYiyRIhveRFua+7dyaOLWJ3nVFKcB ZXw7DY5OVcK7IH5gto51NaKmb0EkEHZzIlq1PSvNJBTSFCaGAUNbJCQr8CnTuZzkCrF/ Q/0g== X-Gm-Message-State: ALKqPwd/onV4oFIijWK9niIwYNq6xHQM9UVCTZ1XJ1m0uccGiNFv29Tg wOrST6XlvhMeOg7GSTctKl0= X-Google-Smtp-Source: AB8JxZrnHZcGhS8Xq1uTfrY3g3K4EGbykwW7hybKFLFNa8GLaLxUYpzZle9I7cNBv9kpONgUREArrA== X-Received: by 2002:adf:aa08:: with SMTP id p8-v6mr2533381wrd.140.1527086058054; Wed, 23 May 2018 07:34:18 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id 4-v6sm3928563wmg.8.2018.05.23.07.34.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 07:34:17 -0700 (PDT) From: luca.boccassi@gmail.com To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Wed, 23 May 2018 15:33:38 +0100 Message-Id: <20180523143344.16885-17-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180523143344.16885-1-luca.boccassi@gmail.com> References: <20180516100945.4449-2-luca.boccassi@gmail.com> <20180523143344.16885-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'ethdev: fix type and scope of variables in Rx burst' has been queued to LTS release 16.11.7 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 14:34:18 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.7 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 2042157390706bd7f25407f267fa0422b0bb5527 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 22 May 2018 09:24:47 +0800 Subject: [PATCH] ethdev: fix type and scope of variables in Rx burst [ upstream commit 3291abb5a2a5f24c109ab74e6aad0545927333a7 ] GCC 8.1 warned: In function 'rte_eth_rx_burst': rte_ethdev.h:3836:18: warning: conversion to 'int16_t' {aka 'short int'} from 'uint16_t' {aka 'short unsigned int'} may change the sign of the result [-Wsign-conversion] int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], ^ rte_ethdev.h:3844:50: warning: conversion to 'uint16_t' {aka 'short unsigned int'} from 'int16_t' {aka 'short int'} may change the sign of the result [-Wsign-conversion] nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx, ^~~~~ rte_ethdev.h:3844:12: warning: conversion to 'int16_t' {aka 'short int'} from 'uint16_t' {aka 'short unsigned int'} may change the sign of the result [-Wsign-conversion] nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx, ^~ rte_ethdev.h:3851:9: warning: conversion to 'uint16_t' {aka 'short unsigned int'} from 'int16_t' {aka 'short int'} may change the sign of the result [-Wsign-conversion] return nb_rx; ^~~~~ The second part of the patch is solved by its own basic block because it is inside a preprocessor conditional. Bringing the declaration of the var to the top of the function would require that also being given its own preprocessor conditional, or a (void)var to avoid an unused var warning. The basic block is no worse than those imho. Fixes: 467465d86df1 ("ethdev: add packet count parameter to Rx callback") Fixes: 4dc294158cac ("ethdev: support optional Rx and Tx callbacks") Signed-off-by: Andy Green Acked-by: Bruce Richardson --- lib/librte_ether/rte_ethdev.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index d14d8375d..da33b9d50 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -2646,6 +2646,7 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, struct rte_mbuf **rx_pkts, const uint16_t nb_pkts) { struct rte_eth_dev *dev = &rte_eth_devices[port_id]; + uint16_t nb_rx; #ifdef RTE_LIBRTE_ETHDEV_DEBUG RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0); @@ -2656,13 +2657,14 @@ rte_eth_rx_burst(uint8_t port_id, uint16_t queue_id, return 0; } #endif - int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], + nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], rx_pkts, nb_pkts); #ifdef RTE_ETHDEV_RXTX_CALLBACKS - struct rte_eth_rxtx_callback *cb = dev->post_rx_burst_cbs[queue_id]; + if (unlikely(dev->post_rx_burst_cbs[queue_id] != NULL)) { + struct rte_eth_rxtx_callback *cb = + dev->post_rx_burst_cbs[queue_id]; - if (unlikely(cb != NULL)) { do { nb_rx = cb->fn.rx(port_id, queue_id, rx_pkts, nb_rx, nb_pkts, cb->param); -- 2.14.2