From patchwork Tue Oct 31 11:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Github ODP bot X-Patchwork-Id: 117565 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3800993edm; Tue, 31 Oct 2017 04:00:32 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TGilpfar3pMdyWqur/KAL5FqyoQbbwnBwBV1sMEiIBF9ilxzsncVt6pjYgQrws5QWtoCZ2 X-Received: by 10.55.139.70 with SMTP id n67mr1849962qkd.135.1509447632376; Tue, 31 Oct 2017 04:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509447632; cv=none; d=google.com; s=arc-20160816; b=rMvHcttMDI4v/bHEJpVok3teV4HF8p8v8ahVUfBGabotYznGCwY5djzJtAvF9m6vbw 4k+uZooLlc2CegYH/HDggq6R30JlNqTySEnBRNDH4Csdz5d9AvYqaLiqk7Ugzsy3u/2d wW0too/CWYGb/xbkD2NlqmbRDYfvkW/6kCYd1BV9kiRT5UnNK6JEJd4tCquYjbys08v7 0Z43Tf2ElFogmn7hdXZwwcSf0eOpvKkrGeX3MUlZ22NocPj54LChlapY9Rskr3SvuvGM OAwPe9eXfKarREB8q0czOKUR89yIiU6ZDeUHejjIWEXFvKzN/oacupeLSZJGUwIDq419 9WcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:github-pr-num :references:in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=pdxQ2t+YuHNf9I+Eq3Vvp6stbLiqWt8YFMYBE60hhps=; b=pS4+K1jfFl+QiYUZRTuQQGtoy512rMi9hERxo7enHljnsfxcuQrXrG7p4IUBP3ippu HXXdnPV9md+QCwWJOKjH1ad+6alNRYvAHTLLn7WgaPu0N+X7TL2pq04Xh9yvZNHTgn9S uqU4PYnmMfyK+QeodMR/QGTc2rvbmnOE6s1YDdUXVX8vx4MCxbcaIxbjtk43GERPjrFt LZXpLdCCTRPoNV3MPHkA8s9Z+qSN8AkgBRwo3qL2CzC16Z3R5OggA5oHzY00Fk4XHM81 04m9IH1Z82E8rQhZ21Bqr9ddaxy32CZ1ebdLuxvIHVnZlV2K2ykH/aitIU+2mjAtWEFr m5Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from lists.linaro.org (ec2-54-197-127-237.compute-1.amazonaws.com. [54.197.127.237]) by mx.google.com with ESMTP id w76si1149366qka.243.2017.10.31.04.00.29; Tue, 31 Oct 2017 04:00:32 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) client-ip=54.197.127.237; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.197.127.237 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: by lists.linaro.org (Postfix, from userid 109) id B396860B59; Tue, 31 Oct 2017 11:00:29 +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.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 D60B36069B; Tue, 31 Oct 2017 11:00:25 +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 889D160961; Tue, 31 Oct 2017 11:00:15 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id 313C56069B for ; Tue, 31 Oct 2017 11:00:13 +0000 (UTC) Received: from mxback5j.mail.yandex.net (mxback5j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10e]) by forward105p.mail.yandex.net (Yandex) with ESMTP id 2E47040846EE for ; Tue, 31 Oct 2017 14:00:11 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback5j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ZNVkUQI2mW-0BGiXiIs; Tue, 31 Oct 2017 14:00:11 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p0SvtzPjlX-0AkqG5ju; Tue, 31 Oct 2017 14:00:10 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client certificate not present) From: Github ODP bot To: lng-odp@lists.linaro.org Date: Tue, 31 Oct 2017 14:00:03 +0300 Message-Id: <1509447606-15110-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509447606-15110-1-git-send-email-odpbot@yandex.ru> References: <1509447606-15110-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 267 Subject: [lng-odp] [PATCH 2.0 v1 1/4] linux-gen: pktio: move socket stats function prototypes 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: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" From: Bogdan Pricope Move socket stats function prototypes from odp_packet_io_internal.h Signed-off-by: Bogdan Pricope --- /** Email created from pull request 267 (bogdanPricope:2_0_pktio_internal_pr) ** https://github.com/Linaro/odp/pull/267 ** Patch: https://github.com/Linaro/odp/pull/267.patch ** Base sha: 1236f1ad2bba56b5e49ff62df247e52143b48985 ** Merge commit sha: a69a4d7670d99912c517574391cb72bae3308c3f **/ .../linux-generic/include/odp_packet_io_internal.h | 4 ---- platform/linux-generic/pktio/common.c | 10 +++++++++ platform/linux-generic/pktio/common.h | 25 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index b26a35d25..e078cc826 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -149,10 +149,6 @@ static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) int sysfs_stats(pktio_entry_t *pktio_entry, odp_pktio_stats_t *stats); -int sock_stats_fd(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats, - int fd); -int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); int pktin_poll_one(int pktio_index, int rx_queue, diff --git a/platform/linux-generic/pktio/common.c b/platform/linux-generic/pktio/common.c index 4c952e467..050d2d950 100644 --- a/platform/linux-generic/pktio/common.c +++ b/platform/linux-generic/pktio/common.c @@ -21,6 +21,11 @@ #include #include +/* + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd) { int err = 0; @@ -51,6 +56,11 @@ int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd) return err; } +/* + * ODP_PACKET_SOCKET_MMSG: + * ODP_PACKET_SOCKET_MMAP: + * ODP_PACKET_NETMAP: + */ int sock_stats_fd(pktio_entry_t *pktio_entry, odp_pktio_stats_t *stats, int fd) diff --git a/platform/linux-generic/pktio/common.h b/platform/linux-generic/pktio/common.h index 2940af143..025e1893d 100644 --- a/platform/linux-generic/pktio/common.h +++ b/platform/linux-generic/pktio/common.h @@ -78,4 +78,29 @@ int rss_conf_set_fd(int fd, const char *name, */ void rss_conf_print(const odp_pktin_hash_proto_t *hash_proto); +/** + * Get statistics for pktio entry + * + * @param pktio_entry Packet IO entry + * @param stats[out] Output buffer for counters + * @param fd Socket file descriptor + * + * @retval 0 on success + * @retval != 0 on failure + */ +int sock_stats_fd(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats, + int fd); + +/** + * Reset statistics for pktio entry + * + * @param pktio_entry Packet IO entry + * @param fd Socket file descriptor + * + * @retval 0 on success + * @retval != 0 on failure + */ +int sock_stats_reset_fd(pktio_entry_t *pktio_entry, int fd); + #endif /*ODP_PKTIO_COMMON_H_*/