From patchwork Wed Nov 8 18:00:21 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: 118309 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5609705qgn; Wed, 8 Nov 2017 10:12:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMbOHJ9Fr1b4+eetIATNfar+DXUrdwMytQjhKDAC9PapO4TjCbZxEA8Y61KVID1rFa8pW8w6 X-Received: by 10.55.144.132 with SMTP id s126mr2154019qkd.309.1510164778491; Wed, 08 Nov 2017 10:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510164778; cv=none; d=google.com; s=arc-20160816; b=L43CF7C7HFVloOKq0OFV87nf19V54zPh/ZzPqkTI5Ay4ijsmCHXP5Cgu4wp3uddCRd 3XrHmTTEnHEit44NtiCCWebjFQIEzeRnBnJpAUaldzQXdCbaV4lxxCOA84udXlI3l9zH LgCKQMXHhadn+2bDUKs81qAxRZprMFHA0VpcSqEN+W57mUpsy0ptkCBgLHcoeH0FT5Pk Gv8zbxK4/V2EE0cHNvf4J5gpDPPkkz9AdDxlXvFwOuF6WbE6T46C8pVCs1DnyHcMeyor /khxrBqlw4tXApoq4ec3iOjpBYFH8qm1XMcACEE1nGZIhaJrNxLqbVjc1GR0nGB/Rymf quGg== 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=RkEbmaE++wDnQc4H0w5NAxOu3oe8x6rTxFD+7cIenE4=; b=zTmALKW+f7FdBquJCDdVN7OleA8e6o5BJ0905/8uN0V86A3HeaRnQ6Ah5/IuWxwWEq n1JegQdxbmzhVVFzv468qs1KJEBzWNVBMgWJx0ilp77+VlMcvv6LIj97FzQ2eGdGZMpp ikUB3BQUEH8nfJhZ/fjkDWteRQBxp3xv0GMKyBCo7m5zG0rkX6g70F6q0ejFkfl3VELg J8L+tXpoLHOiN4rDEvQS2Cv4OIJXiwtTGWkkrsZss13rSzH1EuIERp+SOWYrK5GjD1NW NAYsGOAyfzpaHWyjzudjRLyT1idF7CEt1ta6opmuyEukiBX9kFIftYNULoxtu3Jt7mAk zCFA== 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 n66si4184766qka.337.2017.11.08.10.12.46; Wed, 08 Nov 2017 10:12:58 -0800 (PST) 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 21F716090B; Wed, 8 Nov 2017 18:12:46 +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 A585C61018; Wed, 8 Nov 2017 18:02: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 E46446065A; Wed, 8 Nov 2017 18:02:05 +0000 (UTC) Received: from forward105p.mail.yandex.net (forward105p.mail.yandex.net [77.88.28.108]) by lists.linaro.org (Postfix) with ESMTPS id EAEBD6065A for ; Wed, 8 Nov 2017 18:00:29 +0000 (UTC) Received: from mxback5g.mail.yandex.net (mxback5g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:166]) by forward105p.mail.yandex.net (Yandex) with ESMTP id E7CE740829EF for ; Wed, 8 Nov 2017 21:00:25 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback5g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id QcT3DdTRap-0PseCkJD; Wed, 08 Nov 2017 21:00:25 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tDCqgXa6TK-0PFi3j1I; Wed, 08 Nov 2017 21:00:25 +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, 8 Nov 2017 21:00:21 +0300 Message-Id: <1510164024-14363-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> References: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v3 1/4] api: std_types: add odp_percent_t data type 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: Balasubramanian Manoharan odp_percent_t is used to express values which are percentages Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 277 (bala-manoharan:RED) ** https://github.com/Linaro/odp/pull/277 ** Patch: https://github.com/Linaro/odp/pull/277.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 223acade235c29912901e366435e893d4a2e7091 **/ include/odp/api/spec/std_types.h | 7 +++++++ platform/linux-generic/include/odp/api/std_types.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h index ec6a6df6d..97f5ad994 100644 --- a/include/odp/api/spec/std_types.h +++ b/include/odp/api/spec/std_types.h @@ -32,6 +32,13 @@ extern "C" { */ /** + * @typedef odp_percent_t + * Use odp_percent_t for specifying fields that are percentages. It is a fixed + * point integer whose units are expressed as one-hundredth of a percent. + * Hence 100% is represented as integer value 10000. + */ + +/** * @} */ diff --git a/platform/linux-generic/include/odp/api/std_types.h b/platform/linux-generic/include/odp/api/std_types.h index b61f33f4c..2104db03d 100644 --- a/platform/linux-generic/include/odp/api/std_types.h +++ b/platform/linux-generic/include/odp/api/std_types.h @@ -29,6 +29,8 @@ extern "C" { typedef int odp_bool_t; +typedef uint16_t odp_percent_t; + /** * @} */ From patchwork Wed Nov 8 18:00:22 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: 118307 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5607613qgn; Wed, 8 Nov 2017 10:11:09 -0800 (PST) X-Google-Smtp-Source: ABhQp+TSw4U6hT2vrN9Ri3VQ4kBwrVCiPkzcpddvIOrRo+VR5FL/IoV8NxlbjuDOOLGtFQf9n697 X-Received: by 10.107.97.1 with SMTP id v1mr1727372iob.263.1510164669037; Wed, 08 Nov 2017 10:11:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510164669; cv=none; d=google.com; s=arc-20160816; b=rFZgDMWoYl9qZe7vun8BiF+McAL6dOHDIZ2+HQAVCiyC/Nevgg1M9MmA8UxasFu6kt lIrPMy853y5P6dxeGTLkD6SftH5FLhygV7yRVBC+jnqZYArAAEwm4FLs+gXnBvhxXIFv m4Yd6l8Rq8b/R4lGdtVxeENF58hCT3jwcnuyPHftiRumUuTuj72bFHV74UuvW7o+R7BI rtPm+hF09tzt1ShjIZUlCMElccMfjWZ6eEQ2y0g4DLxM3aVot5tCh8/1US1k/tIpzrZM /2VJ0E1/Wmfy3aVs2FixxlsALqqkDPPVBpkefKL4VagVnhlB5/gAEhM+F3OjQuFGqNY7 D3HQ== 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=wfr86vPTl1hsOPydXoM2tHrIXnnxv9RtZgmVugC1Zr4=; b=BbpuTmlJ90SimA+vQrkJuj8CpH6B1qwFhEqaJY0MT/7twm0maPTlziNKmBKE3gKFCB GtHQMM+6bpABRqnmcoGBtB6VCTCwN9eDXZYv7iNE/78T6LSQC/rR4ZMpT1t9yuaqtoCW enw6LfSonw3pwTOM3p09i3BPkQadIyZkSTGY2CE8PfrrTlbc0ITwQvn7u6WQfbT5pkKb ubGOmSAn1g6rYU8jrdwVR6WSDMhJLXEPN7Cfb87anwRguLsVp9xvgSsZoQFmvFJXE7F8 goFDE59DXL9kirGGDtutgwtD5Bca/1iMHpBdQkXlNyksCLy8GMtwS8hd3/KCuyxPzf2K AjLg== 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 f14si3933024ioh.8.2017.11.08.10.11.08; Wed, 08 Nov 2017 10:11:09 -0800 (PST) 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 92F4F608CD; Wed, 8 Nov 2017 18:11:08 +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 20E3D60A0A; Wed, 8 Nov 2017 18:02:12 +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 B484961014; Wed, 8 Nov 2017 18:02:03 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id 8405060AC5 for ; Wed, 8 Nov 2017 18:00:27 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 735C6182E0E for ; Wed, 8 Nov 2017 21:00:26 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 42TEk29Lmf-0QmWbNpO; Wed, 08 Nov 2017 21:00:26 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tDCqgXa6TK-0PFKjlSG; Wed, 08 Nov 2017 21:00:26 +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, 8 Nov 2017 21:00:22 +0300 Message-Id: <1510164024-14363-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> References: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v3 2/4] api: threshold: add odp_threshold_t parameter 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: Balasubramanian Manoharan odp_threshold_t is used to configure different threshold types Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 277 (bala-manoharan:RED) ** https://github.com/Linaro/odp/pull/277 ** Patch: https://github.com/Linaro/odp/pull/277.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 223acade235c29912901e366435e893d4a2e7091 **/ include/Makefile.am | 1 + include/odp/api/spec/threshold.h | 102 +++++++++++++++++++++ platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp/api/threshold.h | 34 +++++++ 4 files changed, 138 insertions(+) create mode 100644 include/odp/api/spec/threshold.h create mode 100644 platform/linux-generic/include/odp/api/threshold.h diff --git a/include/Makefile.am b/include/Makefile.am index d53181ceb..8ab150ad9 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -44,6 +44,7 @@ odpapispecinclude_HEADERS = \ odp/api/spec/sync.h \ odp/api/spec/system_info.h \ odp/api/spec/thread.h \ + odp/api/spec/threshold.h \ odp/api/spec/thrmask.h \ odp/api/spec/ticketlock.h \ odp/api/spec/time.h \ diff --git a/include/odp/api/spec/threshold.h b/include/odp/api/spec/threshold.h new file mode 100644 index 000000000..aee286aef --- /dev/null +++ b/include/odp/api/spec/threshold.h @@ -0,0 +1,102 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP threshold descriptor + */ + +#ifndef ODP_API_THRESHOLD_H_ +#define ODP_API_THRESHOLD_H_ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Supported threshold types + * + * Supported threshold types in a bit field structure. + */ +typedef union odp_threshold_type_t { + /** bitfields for different threshold types */ + struct { + /** Percentage of the total size of pool or queue */ + uint8_t percent:1; + + /** Total number of all transient packets */ + uint8_t pkt_cnt:1; + + /** Total size of all transient packets in bytes */ + uint8_t pkt_size:1; + }; + + /** All bits of the bit field structure */ + uint8_t all_bits; +} odp_threshold_type_t; + +/** + * ODP Threshold types + * + * Different types of threshold measurements + */ +typedef enum { + /** Percentage of the total size of pool or queue */ + odp_percent_e, + + /** Total number of all transient packets */ + odp_pkt_count_e, + + /** Total size of all transient packets in bytes */ + odp_pkt_size_e +} odp_threshold_type_e; + +/** + * ODP Threshold + * + * Threshold configuration + */ +typedef struct odp_threshold_t { + /** Type of threshold */ + odp_threshold_type_e type; + + /** Different threshold types */ + union { + struct { + /** Max percentage value */ + odp_percent_t max; + + /** Min percentage value */ + odp_percent_t min; + } percent; /** Percentage */ + + struct { + /** Max packet count */ + uint64_t max; + + /** Min packet count */ + uint64_t min; + } pkt_count; /** Packet count */ + + struct { + /** Max size of all packets */ + uint64_t max; + + /** Min size of all packets */ + uint64_t min; + } pkt_size; /** Packet size */ + }; +} odp_threshold_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index c54067609..2b5056e4d 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -65,6 +65,7 @@ odpapiinclude_HEADERS = \ include/odp/api/sync.h \ include/odp/api/system_info.h \ include/odp/api/thread.h \ + include/odp/api/threshold.h \ include/odp/api/thrmask.h \ include/odp/api/ticketlock.h \ include/odp/api/time.h \ diff --git a/platform/linux-generic/include/odp/api/threshold.h b/platform/linux-generic/include/odp/api/threshold.h new file mode 100644 index 000000000..f4f362852 --- /dev/null +++ b/platform/linux-generic/include/odp/api/threshold.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP threshold API - platform specific header + */ + +#ifndef ODP_PLAT_THRESHOLD_H_ +#define ODP_PLAT_THRESHOLD_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odp_threshold + * @{ + */ + +/** + * @} + */ + +#include + +#ifdef __cplusplus +} +#endif + +#endif From patchwork Wed Nov 8 18:00:23 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: 118308 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5608572qgn; Wed, 8 Nov 2017 10:12:01 -0800 (PST) X-Google-Smtp-Source: AGs4zMa65doJauytppbpkXntY/qdKajITf7mnOfqLcJfGURFwhIyyZtmI7ah5CeUNSl+j9YKe7rm X-Received: by 10.237.34.169 with SMTP id p38mr2438304qtc.182.1510164720991; Wed, 08 Nov 2017 10:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510164720; cv=none; d=google.com; s=arc-20160816; b=z9otZ3+lUm33JrlGYOIa63DBUbpWo2S8DmgKuRhEQgB0mwuIo/NZDYyB8hQsNuVQh8 0XeuT0bGSnlBvvPkqkMOGpUjO+2GlvGMvNycjER3d2R7fX3+3M/pYNjnSyxwvIZiF3xx zMNfY7uCs68miRKlYPfIFmfSeSU/s1f8TUNwq75+3mKgHqocW/pg4HcWYNzyVNSjTVP0 VyIkukAjtrzm2NL5PhpFgMRi7cLsE1t9lPAi1/JSIddYp/yKTFpMgzTmPK6ERQRnN8ZE xqHpYHjZm2fe4uuwRpJXRgnTTrRq3SckiqFeDR78sv2ROuCO5sVTRZe7LyGs6qpf2RBh m11Q== 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=oXUNjltdiBmtO44YxTPqG0Ec1Nb6K5rr8a2Yh7GW4aI=; b=oS9UkJgKL2NFDRrO7W6tVocXDNMg6aCcX93LtUZV/rPh6MAWqexNlCTbCSs7nvCtKw V/WyR7frEWZwt8F+LbEpqgowwPfbmUcItI0ccZ9Ck8Ouii+wABnVSQ81EACtT61IoX+q XHLsId3GA0fLxG/ffYMz7x76eCz3ihmIS5WQ0ssu5ZzVmTLdsbVYLUMD5Oqx53N/gBJm Prm7EJAwwKGyttXS76MM8i/lOGCSHFrhuUQlL8l72croNVkc4J5VH6/2/tb6Sj/DmawO g7gZu/H1fLUCuULN6AFLz7yMtwxtHeWb4rooJnMvJgu1KiER+hG+C0owiLLa3WwiRy+v wn9Q== 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 u11si4476275qtc.122.2017.11.08.10.11.59; Wed, 08 Nov 2017 10:12:00 -0800 (PST) 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 8A2B760AC5; Wed, 8 Nov 2017 18:11: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=-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 693EE61011; Wed, 8 Nov 2017 18:02:19 +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 9B43661011; Wed, 8 Nov 2017 18:02:04 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 8DC94608CD for ; Wed, 8 Nov 2017 18:00:28 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward102o.mail.yandex.net (Yandex) with ESMTP id 149ED5A032EE for ; Wed, 8 Nov 2017 21:00:27 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 6AdlvGQEL4-0QbqSUGi; Wed, 08 Nov 2017 21:00:27 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tDCqgXa6TK-0QFqLmuF; Wed, 08 Nov 2017 21:00:26 +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, 8 Nov 2017 21:00:23 +0300 Message-Id: <1510164024-14363-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> References: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v3 3/4] api: classification: add random early detection and back pressure 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: Balasubramanian Manoharan Adds random early detection and Back pressure feature to CoS Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 277 (bala-manoharan:RED) ** https://github.com/Linaro/odp/pull/277 ** Patch: https://github.com/Linaro/odp/pull/277.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 223acade235c29912901e366435e893d4a2e7091 **/ include/odp/api/spec/classification.h | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0c4a95c5f..f66dfab30 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -20,6 +20,7 @@ extern "C" { #include #include +#include /** @defgroup odp_classification ODP CLASSIFICATION * Classification operations. * @{ @@ -107,6 +108,55 @@ typedef union odp_cls_pmr_terms_t { uint64_t all_bits; } odp_cls_pmr_terms_t; +/** Random Early Detection (RED) + * Random Early Detection is enabled to initiate a drop probability + * for the incoming packet when the packets in the queue/pool reaches + * a specified threshold. + * When RED is enabled for a particular flow then further incoming + * packets are assigned a drop probability based on the size of the + * pool/queue and the drop probability becomes 100% when the queue/pool + * is full. + * RED is logically configured in the CoS and could be implemented + * in either pool or queue linked to the CoS depending on + * platform capabilities. Application should make sure not to link + * multiple CoS with different RED or BP configuration to the same queue + * or pool. + * RED is enabled when the resource limit is equal to or greater than + * the maximum threshold value and is disabled when resource limit + * is less than or equal to minimum threshold value. */ +typedef struct odp_red_param_t { + /** A boolean to enable RED + * When true, RED is enabled and configured with RED parameters. + * Otherwise, RED parameters are ignored. */ + odp_bool_t red_enable; + + /** Threshold parameters for RED + * RED is enabled when the resource limit is equal to or greater than + * the maximum threshold value and is disabled when resource limit + * is less than or equal to minimum threshold value. */ + odp_threshold_t red_threshold; +} odp_red_param_t; + +/** Back pressure (BP) + * When back pressure is enabled for a particular flow, the HW can send + * back pressure information to the remote peer indicating a network congestion. + */ + +typedef struct odp_bp_param_t { + /** A boolean to enable Back pressure + * When true, back pressure is enabled and configured with the BP + * parameters. Otherwise BP parameters are ignored. + */ + odp_bool_t bp_enable; + + /** Threshold value for back pressure. + * BP is enabled when queue or pool value is equal to or greater + * than the max backpressure threshold. + * Min threshold parameters are ignored for BP configuration. + */ + odp_threshold_t bp_threshold; +} odp_bp_param_t; + /** * Classification capabilities * This capability structure defines system level classification capability @@ -135,6 +185,18 @@ typedef struct odp_cls_capability_t { /** A Boolean to denote support of PMR range */ odp_bool_t pmr_range_supported; + + /** Support for Random Early Detection */ + odp_support_t random_early_detection; + + /** Supported threshold type for RED */ + odp_threshold_type_t threshold_red; + + /** Support for Back Pressure to the remote peer */ + odp_support_t back_pressure; + + /** Supported threshold type for BP */ + odp_threshold_type_t threshold_bp; } odp_cls_capability_t; /** @@ -206,6 +268,12 @@ typedef struct odp_cls_cos_param { /** Drop policy associated with CoS */ odp_cls_drop_t drop_policy; + + /** Random Early Detection configuration */ + odp_red_param_t red; + + /** Back Pressure configuration */ + odp_bp_param_t bp; } odp_cls_cos_param_t; /** From patchwork Wed Nov 8 18:00:24 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: 118310 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5610159qgn; Wed, 8 Nov 2017 10:13:24 -0800 (PST) X-Google-Smtp-Source: ABhQp+QWq1y4gy1LPkgfBfWBrTdR7oWJ0+PhEzavBYWsxJN9hTgnM4X0ltXPdeqs+XO4t5WXcHM1 X-Received: by 10.200.28.44 with SMTP id a41mr2264578qtk.321.1510164803921; Wed, 08 Nov 2017 10:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510164803; cv=none; d=google.com; s=arc-20160816; b=Nfk3Cc3gj/JtGGT5TnlYvlMtiIv3O5n3v2qwQAJ9eZUckrB263r4gQUeiOD766sELP rzDegzVKwG8gIubD175mJgFOE+40xpLtdbRniTC5TP1bEa0Iq8vteoUq+iVUo/9EZGMP bNSos2o9Khk6c/DZ+PXJemFGFOGtSLO8bFGITET83c1nikJwyOXHIEnZzZULy84XxdUo E3LFsxMjPaJIPNo+aqWVggfTA43PZ1pPpbJ9/S0rme8kp5HlZNA+gl6dUd9td9BI2YlT HyeXVTEq3dk97fGB2/BUmH4F7VrxMmq+46CLV7bXshofb6o/NKpf8rAmFLXDqP8Rr50f nfBA== 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=33qQLHB7zkjLWeHyh2eUs80E3hwIpz2H6zWvwAhHvJg=; b=SP8Ocx3qQNB5vzfPkBxJOxUbNVxyZo171sA2UmTuYw0C2e/xVZZG+LnHd81tMgK8pC 3pO3a1+j1OHb/CGdg62GYU7xXxz8J5uo2DfKEgmYGrTa9J1gFFgm6BYhwiK6MQtiaYPS nsTyxR2H02kAmBt/B+8k1NcR9QwKans6lrWdE3pIrJavKagYLJqCLVnmE3KUtUV1PvKF ++WHJBZroTlZeI9VJHSWYKzJhSBe32MsrX+ikV5y08ALQMSpq5/94t9XVpO8+5skBMyl sk1RLPQQvi5u0k1RPOBDSbdDzDbVg/xtHHyhOmGL5ZOc99KIfHEnaaSYckbH+3c56u4u 7w1g== 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 x8si1431178qkb.325.2017.11.08.10.13.23; Wed, 08 Nov 2017 10:13:23 -0800 (PST) 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 9561A60AF8; Wed, 8 Nov 2017 18:13:23 +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, 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 00FA26101B; Wed, 8 Nov 2017 18:02:29 +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 151CE60A0A; Wed, 8 Nov 2017 18:02:08 +0000 (UTC) Received: from forward106j.mail.yandex.net (forward106j.mail.yandex.net [5.45.198.249]) by lists.linaro.org (Postfix) with ESMTPS id 984EF60A0A for ; Wed, 8 Nov 2017 18:00:28 +0000 (UTC) Received: from mxback8o.mail.yandex.net (mxback8o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::22]) by forward106j.mail.yandex.net (Yandex) with ESMTP id 8B3DD1801342 for ; Wed, 8 Nov 2017 21:00:27 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback8o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id Cja1Ie5TXK-0RbGjRLn; Wed, 08 Nov 2017 21:00:27 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id tDCqgXa6TK-0RFKewHR; Wed, 08 Nov 2017 21:00:27 +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, 8 Nov 2017 21:00:24 +0300 Message-Id: <1510164024-14363-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> References: <1510164024-14363-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v3 4/4] linux-generic: classification: implement random early detection and back pressure 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: Balasubramanian Manoharan linux-generic does not support random early detection and back pressure Signed-off-by: Balasubramanian Manoharan --- /** Email created from pull request 277 (bala-manoharan:RED) ** https://github.com/Linaro/odp/pull/277 ** Patch: https://github.com/Linaro/odp/pull/277.patch ** Base sha: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 223acade235c29912901e366435e893d4a2e7091 **/ platform/linux-generic/odp_classification.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index a5cba56a4..7fa125ec2 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -190,6 +190,8 @@ int odp_cls_capability(odp_cls_capability_t *capability) capability->supported_terms.bit.tcp_sport = 1; capability->supported_terms.bit.sip_addr = 1; capability->supported_terms.bit.dip_addr = 1; + capability->random_early_detection = ODP_SUPPORT_NO; + capability->back_pressure = ODP_SUPPORT_NO; return 0; }