From patchwork Wed Aug 19 12:22:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 52542 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 3AA6822DB1 for ; Wed, 19 Aug 2015 12:23:19 +0000 (UTC) Received: by wilj18 with SMTP id j18sf2143299wil.0 for ; Wed, 19 Aug 2015 05:23:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=DOSfrMTGiGtXZICk8dGShQOtAQX/WEP8DzGtJ9FNoac=; b=ODvtlbJBwINu7N64xXjqLZciXxFzlC+lo00r7ZZ15YY/LbKy6h/AcmigDadJ2A7shB GHPghyd8BhucXHbU8+L+dqB/Y8vdtnO96AcdbDSAirm5xsA0x99XSNvRDFe5Zq7YfyLg DyVa0m2MsgWp8lmkdmz68Y8zWoxJ0zShYK+v9BnOdTnmZnHw8bg+aOxsOtHf9JQnQDzj YCTHBly6Kup9buCT1cI4ncgZ0ZHZ/gPp5CIb58kQra43DUyYS75TewpxwIUNogamQ8xB NdadS5eeeaXMJjN9dAIREilCgVuKTo8HXdEBxQu5TBBaWRXoF1n/wsVh+X7uMGmZ2IIa lrmg== X-Gm-Message-State: ALoCoQkBO1Yv5x347oAZiMwyBwRL/3XAUomqZzGMIsm0h9PykDi7Dh2ba6EXXXWVriS8BBWl8rbY X-Received: by 10.180.205.198 with SMTP id li6mr401403wic.5.1439986998481; Wed, 19 Aug 2015 05:23:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.139 with SMTP id o11ls20059lal.80.gmail; Wed, 19 Aug 2015 05:23:18 -0700 (PDT) X-Received: by 10.112.163.72 with SMTP id yg8mr202141lbb.82.1439986998307; Wed, 19 Aug 2015 05:23:18 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id ej7si382628lad.78.2015.08.19.05.23.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Aug 2015 05:23:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lagz9 with SMTP id z9so1787519lag.3 for ; Wed, 19 Aug 2015 05:23:17 -0700 (PDT) X-Received: by 10.112.67.65 with SMTP id l1mr11029525lbt.86.1439986997732; Wed, 19 Aug 2015 05:23:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.162.200 with SMTP id yc8csp335308lbb; Wed, 19 Aug 2015 05:23:16 -0700 (PDT) X-Received: by 10.55.26.135 with SMTP id l7mr22009639qkh.14.1439986996267; Wed, 19 Aug 2015 05:23:16 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id y15si733910qky.100.2015.08.19.05.23.15; Wed, 19 Aug 2015 05:23:16 -0700 (PDT) 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; Received: by lists.linaro.org (Postfix, from userid 109) id 4E0EF61E81; Wed, 19 Aug 2015 12:23:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from ip-10-142-244-252.ec2.internal (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 142F161E59; Wed, 19 Aug 2015 12:23:11 +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 7B0FA61E6E; Wed, 19 Aug 2015 12:23:08 +0000 (UTC) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by lists.linaro.org (Postfix) with ESMTPS id 7419661E58 for ; Wed, 19 Aug 2015 12:23:07 +0000 (UTC) Received: by wicne3 with SMTP id ne3so125424918wic.1 for ; Wed, 19 Aug 2015 05:23:06 -0700 (PDT) X-Received: by 10.194.172.130 with SMTP id bc2mr24402807wjc.85.1439986986592; Wed, 19 Aug 2015 05:23:06 -0700 (PDT) Received: from localhost.localdomain ([87.120.178.39]) by smtp.gmail.com with ESMTPSA id pg5sm818248wjb.21.2015.08.19.05.23.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Aug 2015 05:23:06 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Wed, 19 Aug 2015 15:22:59 +0300 Message-Id: <1439986979-32225-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH] api: define pktio statistics api X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Signed-off-by: Maxim Uvarov --- include/odp/api/packet_io_stats.h | 77 ++++++++++++++++++++++++++ platform/linux-generic/include/odp/packet_io.h | 1 + 2 files changed, 78 insertions(+) create mode 100644 include/odp/api/packet_io_stats.h diff --git a/include/odp/api/packet_io_stats.h b/include/odp/api/packet_io_stats.h new file mode 100644 index 0000000..731a96f --- /dev/null +++ b/include/odp/api/packet_io_stats.h @@ -0,0 +1,77 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP Packet IO + */ + +#ifndef ODP_API_PACKET_IO_STATS_H_ +#define ODP_API_PACKET_IO_STATS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @defgroup odp_packet_io ODP PACKET IO + * @{ + */ + +/** + * Packet IO statistics + * + */ +typedef struct odp_pktio_stats_t { + uint64_t collisions; /**< number of collisions */ + uint64_t multicast; /**< multicast packets received */ + + uint64_t rx_bytes; /**< total bytes received */ + uint64_t rx_crc_errors; /**< received packets with crc error */ + uint64_t rx_dropped; /**< no space in buffers */ + uint64_t rx_errors; /**< bad packets received */ + uint64_t rx_fifo_errors; /**< recv'r fifo overrun */ + uint64_t rx_frame_errors; /**< recv'd frame alignment error */ + uint64_t rx_length_errors; /**< bad packets length */ + uint64_t rx_missed_errors; /**< receiver missed packet */ + uint64_t rx_over_errors; /**< receiver ring buff overflow */ + uint64_t rx_packets; /**< total packets received */ + + uint64_t tx_aborted_errors; /**< packets aborted during + transmission by a network device (e.g: + because of a medium collision) */ + uint64_t tx_bytes; /**< total bytes transmitted */ + uint64_t tx_carrier_errors; /**< not transmitted packets because of + carrier errors (e.g: physical link down) */ + uint64_t tx_dropped; /**< no resources to transmit packet*/ + uint64_t tx_errors; /**< packets transmit problems */ + uint64_t tx_fifo_errors; /**< packets transmit FIFO errors */ + uint64_t tx_heartbeat_errors; /**< packets transmitted that have been + reported as heartbeat errors */ + uint64_t tx_packets; /**< total packets transmitted */ + uint64_t tx_window_errors; /**< number of packets not successfully + transmitted due to a window collision.*/ +} odp_pktio_stats_t; + +/** + * Get statistics for pktio handle + * + * @param pktio Packet IO handle + * @param[out] *stats Output buffer + * @retval 0 on success + * @retval <0 on failure + */ +int odp_pktio_stats(odp_pktio_t pktio, odp_pktio_stats_t *stats); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/packet_io.h b/platform/linux-generic/include/odp/packet_io.h index 1d690f5..18f8e78 100644 --- a/platform/linux-generic/include/odp/packet_io.h +++ b/platform/linux-generic/include/odp/packet_io.h @@ -33,6 +33,7 @@ extern "C" { */ #include +#include #ifdef __cplusplus }