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 C3B5428F3 for ; Wed, 23 May 2018 14:11:08 +0200 (CEST) Received: by mail-wm0-f65.google.com with SMTP id m129-v6so8497237wmb.3 for ; Wed, 23 May 2018 05:11:08 -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=In5SeRhRbk3zdSg86Fmm0PQhywxZ2HvRqegcqoS93j4=; b=T/iljACRjJhvJ4FVAzpg57uwv2nnQ8G1jd0XCgL6emD31+UhSxZyWvoZbam3+YGNtl FQ40GNO7/OTeDfmEVNmQsSDae1raTlTVCpNTSOJeuMIl866FLvYWMZvnlpVxG+arYxYv GUpNJLw6WY/4wm/upmhNUdcv91YG3dp46k9SL58HMw65gbBW/NSEa2X66vKB5fhAPxOo rYy+tV0q8EsqCMlnSHfqXcWp1ipL5KM5PoZ7j2oV3VXo0yEQ6a8/PqaZ8SrJTHuhBSKe CuU5RQKYMH37tQtxJ+EIKViDlVPjydJYnzj2ilpfPvr2/xNMsWBIAJPf+ss+Ij8kTXk9 MCNA== 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=In5SeRhRbk3zdSg86Fmm0PQhywxZ2HvRqegcqoS93j4=; b=nnf2Nb8tnoJ4qWWQmlYtY+z6q6Qo5mPv2eTb9gHKBLinjTUbOq+dYv5cfDwWYxVlPe gr6AcBQNfpuC2LMzg8eEpPtzTttQkpRi5uzj+mcBZz3TcxdMIc94IfS2bQdwPsi406BT TLi80QeUplo/3WrZ00h07QQ10SPstYu8NFH7WZQu/H+EioL3vGFI2ZKmVZxYHpm4KI6T 2jbyyCt0IOKhFBa2mDUXP4h5VrSDHWJ6J8EpLueF8cImulUdw0mRNtfdyqUAgFkSXNgl EIeGbEO7loMmo4jIDof7S5gbevaHS/lj7oeX1k9245zZqcNOPZqwOMYdGl7wyp0Xxius XUVw== X-Gm-Message-State: ALKqPwfo+D3VwVDl2pdpUOEKUTGQVS1jIFGXKlPFGK5fO+a6ebL3zAcF QiK9yDThWdsPvI6uUW2SCZM= X-Google-Smtp-Source: AB8JxZpJ1glMdD+kEsS2ypEotl4UyJH7PtYiHwVjm7g7fHzJUPrcSIx3tmFCGGXDMeYl46kDsxGobg== X-Received: by 2002:a1c:1bcc:: with SMTP id b195-v6mr3845355wmb.63.1527077468449; Wed, 23 May 2018 05:11:08 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id h10-v6sm34286975wrf.83.2018.05.23.05.11.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 May 2018 05:11:07 -0700 (PDT) From: luca.boccassi@gmail.com To: Andy Green Cc: Bruce Richardson , dpdk stable Date: Wed, 23 May 2018 13:09:43 +0100 Message-Id: <20180523121010.8385-32-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 'ethdev: fix type and scope of variables in Rx burst' 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:08 -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 c09ee80e3258d36d8ac4304003f4c101ad73d9ad 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 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 877c13cd2..822af90de 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -3624,6 +3624,7 @@ rte_eth_rx_burst(uint16_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); @@ -3634,13 +3635,14 @@ rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id, return 0; } #endif - int16_t nb_rx = (*dev->rx_pkt_burst)(dev->data->rx_queues[queue_id], - rx_pkts, nb_pkts); + 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