From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 4E4501B294 for ; Fri, 26 Jan 2018 14:15:51 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id v71so21174001wmv.2 for ; Fri, 26 Jan 2018 05:15:51 -0800 (PST) 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=UNepjuOMQ2VYLc0qrMMbGdLXTAWyZOEQicQdDhIQuyQ=; b=IDPmMTU1pP/Mweq3Vhx6w+stMieCXxEbytK+HKGLCoeGzMNHgIR5QSZtTAALxsNdnX tTSZyeTaFaq3gyc7Jlq8GjQAdGEeM54NOTaol7CpfrJxbxKSeCWuyTe+gNn74K14vpc8 diHcPhdExcexwJ5WNM6XjFUA3zldy99xhBssbokcYHu0pYe5PcW8aVpAU5eqstWc9dVZ SnaTLkidpFBsRoUZimyNRq3yJQ7kFt6cyq0bh1RZyPSjoyihPff642IMN3uixAk1Iau9 w8yeprkHJxYBaE3zXrInm44hnNL8IUBBY7P0lfPgAb5cH5wGFWUSTAkfEbvNUkDI2RQj EFIA== 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=UNepjuOMQ2VYLc0qrMMbGdLXTAWyZOEQicQdDhIQuyQ=; b=X+ROX+tUgAPSAcVv31fycEOOGpSoZfrab+zTLjK4mJkJ0yMv7ooqoaeI4ZkdWzlt0r 0UTTmTHeE1hs1dzoAyQupA/SDPR63yqEbgs66KlNtHkygrC47Wk0XUxvMObOkIyj9krm OMgdbrs/01q0Qet5N7/wxJqW211CU6sJMhY5JeOtnrwIHG8khjFV+fNV4ZlT/1rwzM/i hbW/7k7SsVlH+sX6vSjp7/5wNGKhBWmMp1K3j4besS4h8Bl5Z6Jv8yV76W6toNo15sbE cYKr7EMsOLsDUUet7edAo4O+H0SGFjU6NipVGaAlCjKPCQlcaZChSnKg4HuYQsrtGPpV 7ElQ== X-Gm-Message-State: AKwxytfdECuuaVIRvB24bSg+Cr/JNbt7FMNb0KnaBC+QEZvF1BAZxA2D SKgZZf4vxJRy6wro0l8YbMU= X-Google-Smtp-Source: AH8x224ELJqdt/Bl/gy3y7CvkNehRfdj8kmuNJ9JWsTa4GMz/ZKE9TxVhOm2GW0l5CnP7+x0A/Qu6Q== X-Received: by 10.28.239.19 with SMTP id n19mr10438057wmh.20.1516972551061; Fri, 26 Jan 2018 05:15:51 -0800 (PST) Received: from localhost ([2a00:23c5:bef3:400:9531:588b:44ae:bec4]) by smtp.gmail.com with ESMTPSA id y23sm9553454wrc.24.2018.01.26.05.15.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jan 2018 05:15:50 -0800 (PST) From: luca.boccassi@gmail.com To: Didier Pallard Cc: Olivier Matz , Maxime Coquelin , Yuanhan Liu , dpdk stable Date: Fri, 26 Jan 2018 13:13:01 +0000 Message-Id: <20180126131332.15346-31-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180126131332.15346-1-luca.boccassi@gmail.com> References: <20180126131332.15346-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/virtio: fix incorrect cast' has been queued to LTS release 16.11.5 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: Fri, 26 Jan 2018 13:15:51 -0000 Hi, FYI, your patch has been queued to LTS release 16.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 01/28/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 08991e032b922c2bdba5f48c45f37e8dc91684c1 Mon Sep 17 00:00:00 2001 From: Didier Pallard Date: Thu, 14 Dec 2017 15:33:43 +0100 Subject: [PATCH] net/virtio: fix incorrect cast [ upstream commit 43ec842ca45d1b090998aff20c64eb92cc8bdf0b ] The rx_queues and tx_queues fields of the data structure points to a struct virtnet_rx or virtnet_tx. Casting it to a virtqueue is an error. It does not trigger any bug because pointer is not dereferenced inside the function, but it can become a bug if this code is copy/pasted and vq is dereferenced. Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue") Signed-off-by: Didier Pallard Signed-off-by: Olivier Matz Reviewed-by: Maxime Coquelin Acked-by: Yuanhan Liu --- drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 8592485d7..3abaeabb2 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -847,7 +847,7 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, /* Note: limit checked in rte_eth_xstats_names() */ for (i = 0; i < dev->data->nb_rx_queues; i++) { - struct virtqueue *rxvq = dev->data->rx_queues[i]; + struct virtnet_rx *rxvq = dev->data->rx_queues[i]; if (rxvq == NULL) continue; for (t = 0; t < VIRTIO_NB_RXQ_XSTATS; t++) { @@ -860,7 +860,7 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, } for (i = 0; i < dev->data->nb_tx_queues; i++) { - struct virtqueue *txvq = dev->data->tx_queues[i]; + struct virtnet_tx *txvq = dev->data->tx_queues[i]; if (txvq == NULL) continue; for (t = 0; t < VIRTIO_NB_TXQ_XSTATS; t++) { -- 2.14.2