From patchwork Wed Nov 18 09:41:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 56930 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp2459608lbb; Wed, 18 Nov 2015 01:45:48 -0800 (PST) X-Received: by 10.55.76.73 with SMTP id z70mr468612qka.38.1447839948674; Wed, 18 Nov 2015 01:45:48 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y128si1598851qka.62.2015.11.18.01.45.47; Wed, 18 Nov 2015 01:45:48 -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 92C4D61D8F; Wed, 18 Nov 2015 09:45:47 +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_H2,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 249D661E70; Wed, 18 Nov 2015 09:42:09 +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 B2C5F61EB1; Wed, 18 Nov 2015 09:42:05 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by lists.linaro.org (Postfix) with ESMTPS id DB99F61D95 for ; Wed, 18 Nov 2015 09:41:45 +0000 (UTC) Received: by lbblt2 with SMTP id lt2so21098282lbb.3 for ; Wed, 18 Nov 2015 01:41:44 -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=dYDCh1mvvQlu67UFy1cdnRddNrFR4Xa+lgl+evsxsU8=; b=XdtgBoFZKPCJwISDcot5e+V4a8PfFP30H1usjLHF4uZ4zrVWkD79zS6jgmXyh/j2yI CPC66PPJq9rdhTMFxP5Mw0z5Y0RZ1gw+ZfhJwkUo/WAvMfm9B5UXLE8muV2frP9YqFNS VQ0aWOJgZt1W3eT9mggDyXioRklh9ig14L8Ozuyi0J2ZA91tSn70eArVjBJ6zV5OXtFk drYjxGB1FP3GJ3Z3+tkb2/+vLPP6IoN4rQslDDO+FEoU0n7sjq9JkRBtFDl+WC8IpgCP 9gg8eyGBhrdXqlFDDtyXZJ40OhkAqyYV4UDPkHZc6np2pFDmXWTkGwE9z7KFKLucmPJK bwWw== 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=dYDCh1mvvQlu67UFy1cdnRddNrFR4Xa+lgl+evsxsU8=; b=WHnHSflGxrwTcTd0kEodL5pMCykKklLTqjoSAJsrhp7sUXnB57UWbDlgGGq5WR59Xc Cnevq5cqwXH/7DUb5zrG8OBRYuUrjDvBjUDBYn+QhYORWbPFKtI+2q3IIPsH8jSm3JSs FLT8CCgJVdlQpr6ACMw1qkufDZOe+2l2hNn3PBkieUnT+/aRsn2Y7hRNllwbEgVOu7Vp mESCJDZoI2tr76YadKPP23qUsfBVxpZ5HqNrMzlKgUCdy+i37hku3robAXhRpK19fOnS 6rvNXQSOPqho1ZuYw+6pexYbNa73poNHVg0ZpHvS7UKyBqEcl1qmDm3eS6wxcnixr3Ki nSKg== X-Gm-Message-State: ALoCoQmIWkWUUqUGtTKVTjaeIcK4USCUF+Gyk9konvRsUETBGKuDG27l4WrFjalSDXCDftXmdn2N X-Received: by 10.112.198.106 with SMTP id jb10mr227661lbc.111.1447839704775; Wed, 18 Nov 2015 01:41:44 -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 g80sm296088lfg.44.2015.11.18.01.41.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Nov 2015 01:41:44 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 18 Nov 2015 12:41:36 +0300 Message-Id: <1447839697-21140-5-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447839697-21140-1-git-send-email-maxim.uvarov@linaro.org> References: <1447839697-21140-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv3 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..920c365 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 = 1; + 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,