From patchwork Wed Nov 1 14:00:04 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: 117694 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp924564qgn; Wed, 1 Nov 2017 07:03:09 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TjoPNhq1JPeK/tt1ZuQHn6tlKZR8wm09nuBKbqueNU7BGH+brNVUeeBVnaywWl1bFwSBzu X-Received: by 10.200.35.42 with SMTP id a39mr8490125qta.9.1509544989906; Wed, 01 Nov 2017 07:03:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509544989; cv=none; d=google.com; s=arc-20160816; b=KcmKW8Sro0+2UDo5Mc2pquOh5tDCco8bsoFTob3TJntVLsJkZRTo33AWNpv2fqk14Y J1rnCbI9NDIOEOO8QsQNhWzIINpmCDO3hWPDSu13WMG1QqzKQFz1qCX9yoUYPnulY27F HMFBPKlPKC5X23nyCPUTrJdXYj42PCxt1YR3zTjztWNaG90sL9WXzv9f6w5H+xNwx4F9 yjO2a6FOLSjcKX7B8n5N73KLoe4NRcGEqDYcehodr3urJKXewuffCXWQ19E7KQXE/MaC SVAozB9jNOrz9pb4G9Irk3O73emYEZQegk0HPJS6KC1UKuvl8+xuchK3NwLul+KV2eo5 vryw== 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=BfJG8lL0i05JN2bwYoEwRA8EGQZIHg8vrfwDnmycbjo=; b=sJjmPlbqTl1JMkaxb5quO4IHO+vZNfJOh1Yb+YPxnR9xY5dHds/7+QA4/FYuwI1FAG +LbFtmxV/SARqDVbxJNaJ8cmj5y152eo6WbyYRyEa6iWnpzTZQi05uqcHo8oUEzD8TGK uEfmLSscuOGD6uGnxWmfcfp30075LAW/wJ7NsBsKPmlEZkX8GLVY7OG9OKBdmK3P3VaJ WkzXdbrnWZx+1CNwA/nV9EO8uLCEmV2xPp4XjeXy4AaHJTTdYNdW2UCqU3CxoFTyoM3l wGQP5IzzKedNqxHZ1vB8+vdxuzRtxJE4x1pTSTA3Ygc/H4DSmduL8WKhAsFrxuouRsZN l4rw== 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 n66si306372qka.337.2017.11.01.07.03.09; Wed, 01 Nov 2017 07:03:09 -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 96B0861027; Wed, 1 Nov 2017 14:03:09 +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,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 8582660D6F; Wed, 1 Nov 2017 14:00:41 +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 CC7AF60812; Wed, 1 Nov 2017 14:00:19 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 1764E6050B for ; Wed, 1 Nov 2017 14:00:14 +0000 (UTC) Received: from mxback15j.mail.yandex.net (mxback15j.mail.yandex.net [IPv6:2a02:6b8:0:1619::91]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 6E031560250A for ; Wed, 1 Nov 2017 17:00:12 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback15j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 3vRPlksiHA-0COO80vU; Wed, 01 Nov 2017 17:00:12 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aFzVa8u6W9-0AmCUQ0x; Wed, 01 Nov 2017 17: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: Wed, 1 Nov 2017 17:00:04 +0300 Message-Id: <1509544807-5034-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509544807-5034-1-git-send-email-odpbot@yandex.ru> References: <1509544807-5034-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 267 Subject: [lng-odp] [PATCH 2.0 v2 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 linux-generic version of odp_packet_io_internal.h. This is part of an attempt to remove from this header file all the references to symbols implemented only in linux-generic platform before enabling it for linux-dpdk platform as well. 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: ca1be967bd4f6aec7dc99b72de643718cb8a32b8 ** Merge commit sha: 29fab9a6071107a8bb565ceee1837755d3ca1eee **/ .../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_*/