From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 7BBA91B1B4 for ; Wed, 24 Jan 2018 16:37:07 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 2B8A622308; Wed, 24 Jan 2018 10:37:07 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:37:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=2igoRnwhjEyaShCdr TYQ4ii52zuONl6jh0bM7XVsNHI=; b=hKG4de6zX8CkynY6pkERNM/2YEhk1pwcz l7thxQ64Nj0qlwjQ1LnHGjAQdcLxnC/tyHdMMYh73T5TQFwpiaZq8bq+evnGxQST lo0vhw4d5eSobEEmNu+lxOgiQejiww/ZX+fnyNyL52mmU06/2ZTImQXAbPlMdyfe 7aVyKXslybeJVgMjwb1qYe+SuQg95ovkTySCbOJdTEL1SxJQcEyckwxt/iZuSQOw Hqsq9Pued2EcsPSjvBp3V4VYwrk18CF2dMbIJnu4IJF9zaeBZ5B+e3Wg030/7DC1 J/PTkaJfGHbyw57ECtkxVZv1zRM33jHhCUuwiJRYGdl/pkWwF/caA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=2igoRnwhjEyaShCdrTYQ4ii52zuONl6jh0bM7XVsNHI=; b=WGft81DY y8ENswsefTgheMCFCtX9ktXMFDYJLj2EiDVHR6WbnQIKTZBdZyGCEK02a9WOijcs QcDfbhFYtbP1WLc77N2hsLk5EE1TUft39jkGkX+bzNNmPInCXeQvK9kBuhihYEgL Ia6lDlghGvHnbIDjM+IHcrxIBEwkdjL6sZhzUPrkZQWGKSXsFwkjscBEY2DK3LJj iL1L6Zz+ErDMFy2f6hPnetN+UmUKR8tZ7h4eBU6gBbfXkrlksohsZhEFoFnjsl7U QbC5b409M3fO8KG1gV8dzGEEulrIUIp2nWobvo87P9bEtjZcPhZADKSqd6VCHiey 8adph6QDHhbSdg== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id 69E397E3D4; Wed, 24 Jan 2018 10:37:04 -0500 (EST) From: Yuanhan Liu To: Thierry Herbelot Cc: Nelio Laranjeiro , dpdk stable Date: Wed, 24 Jan 2018 23:31:37 +0800 Message-Id: <1516808026-25523-29-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/mlx5: cleanup allocation of ethtool stats' has been queued to LTS release 17.11.1 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, 24 Jan 2018 15:37:07 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.1 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/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From c6a459eb512872e357fb3ad82f4e02b06d75a6c5 Mon Sep 17 00:00:00 2001 From: Thierry Herbelot Date: Fri, 17 Nov 2017 14:51:34 +0100 Subject: [PATCH] net/mlx5: cleanup allocation of ethtool stats [ upstream commit 25b73ba6f3ea0894bf3cfc64e999f71a7e4f6787 ] Simplify the computation for the needed size: - exact size for the structure header, - exact size for a number of 64-bit counters. Fixes: a4193ae3bc4f ("net/mlx5: support extended statistics") Signed-off-by: Thierry Herbelot Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_stats.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_stats.c b/drivers/net/mlx5/mlx5_stats.c index 5e225d3..2427585 100644 --- a/drivers/net/mlx5/mlx5_stats.c +++ b/drivers/net/mlx5/mlx5_stats.c @@ -143,11 +143,9 @@ priv_read_dev_counters(struct priv *priv, uint64_t *stats) struct mlx5_xstats_ctrl *xstats_ctrl = &priv->xstats_ctrl; unsigned int i; struct ifreq ifr; - unsigned int stats_sz = (xstats_ctrl->stats_n * sizeof(uint64_t)) + - sizeof(struct ethtool_stats); - struct ethtool_stats et_stats[(stats_sz + ( - sizeof(struct ethtool_stats) - 1)) / - sizeof(struct ethtool_stats)]; + unsigned int stats_sz = xstats_ctrl->stats_n * sizeof(uint64_t); + unsigned char et_stat_buf[sizeof(struct ethtool_stats) + stats_sz]; + struct ethtool_stats *et_stats = (struct ethtool_stats *)et_stat_buf; et_stats->cmd = ETHTOOL_GSTATS; et_stats->n_stats = xstats_ctrl->stats_n; -- 2.7.4