From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f50.google.com (mail-pg0-f50.google.com [74.125.83.50]) by dpdk.org (Postfix) with ESMTP id 4B66C2BB1 for ; Thu, 2 Mar 2017 01:35:33 +0100 (CET) Received: by mail-pg0-f50.google.com with SMTP id b129so25670543pgc.2 for ; Wed, 01 Mar 2017 16:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+5iIV8W5wkGeA9f/UWQhw6aZibVaRZHOqQ2pM0YQezI=; b=jV1Lgb+aXCxuVZMBH+Czq4CombYKBFXANtUxD0SDcKFEUKxa25fSbYGsWWTM6czTX4 CPLs5J8V3srqAUCjwXbarTrYHQcFRqPnZy4ZzNAQHGbwBUyw89HJnBacMXBqy6PkUTWv OY6dEs7d2X+WTRr50oE+G+OtwaD2m6YDJEWG8g7csxvRYMgwsyxo1OV+g3O1axsdhKkC wQT2cabNmbN3boC3oPk7MhghZ7rcOkVZc41LWDeYBnmnrfsaLcu5M/2hzQInkyOCZyu1 SQwNix7vUJiCyk3fSq/cvnbYSPSMVyiYY6PrrSbYRRDJgkg2djupT889EqfA2BiO2n1o 3VAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+5iIV8W5wkGeA9f/UWQhw6aZibVaRZHOqQ2pM0YQezI=; b=EeZfo4rgjR5lBEssh+aeits3dmVEOfiWA6EnYr2FCoZkiv67QZKnKXPfqeHr4BfdyH fgB4e/X99q1fioIaVQsETl9b6+53/A8idhA30HhpPffm884yTwKJEbdUJiKu1eefZETQ ZBT5NVXo+W2ImsCO0vk00cQ8xs51qs52HgyerFBB5f4YvjWICwC4YQcOkOGlIpNIS3vc RHDLP0MGYEy9TDhV6+Hgg6IV/ZUrI8s2bed7iuL2lacvToALcDORHyKvGbzPj1x+HY2g Y+yvSS4DaUzEdPjO5/0gcU1gy6+2Cs3LyPEWpsJ4KWt4RIB/A1HY808KKm9WpCYXqYoA Ne0g== X-Gm-Message-State: AMke39kTWy+bFD7rXauHmiM5atTw9bshRAzpmOyx5e12GYP/6/b8mhMSmeeUIW+C7oxuAA== X-Received: by 10.99.1.8 with SMTP id 8mr8947378pgb.53.1488414932441; Wed, 01 Mar 2017 16:35:32 -0800 (PST) Received: from xeon-e3 (204-195-18-65.wavecable.com. [204.195.18.65]) by smtp.gmail.com with ESMTPSA id q73sm12715581pfa.129.2017.03.01.16.35.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 01 Mar 2017 16:35:32 -0800 (PST) Date: Wed, 1 Mar 2017 16:35:25 -0800 From: Stephen Hemminger To: Allain Legacy Cc: , , , , Message-ID: <20170301163525.2ab7f089@xeon-e3> In-Reply-To: <1488414008-162839-14-git-send-email-allain.legacy@windriver.com> References: <1488136143-116389-1-git-send-email-allain.legacy@windriver.com> <1488414008-162839-1-git-send-email-allain.legacy@windriver.com> <1488414008-162839-14-git-send-email-allain.legacy@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 13/16] net/avp: device statistics operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 00:35:33 -0000 On Wed, 1 Mar 2017 19:20:05 -0500 Allain Legacy wrote: > +static void > +avp_dev_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats) > +{ > + struct avp_dev *avp = AVP_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); > + unsigned int i; > + > + memset(stats, 0, sizeof(*stats)); Memset here is unnecessary since only caller is rte_eth_stats_get() which already did memset int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats) { struct rte_eth_dev *dev; RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL); dev = &rte_eth_devices[port_id]; memset(stats, 0, sizeof(*stats)); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP); stats->rx_nombuf = dev->data->rx_mbuf_alloc_failed; (*dev->dev_ops->stats_get)(dev, stats);