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_*/ From patchwork Tue Oct 31 11: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: 117571 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3805500edm; Tue, 31 Oct 2017 04:04:10 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TkxCs1mXHzlCKlEZks55x0tkLTjOQvJEqbvNSxfM4RzFh/p3mILy/grs5TSk5C5kEA+4Lc X-Received: by 10.55.23.160 with SMTP id 32mr1865668qkx.20.1509447850060; Tue, 31 Oct 2017 04:04:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509447850; cv=none; d=google.com; s=arc-20160816; b=qwGiRVwJXjKkNrx9HFbiwtbGvdD/YPuk1pPCVw6HCRuv5Zfbit56lNg8DLCHtJ5tmS 5WxECcehJHygg/WHcEFagdubYodXe9ZPn6XxNLh1P5P430iyzJ8CW0jWBL+zdB3tMSJJ /rF5GAFHTjymB+v2eBZ8xoZXussBfdLp5EzaltiF+p9cTHJkSy9Ivft/uyNy9fqJzv/3 Mt3qsyDvZXt5P2g4H6eSQyHQiiRhi374YqG3ojA9mRZefP+GVGO6zLSSqhlqbyrqoU2U n92B9WGzW+C6kt3RYgU2N+M5TDucDuUeNKEO390OId7R3pzpjr++1RhUS5MVUHkuOmLr ovdQ== 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=9bx2e7lKeoIA4G5gK6WBB723uECQEZFdl0VWUz6SkMI=; b=pbw1lrHi4hm/OA2Kl7m1BHdilIAhev2Nf/sMAC1HiFqr3gg6b+IctLVg2keR6Uc/Pe cbRUqsqZQPscAWOFBv8mU9RDx2QdkZNktXCAmSdNiuQjb5O0Ewn5rDwrReq4qbOFm8Ls /N1hlIY3REp4XGwlenw0MyLFKZJYI975TjkFVmqtgx/H6aVp/GxnEAwkuxSFPATyveCt Ol7CCccsUTR63ZheHgNncfqoDTsyAYl0sFdEuYHtoA+29aMGzdKJ8Dmf9XkRF3eSkZY9 /xEcj2jn8igV0h5TdTjsmAOw3FiuBkF5PoDOX8R/kikZcBAgHzR7JnGTUIKWblt7qh7c k3Bg== 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 e8si1170291qtk.427.2017.10.31.04.04.09; Tue, 31 Oct 2017 04:04:10 -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 B543560C05; Tue, 31 Oct 2017 11:04: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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 D681260C1E; Tue, 31 Oct 2017 11:00:38 +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 B854460961; Tue, 31 Oct 2017 11:00:26 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 81F5D6069D for ; Tue, 31 Oct 2017 11:00:13 +0000 (UTC) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 1AEC66A84C7F for ; Tue, 31 Oct 2017 14:00:12 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback9o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2sWsojS4HU-0BkCKro6; Tue, 31 Oct 2017 14:00:12 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p0SvtzPjlX-0Bkqe6OZ; Tue, 31 Oct 2017 14:00:11 +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:04 +0300 Message-Id: <1509447606-15110-3-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 2/4] linux-gen: pktio: move sysfs stats function prototype 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 sysfs stats function prototype 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 **/ platform/linux-generic/Makefile.am | 1 + .../linux-generic/include/odp_packet_io_internal.h | 3 --- platform/linux-generic/pktio/common.c | 1 + platform/linux-generic/pktio/socket.c | 1 + platform/linux-generic/pktio/socket_mmap.c | 1 + platform/linux-generic/pktio/sysfs.c | 1 + platform/linux-generic/pktio/sysfs.h | 23 ++++++++++++++++++++++ 7 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 platform/linux-generic/pktio/sysfs.h diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 277418142..db466dd2a 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -177,6 +177,7 @@ noinst_HEADERS = \ ${srcdir}/include/odp_packet_io_ring_internal.h \ ${srcdir}/pktio/ethtool.h \ ${srcdir}/pktio/common.h \ + ${srcdir}/pktio/sysfs.h \ ${srcdir}/pktio/dpdk.h \ ${srcdir}/include/odp_pktio_ops_ipc.h \ ${srcdir}/include/odp_pktio_ops_loopback.h \ diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index e078cc826..1302a59bf 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -147,9 +147,6 @@ static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) entry->s.cls_enabled = ena; } -int sysfs_stats(pktio_entry_t *pktio_entry, - odp_pktio_stats_t *stats); - int pktin_poll_one(int pktio_index, int rx_queue, odp_event_t evt_tbl[]); diff --git a/platform/linux-generic/pktio/common.c b/platform/linux-generic/pktio/common.c index 050d2d950..900dcbba2 100644 --- a/platform/linux-generic/pktio/common.c +++ b/platform/linux-generic/pktio/common.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include diff --git a/platform/linux-generic/pktio/socket.c b/platform/linux-generic/pktio/socket.c index 7481f4f7f..d9f85b29a 100644 --- a/platform/linux-generic/pktio/socket.c +++ b/platform/linux-generic/pktio/socket.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/platform/linux-generic/pktio/socket_mmap.c b/platform/linux-generic/pktio/socket_mmap.c index 67d2b9206..9b35d89fe 100644 --- a/platform/linux-generic/pktio/socket_mmap.c +++ b/platform/linux-generic/pktio/socket_mmap.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include diff --git a/platform/linux-generic/pktio/sysfs.c b/platform/linux-generic/pktio/sysfs.c index c3d4faea1..f674ac42c 100644 --- a/platform/linux-generic/pktio/sysfs.c +++ b/platform/linux-generic/pktio/sysfs.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include diff --git a/platform/linux-generic/pktio/sysfs.h b/platform/linux-generic/pktio/sysfs.h new file mode 100644 index 000000000..f8fe3072a --- /dev/null +++ b/platform/linux-generic/pktio/sysfs.h @@ -0,0 +1,23 @@ +/* Copyright (c) 2016, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PKTIO_SYSFS_H_ +#define ODP_PKTIO_SYSFS_H_ + +/** + * Get statistics for a pktio entry + * + * @param pktio_entry Packet IO entry + * @param stats[out] Output buffer for counters + * + * @retval 0 on success + * @retval != 0 on failure + */ + +int sysfs_stats(pktio_entry_t *pktio_entry, + odp_pktio_stats_t *stats); + +#endif /* ODP_PKTIO_SYSFS_H_ */ From patchwork Tue Oct 31 11:00:05 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: 117566 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3802146edm; Tue, 31 Oct 2017 04:01:28 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QWM/mqXSmzKbIla0wL0QSeUyYXs4UeP77xFRH5D+PRUavrLd6J14QWzKmFLcn+jPqjJAL8 X-Received: by 10.200.48.171 with SMTP id v40mr2065176qta.120.1509447687866; Tue, 31 Oct 2017 04:01:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509447687; cv=none; d=google.com; s=arc-20160816; b=nA8FFQKvsUZju3Blb4+roR4Fd/bPBVVh2pzA9cHCk5Ntz3FUKmIIEIvAgkUfk3jlgP /GglMBP/jTd5FMjfsWHBXuJ6M5/TpXaxQNPyyxPT3F1x8Ilgi1GCZHYmx1Q0QuKcECP2 Bpiglae4Be5kMKtV7+VcuXEbyczxza0pHEvrL9cd+rMr1ryt7TAOn97UD02CmIkxsIp1 HtogKlinVj1THgwywgrA9UPT1YocSIWaXLvJC0EaGF/IVr5pqCPA92tWYZM0dwUloqw5 lzNM9DSvLbomFTSf0qaHpR1oogLCU/8DU/e5qJLlg8Nmgz/xQ3HLsItT/e8fHNNbwxxh Us1Q== 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=5+zxWfe75BxU56jvWNQbR302+DMx+yQzxkGCDc4mEoA=; b=EmuaeTrPoohp8pTOgbGggdguRy2TIxua0XSfFDYdMkr2lVPDTWTCbzV8/DpAUKILVD 8xJJ4Ksf/T2rSWgEbBgp1Zd8jekwroXYrJz3YQ8mrm5HvLD8UdBkKrwmwe5qE8It9Qqg 0z6DbXoowGKe8WwdZxSSPbbB+JbAYukK/tsOBKekhQa2f5PQS2SFrpyFOuYduVMZi3Ah 9cd9QefOAaUs2WMOR7CCik2TDqDCMMihlGFL5DyGjsRDpsSiIZQoc090XwpJAMTI6o0G QT4HqXXaTo32VCaoD4ShdH/3k2QZSJO8FSZnTeVa8Vei3gdm9FGpi/HQ7Z4K8R+O93Ko nvug== 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 u4si1119994qkb.485.2017.10.31.04.01.27; Tue, 31 Oct 2017 04:01:27 -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 8A25C60C4B; Tue, 31 Oct 2017 11:01:27 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 1DF9E60934; Tue, 31 Oct 2017 11:00:27 +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 5AFA660AC1; Tue, 31 Oct 2017 11:00:18 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 09C966071A for ; Tue, 31 Oct 2017 11:00:14 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward103j.mail.yandex.net (Yandex) with ESMTP id C433C34C5496 for ; Tue, 31 Oct 2017 14:00:12 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 71t1C8vPJY-0CSi92vk; Tue, 31 Oct 2017 14:00:12 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p0SvtzPjlX-0Ck4u4Q8; Tue, 31 Oct 2017 14:00:12 +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:05 +0300 Message-Id: <1509447606-15110-4-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 3/4] linux-gen: pktio: move SOCK_ERR_REPORT macro from odp_packet_io_internal.h 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 SOCK_ERR_REPORT macro 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 **/ platform/linux-generic/include/odp_packet_io_internal.h | 6 ------ platform/linux-generic/pktio/common.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 1302a59bf..a2e1fdd9c 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -42,12 +42,6 @@ typedef union pktio_entry_u pktio_entry_t; #define PKTIN_INVALID ((odp_pktin_queue_t) {ODP_PKTIO_INVALID, 0}) #define PKTOUT_INVALID ((odp_pktout_queue_t) {ODP_PKTIO_INVALID, 0}) -/** Determine if a socket read/write error should be reported. Transient errors - * that simply require the caller to retry are ignored, the _send/_recv APIs - * are non-blocking and it is the caller's responsibility to retry if the - * requested number of packets were not handled. */ -#define SOCK_ERR_REPORT(e) (e != EAGAIN && e != EWOULDBLOCK && e != EINTR) - struct pktio_entry { const pktio_ops_module_t *ops; /**< Implementation specific methods */ uint8_t ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; /**< IO operation diff --git a/platform/linux-generic/pktio/common.h b/platform/linux-generic/pktio/common.h index 025e1893d..2ea68f646 100644 --- a/platform/linux-generic/pktio/common.h +++ b/platform/linux-generic/pktio/common.h @@ -7,6 +7,14 @@ #ifndef ODP_PKTIO_COMMON_H_ #define ODP_PKTIO_COMMON_H_ +#include + +/** Determine if a socket read/write error should be reported. Transient errors + * that simply require the caller to retry are ignored, the _send/_recv APIs + * are non-blocking and it is the caller's responsibility to retry if the + * requested number of packets were not handled. */ +#define SOCK_ERR_REPORT(e) (e != EAGAIN && e != EWOULDBLOCK && e != EINTR) + /** * Read the MTU from a packet socket */ From patchwork Tue Oct 31 11:00:06 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: 117568 Delivered-To: patch@linaro.org Received: by 10.80.245.45 with SMTP id t42csp3803211edm; Tue, 31 Oct 2017 04:02:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SMjduNr3u6vZIYHySMpV/DGLMc23fU31Wz64jqJonSiG4xd6OJjXegS8Tm5N8SvxWT6cHl X-Received: by 10.36.4.212 with SMTP id 203mr2453327itb.10.1509447738395; Tue, 31 Oct 2017 04:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509447738; cv=none; d=google.com; s=arc-20160816; b=S9y45223TyN416kCoEECUHwEzaatBA8hNiLVnwLl0DnkNfA7/OGi6+WJPvV/ZDWRzq sjrAB5sBXshPnKRG+eTShDC0O7ub0W7QFwSqZx0p5fxpdM2U0k9i2Ed0BL9PNcTdodY5 Jy6RUbKMF63/cVfJI72eGYAdE7EsfHwEfN7OpfvIe3HK7ExBhdE+qlLxKhSthh+r8pfT nbMdyjnBMxPk9zstX/rMXWr9bRpTdzmpU3QYPNPC05hmUTOPoxzfri/ATYkKVwSQMQ4R 6U/yfKCcVVrsuXFqhUmMUWVW7vUCzQ6Dj3oqOVDvDecE/7ZYkhGRBr4m64L1YRv5Aams N8ZA== 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=au7fxubwK3VwlbHl5yLmSLpMXp64wDToTkxuCvpwZEc=; b=Cj/+UArxin40q7X3lLZ+wzZ8LHtDrz8HOV60SJMTPDdxbZoGKkpLb8FOq375g1/Zef Aa0E5RJAuuclm6/xyKy62hwrxki5O0j/ObzzcjKK9bGag/l2wJ6biK7OUovOds/9bRwQ 00K8gCW4DTdx+k0lQVYWeI8Hj+zYTHtonajrP9KVSCjCBEa4d7h1pFN/zbD4CYm8jFna 3RhRmAG/BinUM3hiX06GmIzeK9n2aIjf9ZpiGfdtEi1AYFKRImPR4V/76MpgzCa225Ks w706JniWUoKtXT5OO9h3JgNkV2Z9rfJJzqjeF21Zqh9g7XPuqqTFk1wgbJPVt5lmZOR7 vwSw== 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 12si1308170ioz.134.2017.10.31.04.02.18; Tue, 31 Oct 2017 04:02:18 -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 EE28360C0C; Tue, 31 Oct 2017 11:02:17 +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=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, 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 608FC60BFD; Tue, 31 Oct 2017 11:00:31 +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 423326069B; Tue, 31 Oct 2017 11:00:22 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id 9E79460722 for ; Tue, 31 Oct 2017 11:00:14 +0000 (UTC) Received: from mxback6g.mail.yandex.net (mxback6g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:167]) by forward101p.mail.yandex.net (Yandex) with ESMTP id 9A50C6A84A8E for ; Tue, 31 Oct 2017 14:00:13 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback6g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WkkNdqGt6C-0DiGbkow; Tue, 31 Oct 2017 14:00:13 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id p0SvtzPjlX-0CkedrUs; Tue, 31 Oct 2017 14:00:12 +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:06 +0300 Message-Id: <1509447606-15110-5-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 4/4] linux-gen: pktio: remove duplicate odp_packet_io_internal.h 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 Remove duplicate 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 **/ platform/linux-dpdk/Makefile.am | 2 +- .../linux-dpdk/include/odp_packet_io_internal.h | 157 --------------------- .../linux-generic/include/odp_packet_io_internal.h | 1 - platform/linux-generic/odp_packet_io.c | 1 + 4 files changed, 2 insertions(+), 159 deletions(-) delete mode 100644 platform/linux-dpdk/include/odp_packet_io_internal.h diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am index e2a0249df..596c7b784 100644 --- a/platform/linux-dpdk/Makefile.am +++ b/platform/linux-dpdk/Makefile.am @@ -199,7 +199,7 @@ noinst_HEADERS = \ ${top_srcdir}/platform/linux-generic/include/odp_pktio_ops_socket.h \ ${top_srcdir}/platform/linux-generic/include/odp_pktio_ops_loopback.h \ ${top_srcdir}/platform/linux-generic/include/odp_name_table_internal.h \ - ${srcdir}/include/odp_packet_io_internal.h \ + ${top_srcdir}/platform/linux-generic/include/odp_packet_io_internal.h \ ${srcdir}/include/odp_errno_define.h \ ${top_srcdir}/platform/linux-generic/include/odp_packet_io_ring_internal.h \ ${top_srcdir}/platform/linux-generic/include/odp_pkt_queue_internal.h \ diff --git a/platform/linux-dpdk/include/odp_packet_io_internal.h b/platform/linux-dpdk/include/odp_packet_io_internal.h deleted file mode 100644 index 089ad38c5..000000000 --- a/platform/linux-dpdk/include/odp_packet_io_internal.h +++ /dev/null @@ -1,157 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -/** - * @file - * - * ODP packet IO - implementation internal - */ - -#ifndef ODP_PACKET_IO_INTERNAL_H_ -#define ODP_PACKET_IO_INTERNAL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include - -#include -#include - -#define PKTIO_MAX_QUEUES 64 -#include - -/* Forward declaration */ -typedef union pktio_entry_u pktio_entry_t; -#include - -#define PKTIO_NAME_LEN 256 - -#define PKTIN_INVALID ((odp_pktin_queue_t) {ODP_PKTIO_INVALID, 0}) -#define PKTOUT_INVALID ((odp_pktout_queue_t) {ODP_PKTIO_INVALID, 0}) - -struct pktio_entry { - const pktio_ops_module_t *ops; /**< Implementation specific methods */ - uint8_t ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; /**< IO operation - specific data */ - /* These two locks together lock the whole pktio device */ - odp_ticketlock_t rxl; /**< RX ticketlock */ - odp_ticketlock_t txl; /**< TX ticketlock */ - int cls_enabled; /**< is classifier enabled */ - odp_pktio_t handle; /**< pktio handle */ - enum { - /* Not allocated */ - PKTIO_STATE_FREE = 0, - /* Close pending on scheduler response. Next state after this - * is PKTIO_STATE_FREE. */ - PKTIO_STATE_CLOSE_PENDING, - /* Open in progress. - Marker for all active states following under. */ - PKTIO_STATE_ACTIVE, - /* Open completed */ - PKTIO_STATE_OPENED, - /* Start completed */ - PKTIO_STATE_STARTED, - /* Stop pending on scheduler response */ - PKTIO_STATE_STOP_PENDING, - /* Stop completed */ - PKTIO_STATE_STOPPED - } state; - odp_pktio_config_t config; /**< Device configuration */ - classifier_t cls; /**< classifier linked with this pktio*/ - odp_pktio_stats_t stats; /**< statistic counters for pktio */ - char name[PKTIO_NAME_LEN]; /**< name of pktio provided to - pktio_open() */ - odp_pool_t pool; - odp_pktio_param_t param; - - /* Storage for queue handles - * Multi-queue support is pktio driver specific */ - unsigned num_in_queue; - unsigned num_out_queue; - - struct { - odp_queue_t queue; - queue_t queue_int; - odp_pktin_queue_t pktin; - } in_queue[PKTIO_MAX_QUEUES]; - - struct { - odp_queue_t queue; - odp_pktout_queue_t pktout; - } out_queue[PKTIO_MAX_QUEUES]; -}; - -union pktio_entry_u { - struct pktio_entry s; - uint8_t pad[ROUNDUP_CACHE_LINE(sizeof(struct pktio_entry))]; -}; - -typedef struct { - odp_spinlock_t lock; - pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; -} pktio_table_t; - -extern void *pktio_entry_ptr[]; - -static inline int pktio_to_id(odp_pktio_t pktio) -{ - return _odp_typeval(pktio) - 1; -} - -static inline pktio_entry_t *get_pktio_entry(odp_pktio_t pktio) -{ - if (odp_unlikely(pktio == ODP_PKTIO_INVALID)) - return NULL; - - if (odp_unlikely(_odp_typeval(pktio) > ODP_CONFIG_PKTIO_ENTRIES)) { - ODP_DBG("pktio limit %d/%d exceed\n", - _odp_typeval(pktio), ODP_CONFIG_PKTIO_ENTRIES); - return NULL; - } - - return pktio_entry_ptr[pktio_to_id(pktio)]; -} - -static inline int pktio_cls_enabled(pktio_entry_t *entry) -{ - return entry->s.cls_enabled; -} - -static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) -{ - entry->s.cls_enabled = ena; -} - -/* - * Dummy single queue implementations of multi-queue API - */ -int single_input_queues_config(pktio_entry_t *entry, - const odp_pktin_queue_param_t *param); -int single_output_queues_config(pktio_entry_t *entry, - const odp_pktout_queue_param_t *param); -int single_recv_queue(pktio_entry_t *entry, int index, odp_packet_t packets[], - int num); -int single_send_queue(pktio_entry_t *entry, int index, - const odp_packet_t packets[], int num); - -int pktin_poll_one(int pktio_index, - int rx_queue, - odp_event_t evt_tbl[]); -int pktin_poll(int pktio_index, int num_queue, int index[]); -void pktio_stop_finalize(int pktio_index); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index a2e1fdd9c..7df11618e 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -25,7 +25,6 @@ extern "C" { #include #include #include -#include #include #include diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c index beeb9c6b3..d5f8d5de0 100644 --- a/platform/linux-generic/odp_packet_io.c +++ b/platform/linux-generic/odp_packet_io.c @@ -186,6 +186,7 @@ static odp_pktio_t setup_pktio_entry(const char *name, odp_pool_t pool, pktio_entry->s.pool = pool; memcpy(&pktio_entry->s.param, param, sizeof(odp_pktio_param_t)); pktio_entry->s.handle = hdl; + pktio_entry->s.stats_type = STATS_UNSUPPORTED; odp_pktio_config_init(&pktio_entry->s.config);