From patchwork Wed Nov 18 09:34:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 56924 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2456333lbb; Wed, 18 Nov 2015 01:37:36 -0800 (PST) X-Received: by 10.140.94.201 with SMTP id g67mr420256qge.43.1447839456076; Wed, 18 Nov 2015 01:37:36 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id h88si1561970qgf.113.2015.11.18.01.37.35; Wed, 18 Nov 2015 01:37:36 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id A7EAC61D85; Wed, 18 Nov 2015 09:37:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 2C0C661E6B; Wed, 18 Nov 2015 09:34:56 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 9B30961DAF; Wed, 18 Nov 2015 09:34:39 +0000 (UTC) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by lists.linaro.org (Postfix) with ESMTPS id 1170161D82 for ; Wed, 18 Nov 2015 09:34:37 +0000 (UTC) Received: by lbbkw15 with SMTP id kw15so21019603lbb.0 for ; Wed, 18 Nov 2015 01:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aG4xSPtKTYv/KuFmKzlRXu93pKiuIsqpqzJxDv91GJ8=; b=HxgV5vlaUCuEM2BgAEklcN8aHt9mS79EOjHiKLgCjm2qWhj4L60PiEDIGN0JfIFnHV PBxmSewcmh62kq3nYK1UVbev712IVJpT7uXABEzAaW33JV0Fag7xEPvU6PCpPO5CKE66 ekzzJY2+sPVSMJGWZdqniGhkMMPOj5NTlYk8va08XLWnO5lNc8mlsG4fZTyXNyfrSJkz mFiY6PW9Zix/Upsiz6i98nJymQ0QP/aswZeKhC8LLAOZzWgOJGsMP1WdzARL1e0cC/gj uWeLCaeunf8s6oL7ouakVDHJ7Ry68pGpnKPMbYa+PcXiOCx6Bs7QyYYnTjMUkDPrk9BZ E18Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aG4xSPtKTYv/KuFmKzlRXu93pKiuIsqpqzJxDv91GJ8=; b=T7nFKxL7CHgYNK2ND8gmzAjknv4tH2fpXID/c1mXm5Nybt4oV11TB2r3uYsNM8/5pH ZrDhqkWllpxrDSYHqT1Gqjxx4x7dU6DeeQ27FhTEOFXXtKeHA/s4USfP0Pm3Wwf2EBxD vMNxFD7hQ/zkNii1fdM+bpQmuMykRnvdDDMMy1dKVFf9yTDli8Dt3SJXIglp/2HuoqdZ qpEGgq49hGzNM2l90RbdmKD7toSsoqTFiB/esxnzDs9B+8yQbX5uHl4TupUApxZifB03 n1K0v3o3+EKt00Oy1JeXX4vp9RLe19IywSsCLW6K0c/y5iIO6o5orb+h/U/d4vL9V2la vJ2A== X-Gm-Message-State: ALoCoQnftMAWjGFI+KrxO2NzYg1wAEg4oVvpK5lGbfliCDIw2CZ1rRFMG8Oyyiy4uQ+WUFg32fz2 X-Received: by 10.112.135.136 with SMTP id ps8mr200698lbb.38.1447839275754; Wed, 18 Nov 2015 01:34:35 -0800 (PST) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id o199sm297894lfa.12.2015.11.18.01.34.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Nov 2015 01:34:34 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 18 Nov 2015 12:34:27 +0300 Message-Id: <1447839268-20423-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447839268-20423-1-git-send-email-maxim.uvarov@linaro.org> References: <1447839268-20423-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2 4/5] linux-generic: pktio netmap: implement statistics counters X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Signed-off-by: Maxim Uvarov --- platform/linux-generic/pktio/netmap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c index 794c82e..f9359ba 100644 --- a/platform/linux-generic/pktio/netmap.c +++ b/platform/linux-generic/pktio/netmap.c @@ -168,6 +168,12 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, pktio_entry_t *pktio_entry, if (err) goto error; + /* netmap uses only ethtool to get statistics counters */ + pktio_entry->s.use_ethtool; + err = sock_stats_reset(pktio_entry); + if (err != 0) + goto error; + /* Wait for the link to come up */ for (i = 0; i < NM_OPEN_RETRIES; i++) { err = netmap_do_ioctl(pktio_entry, SIOCETHTOOL, ETHTOOL_GLINK); @@ -313,6 +319,8 @@ const pktio_if_ops_t netmap_pktio_ops = { .close = netmap_close, .start = NULL, .stop = NULL, + .stats = sock_stats, + .stats_reset = sock_stats_reset, .recv = netmap_recv, .send = netmap_send, .mtu_get = netmap_mtu_get,