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_*/ From patchwork Wed Nov 1 14: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: 117692 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp921753qgn; Wed, 1 Nov 2017 07:01:20 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SOrgl1p/RYgdwknQRhxeloGaWcJXCNqAJwJ85v1seXh47Zqes+XodaQbQF0ciKlNRnR98M X-Received: by 10.237.57.228 with SMTP id m91mr8466462qte.267.1509544880675; Wed, 01 Nov 2017 07:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509544880; cv=none; d=google.com; s=arc-20160816; b=g7Nm1BC9pteuvuyR08gSCb6AyLxmPJLlbqu8biyc/9tdd8SAIU06Girxhv+i1Bd1SW 8L9DyC5tMN7oIZi0I1sA2i4ZgeBquONxqEZO2EMupjShahO9lCDM9mcxsevXSWYezoH4 6RBgu3/IrXWUDefsKKtpC5j0LAiQml+mP6JPiJpCj8P/LgS9IvWUw+K1Cu4ZkZU64erC 8cV/il6yi7GLLp3Ggfjd3Ow1KflrZ9uhBoZ22hcvoWvZkPmNAPRmDRdsl1EJk9/QszPA BD42eZyE0Rlud9GP6CLDdcmPTOmpPdAZBca5ST5I+Zhh4X2gmUEOr+twKYIY+XEne6NS OWyg== 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=Z0MMOGxH1ij0Z9qsdLYuiJ5CwRVpIA52ObY0ainS9J0=; b=yS+UukT0bu0DxKx2fENfDXsZkSAciAvHuP99C839FoQbukkRzMSn5hl+xwaGpNBwxi q8GwwcsL3U4/PiF30t9VThyXJMfqngYU95IG8UfNnqQXv2Ild8rgauGUaJpzGazjcbpC jmVDDRBK3vmeiVIxJJMi/Gfq9QLTvMzPOlL6030XYdkfz1ChVpsI+bQ40Q4hLk7LeWVe /teOjrqU0qznHoBqo5Yqq13j5G69bOXB7q8TGC7hihDN3j/+6msbEOxHR8qgWrV5YSP6 loDaCNr5K4AbAICs06TygK/uImO9mkkGtenQZJWlPEWfypDXVr9OmP3YUqjecmUn6q+p KEMw== 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 t41si622305qtt.230.2017.11.01.07.01.20; Wed, 01 Nov 2017 07:01:20 -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 2316560BE3; Wed, 1 Nov 2017 14:01:20 +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 D7D8B60C1C; Wed, 1 Nov 2017 14:00:30 +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 E088A60A31; Wed, 1 Nov 2017 14:00:16 +0000 (UTC) Received: from forward101j.mail.yandex.net (forward101j.mail.yandex.net [5.45.198.241]) by lists.linaro.org (Postfix) with ESMTPS id AB76C609C3 for ; Wed, 1 Nov 2017 14:00:14 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward101j.mail.yandex.net (Yandex) with ESMTP id 0EE161244116 for ; Wed, 1 Nov 2017 17:00:13 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id EfTHF9JeZZ-0Cw8CcKG; Wed, 01 Nov 2017 17:00:13 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aFzVa8u6W9-0Cmqdcpi; Wed, 01 Nov 2017 17: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: Wed, 1 Nov 2017 17:00:05 +0300 Message-Id: <1509544807-5034-3-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 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 linux-generic version of odp_packet_io_internal.h to a new header file. This is part of an attempt to remove from linux-generic version of odp_packet_io_internal.h 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 **/ 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 Wed Nov 1 14: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: 117693 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp923133qgn; Wed, 1 Nov 2017 07:02:18 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QLC+eXclqwYCK/DtBwMGa4x+45etrFJZhkAB8L2/yqn+DEzeMLCdkEHF+4au8Uw1Tp4pE/ X-Received: by 10.36.43.68 with SMTP id h65mr594972ita.65.1509544938572; Wed, 01 Nov 2017 07:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509544938; cv=none; d=google.com; s=arc-20160816; b=gqcBgcMvZeIHpv7NjbxyKdYAiNn7PaGgrW0KCxfUbZfiW1Duc/o7VKWO4Y3ysssduu ZMaxx9+Dj9M+16q8D16KYlsBpTXsFtxTUHC9fTYsmIvVJPH4m2e5hXfz7/KDmrAly95J VG4RmlH6Tw/pCERJeWs+I5BSisXpfiR6MIz+dTDACG+g/5s7OOIkMyIOi3IGYELkJw1X Ld2AbHBdmWxkR/11OaZnmy8gMB3ZdKVmIMMW0m3iFN1/fhHrb8NIXyUh6B8exzMjTNmP 9KGzYnHzot2zcOSQeTZSLd3bX0Bhr07MSEYLF2aaVKLa8kgIKyMozQnLBXvSmmluUQl3 afrg== 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=SVk8PFLCyfjn4lgK1QRY2ONIh/tgF/25JeM7QeRLB+4=; b=IWWZku26nyEQE3wC1xeBtbrTDYfnEMsxicxABd0DGA5r7C1w/l87K/p/dKGprXO90U FxkuRcyLUpepJZpluq0mQxP8/TqCqFfn/2aJk/HMHLYQy0fbPjlMCRXrS2jzlklG1BuM uOj2XwMbNqiFlMwacpf6VoZ4VBHq4hA5/MLEh4pD32R5WhrVlsAJnpDILGV/93IPnUeF EXD5taQvK/hX9yItjDvnLj7YFhF0zvI6RoQ9YVJXytr8EgFDAUdTC7GvJs5Ou0c/ru6z T/+k5jtET8L4CIJfHgCG4l+/P0Z0+s/pwFVmz9LXl9xoQfJSQuRjnMfLa0XUIFOcLma+ qr8w== 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 65si1103544itc.73.2017.11.01.07.02.18; Wed, 01 Nov 2017 07: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 081386101F; Wed, 1 Nov 2017 14:02:18 +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 4535F60D2E; Wed, 1 Nov 2017 14:00:37 +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 19E19609C3; Wed, 1 Nov 2017 14:00:19 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 77A3E60812 for ; Wed, 1 Nov 2017 14:00:15 +0000 (UTC) Received: from mxback4j.mail.yandex.net (mxback4j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10d]) by forward100o.mail.yandex.net (Yandex) with ESMTP id B924B2A220A1 for ; Wed, 1 Nov 2017 17:00:13 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback4j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qT3kP6XgDZ-0DoumgqC; Wed, 01 Nov 2017 17:00:13 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aFzVa8u6W9-0DmaofkE; Wed, 01 Nov 2017 17:00:13 +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:06 +0300 Message-Id: <1509544807-5034-4-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 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 linux-generic version of odp_packet_io_internal.h to a common header file. This is part of an attempt to cleanup linux-generic version of odp_packet_io_internal.h from macros used 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 **/ 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 Wed Nov 1 14:00:07 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: 117695 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp925751qgn; Wed, 1 Nov 2017 07:03:59 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Rq+sdF42PmGz4Jk24TGHHsUsUYQ4nhcPwKp59RsZjVwAWCU2FYWpVnnGrO0u3PVjGH3b1f X-Received: by 10.107.11.73 with SMTP id v70mr7346326ioi.260.1509545039661; Wed, 01 Nov 2017 07:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509545039; cv=none; d=google.com; s=arc-20160816; b=qrUhDDkwFi649P1YAo9cIeSw5DkBMQiLPX9ELqCVZcVrLVawPTGl0+rWt76YvIeEjf CoAX5FeNR8WfNo80or5PGVHN+H4E3Mwm8Nn1tyAGfHrr7ORlhxtOhhsy6hy7lZU1zvxg P0b4+0MNbQ54ekubsOP8VN/+I4Z2eU9EU/fTCkGFGcNHnGi3tQfNSWp2dtcO7K35aPNZ SHCuXWpO5qUEAlnupEZJIDKceSL4Dx2KOO4SHPPo1PWKzzqkdEbQLmLXG7nWt9wtqBtZ RbBQbsVXkisb+UwI5eevM5HEPebnDCxeFYTQLp5kgjdcmeX4JfyEQviq9kWk0ek0uwEt J21A== 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=yms7tkDKjhORGC5mf7DEdgerCYtn8a2OJehaTkcSbGY=; b=dsZNBKqgUXwnVYXGQlSXwLPZCNIDKLkc8lhH336PMruwwCkYg844P64H+UkOlvZeWR bzhUZYvoDbDghgpwU7ofyZF3ZM2dfZffPIXCbadSnBICpntpRzkEP3qzi7mdez9bcRnW Ug2xNTts9Y2e/8zCcsZrw2eiFTILqqWrkPTypic2Colnw//T9TOTXqQxpkYKgPORIUFu NuTd02LM5/kM1AZ0zT6Ka0pZFTYc6Kt5tiUuRBauOFgx8Nl1waOudX+mqABNPnPq5vRJ otzVz4c5iiwFX+lnGZyk8MoAA6xQc8qcgzXRi4p7ZgmefMR1qHaPG/LYo41w7fuC7jvC fPbw== 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 a39si1018331itj.136.2017.11.01.07.03.59; Wed, 01 Nov 2017 07:03:59 -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 317156100C; Wed, 1 Nov 2017 14:03:59 +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 AFECA60FFF; Wed, 1 Nov 2017 14:00:43 +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 57B4560A56; Wed, 1 Nov 2017 14:00:23 +0000 (UTC) Received: from forward100j.mail.yandex.net (forward100j.mail.yandex.net [5.45.198.240]) by lists.linaro.org (Postfix) with ESMTPS id 18AD960A0B for ; Wed, 1 Nov 2017 14:00:16 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward100j.mail.yandex.net (Yandex) with ESMTP id 890E75D81C89 for ; Wed, 1 Nov 2017 17:00:14 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id K9PIWhB6Rb-0Ei8V88Q; Wed, 01 Nov 2017 17:00:14 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id aFzVa8u6W9-0Dm0g11E; Wed, 01 Nov 2017 17:00:13 +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:07 +0300 Message-Id: <1509544807-5034-5-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 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 Enable utilization of linux-generic version of odp_packet_io_internal.h for linux-dpdk platform. Subsequently, linux-dpdk version of odp_packet_io_internal.h is removed. This is part of an attempt to reduce the delta between linux-dpdk and linux-generic platforms to permit integration of linux-dpdk pktios in linux-generic. 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 **/ 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);