From patchwork Mon Nov 20 14:00:10 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: 119284 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3891237qgn; Mon, 20 Nov 2017 06:01:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMYoYihJfp8GnZwtXBrv0gTgrXulWFtjuzOa8nn9YRLHhnY7XNZ1OMGfuzrVc+fJ9gD8fGDu X-Received: by 10.55.16.86 with SMTP id a83mr20123376qkh.222.1511186476961; Mon, 20 Nov 2017 06:01:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511186476; cv=none; d=google.com; s=arc-20160816; b=c7xuf5rEDrvFbK+dwxtVj07Zg2tA6eanaz+56EwInou/jWjcbM/gE1zj086cOLcNc/ KHJn2OUTRlZ6DYY+zra4CgfKlFyQ5cuELPLidjb01oL3gGi4tKKG/mIU7xlO7rhsrwuQ s679xZJcSM9oA+xWfelQXRaPwuHoNdhDOTiZfoHJJB4C5A/VpqdolzpkVIWJ7m4hH0Qw QQPyAsJPPpINY4oI5aJ6lonulnHijFLYY7gOg6Qr1adBPXcT227HJj3eTgLZ0LknPn6s 9rEypvC32lheCpZvVHJSYvMgf5YMbfzEddlXEo/j3qDp51KyEzKZB4k93VtnUhWnvxPt l5iQ== 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=//BHtuVypZ6qObPwQydg/LJCf8TkubdFROA5SQIQt9o=; b=IEnmqNjARx3jLEp/2MHp692C9QHgpJXsn+0VhtXl+58pN5E7gh03uodiFvW2/ZCUng L2SH1e191IGO1EfYigbxdtRrokSnF6+am1O3rf/zNUF13ZrdDtv+PiJTJNYaNiRZV96J hTjgZP1mtB4DQofDkU10BVH9wTOX1E6vamt89MqwJny/In+BQa8H4wAmvT1AmBEbr0Nu ensfIUfJgdIUTuSa3HdXpwk4ExX4Ptf+3HPYbscBs97xiPCV0JgKQ+NXto/+On7QLoNg eRW55qiRrrGWf6OyunJRsT3LnXccov1JfmPT8vAYW8jjlIugzLIFHnM+TKhtjpdT8Aet 71Hg== 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 k125si4343235qkd.362.2017.11.20.06.01.16; Mon, 20 Nov 2017 06:01:16 -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 79C6A60862; Mon, 20 Nov 2017 14:01:16 +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 EC6AE60604; Mon, 20 Nov 2017 14:00: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 279196068D; Mon, 20 Nov 2017 14:00:20 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 8F3C7605D7 for ; Mon, 20 Nov 2017 14:00:17 +0000 (UTC) Received: from mxback19j.mail.yandex.net (mxback19j.mail.yandex.net [IPv6:2a02:6b8:0:1619::95]) by forward106o.mail.yandex.net (Yandex) with ESMTP id 503C5783AC7 for ; Mon, 20 Nov 2017 17:00:15 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback19j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 2kUerYy8rk-0FR4q2nK; Mon, 20 Nov 2017 17:00:15 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nKkSyfh6qf-0EbGUkh7; Mon, 20 Nov 2017 17:00:14 +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: Mon, 20 Nov 2017 17:00:10 +0300 Message-Id: <1511186413-3157-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> References: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v8 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: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: 806896e052ccb172565d49630ce6033f4e6ec9cd **/ include/odp/api/spec/std_types.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h index ec6a6df6d..9b4f894de 100644 --- a/include/odp/api/spec/std_types.h +++ b/include/odp/api/spec/std_types.h @@ -15,6 +15,8 @@ #ifndef ODP_API_STD_TYPES_H_ #define ODP_API_STD_TYPES_H_ #include +/* uint64_t, uint32_t, etc */ +#include #ifdef __cplusplus extern "C" { @@ -31,6 +33,14 @@ extern "C" { * between e.g. different compilers. */ +/** + * Percentage type + * 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. + */ +typedef uint32_t odp_percent_t; + /** * @} */ From patchwork Mon Nov 20 14:00:11 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: 119285 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3892276qgn; Mon, 20 Nov 2017 06:02:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMaAs69yphCHy+Yw4/DPoYvKDIqu2snzzlxdxAkeYuonO3uZFeVzAWgKgY9atiwPA4P7wSTL X-Received: by 10.55.5.13 with SMTP id 13mr19742611qkf.11.1511186520461; Mon, 20 Nov 2017 06:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511186520; cv=none; d=google.com; s=arc-20160816; b=oOE74wTfGPv+ZMB85D4iyDFvWTk17J5upcDom2b+iN+3gorWiKGDcQBGe3DA4M6hDS Qt+QpaK1qPodihBKKsPrUjYlnMFurZLmxq6Uvb8pqI9wTF3ew19V77ctId5vbF5IZ1Fm deDiXb4VIvRtwjivEM3gUzObbv5rfVii9wTjZ6GmiyAd/xdwuPEBSZp64ObV6LLkDcVn g7U9ycB3Us+rZIZhKHBUdseajSdTHdGOSOGf2lZ+zqrGvSEqL88h1n302RZtdpYRqPUS +CZW1nRRK3r+wJO7pQ/Wvuyp2w9NYQcou+jcPCi907CtzmCJ+1/wzU0UbfVBFY83kgEM XmWA== 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=Xr1wOxEtG7hSxhEd/URfDmDsG8Ub9uPDLqi/PBML13o=; b=JOAXB4fRl/Lbtx1mx+XiLBiwWQdmsNEuailje9LP5J0T2QG/B4AelvBFvwy2XUr3O8 3xse4piln2nAK+vPk+di1wvSVAbXjVBAlASY1hCj1KIHUn+SFrcGEoUFR0i7xjXdxXv7 BKEVZVkJQEBBu3AbdoGc0n6qUZ9P8RubibcOfj6YPYVeWOBbOCFoIa1Yec3Il9+mQvSD 68jSWbO7GHZcv01EVHlz4clamYJUiKQI18m2455YfPH53nT6XtEsIzMozE7DHr7sx7te +go5tUC98+78es1L8TRa7Qg0HQuF38n5XdMGVR9ghj85pkRY4Ho0BKhZYBXyyimxD5a0 Nx+A== 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 s49si299260qth.411.2017.11.20.06.02.00; Mon, 20 Nov 2017 06:02: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 0C9176087F; Mon, 20 Nov 2017 14:02:00 +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 3A31860865; Mon, 20 Nov 2017 14:00:34 +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 019D660843; Mon, 20 Nov 2017 14:00:27 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 8821960604 for ; Mon, 20 Nov 2017 14:00:19 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward100p.mail.yandex.net (Yandex) with ESMTP id E25905101917 for ; Mon, 20 Nov 2017 17:00:17 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id nSICnWaMW1-0Gj0TsKi; Mon, 20 Nov 2017 17:00:17 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nKkSyfh6qf-0FbqHRVJ; Mon, 20 Nov 2017 17:00:15 +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: Mon, 20 Nov 2017 17:00:11 +0300 Message-Id: <1511186413-3157-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> References: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v8 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: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: 806896e052ccb172565d49630ce6033f4e6ec9cd **/ include/Makefile.am | 1 + include/odp/api/spec/threshold.h | 105 +++++++++++++++++++++ platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp/api/threshold.h | 34 +++++++ 4 files changed, 141 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 4e2d748b0..02f9c44af 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -43,6 +43,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..38c2430a0 --- /dev/null +++ b/include/odp/api/spec/threshold.h @@ -0,0 +1,105 @@ +/* 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_types_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 packet:1; + + /** Total size of all transient packets in bytes */ + uint8_t bytes:1; + }; + + /** All bits of the bit field structure */ + uint8_t all_bits; +} odp_threshold_types_t; + +/** + * ODP Threshold types + * + * Different types of threshold measurements + */ +typedef enum odp_threshold_type_t { + /** Percentage of the total size of pool or queue */ + ODP_THRESHOLD_PERCENT, + + /** Total number of all transient packets */ + ODP_THRESHOLD_PACKET, + + /** Total size of all transient packets in bytes */ + ODP_THRESHOLD_BYTE +} odp_threshold_type_t; + +/** + * ODP Threshold + * + * Threshold configuration + */ +typedef struct odp_threshold_t { + /** Type of threshold */ + odp_threshold_type_t type; + + /** Different threshold types */ + union { + /** Percentage */ + struct { + /** Max percentage value */ + odp_percent_t max; + + /** Min percentage value */ + odp_percent_t min; + } percent; + + /** Packet count */ + struct { + /** Max packet count */ + uint64_t max; + + /** Min packet count */ + uint64_t min; + } packet; + + /** Sum of all data bytes of all packets */ + struct { + /** Max byte count */ + uint64_t max; + + /** Min byte count */ + uint64_t min; + } byte; + }; +} odp_threshold_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 990eb433a..8f783463c 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 Mon Nov 20 14:00:12 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: 119287 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3893855qgn; Mon, 20 Nov 2017 06:03:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMboHWTdE00SKP4+EEogmYI6W9g+uDOy9ooBiCZVAhR5x6mFR5m7q5m+RoH+Pi+JiXQIlyv+ X-Received: by 10.55.100.149 with SMTP id y143mr21427343qkb.252.1511186583816; Mon, 20 Nov 2017 06:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511186583; cv=none; d=google.com; s=arc-20160816; b=i2aszCUW4kPBoaS4HLER7k25EZKFE7kGGIGYXhSccHUIBLh5LcSinJaLWM+lB12p1A td86hUYINdToO+6o7+0rRcD3xKfwQfCsiYHEaQ9X+B7VllTk3flhR4If5WMaNFTOuDGe t33TWKPdBqSX3MclwxH2kwMVLOfnlLHad8dZUgjLweGUDA8Zac7n7sbAWbEJTlGJqiAc cHBJ9IJR+Nuelr/DIwu6eLpr3/s9DvjEqebec33ikArQrvszwmQo6aK0XaqygdO8rSY1 NNtDal66HcZ/PvsuEm7Cb+ZgluCZNaedPiktMAfyxqtAJCegN6DBbMVFvPDJYzqQD6kp pRSg== 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=BfwgqLSHUBCQgmSyab98+zURNcJWKu1deGFNijjSUpA=; b=zO3m9kaAhuwMNP74EP9s3hGmRxeh+YUC6rY0nlYKqt4sNnyTJF5R6vhvDe2UYhMFOp 9qE8p40Bi473VDxki0FakZAdBMH60/kLPnF8oxHaouGiusiEeEAW3GFFdhwKQ9aD9utT TWa+YUMC/3OlLeVMcwXgZMn1BEE4EE9RqObHoFDePsMbC+fRYK8R1cV6FhIxvCUCwEmW eEsgcjI4XqbtqRiVDjc0kl0EjkZRm9PMU/gzVkK1Hh6+NGQ0QI1PrRQMZh4KrsuQSWRC jdKhKjCJKksC0IDCV7phuFmHWFDsO4EqT4Iqt44RDvipJOjf4/wUB+EfkGJiFGiUg0ks CFfQ== 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 w36si1835803qta.214.2017.11.20.06.03.03; Mon, 20 Nov 2017 06:03:03 -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 57F5C608E6; Mon, 20 Nov 2017 14:03:03 +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 A6046608AA; Mon, 20 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 2BAC8607A0; Mon, 20 Nov 2017 14:00:29 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id 88541605D7 for ; Mon, 20 Nov 2017 14:00:20 +0000 (UTC) Received: from mxback8g.mail.yandex.net (mxback8g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:169]) by forward102j.mail.yandex.net (Yandex) with ESMTP id E1EEF5602C9F for ; Mon, 20 Nov 2017 17:00:18 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback8g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LyDk0n9B9C-0Ipukh4e; Mon, 20 Nov 2017 17:00:18 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nKkSyfh6qf-0Ib8Jgtn; Mon, 20 Nov 2017 17:00:18 +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: Mon, 20 Nov 2017 17:00:12 +0300 Message-Id: <1511186413-3157-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> References: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v8 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: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: 806896e052ccb172565d49630ce6033f4e6ec9cd **/ include/odp/api/spec/classification.h | 74 +++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0c4a95c5f..16bf3e6ea 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,61 @@ 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 cross the specified + * threshold values. RED is enabled when 'red_enable' boolean is true and + * the resource usage is equal to or greater than the minimum threshold value. + * Resource usage could be defined either as the percentage of pool being full + * or the number of packets/bytes occupied in the queue depening on the platform + * capabilities. + * 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. + * + * Drop probability is configured as follows + * * Drop probability is 100%, when resource usage >= threshold.max + * * Drop probability is 0%, when resource usage <= threshold.min + * * Drop probability is between 0...100 % when resource usage is between + * threshold.min and threshold.max + * + * 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. + */ +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 enable; + + /** Threshold parameters for RED + * RED is enabled when the resource usage is equal to or greater than + * the minimum threshold value and is disabled otherwise + */ + odp_threshold_t 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 enable; + + /** Threshold value for back pressure. + * BP is enabled when the resource usage is equal to or greater than the + * max backpressure threshold. Min threshold parameters are ignored for + * BP configuration. + * @see odp_red_param_t for 'resource usage' documentation. + */ + odp_threshold_t threshold; +} odp_bp_param_t; + /** * Classification capabilities * This capability structure defines system level classification capability @@ -135,6 +191,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_types_t threshold_red; + + /** Support for Back Pressure to the remote peer */ + odp_support_t back_pressure; + + /** Supported threshold type for BP */ + odp_threshold_types_t threshold_bp; } odp_cls_capability_t; /** @@ -206,6 +274,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 Mon Nov 20 14:00:13 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: 119286 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp3892770qgn; Mon, 20 Nov 2017 06:02:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMaSJt8tqw9Mis93WwAAvgi0sJ1wi6VsSdZsRlQSsYHBME69Fkke9MgzFnW73vjl4lOSLUt6 X-Received: by 10.233.244.73 with SMTP id z9mr22186427qkl.300.1511186540124; Mon, 20 Nov 2017 06:02:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511186540; cv=none; d=google.com; s=arc-20160816; b=Nh/cpRwYg7NlBFKS2jkPWCNgfNVHRzyM4X7XtPsGqSb436SYmNgytBXYQl/vHekaGn 6wf+9G74dGEr414oWTrnZAdOk4pyLT0qhk/H29dowlslSMfJ1TLPGozZTrbfAG8tBAwK gFXzbp6k4pCNMzVwRS59bLoerwddmzYNKc9pTzBnhTn+haoinECJL6/9tMz4Fm3l0pr1 VUr7fiaJmVYz21I6D+CfLHkOvhcZes2omoNKhCL5UGi2xvDXUi9Wy5l/oQD1u7+/BrOU FBUIZPgyrF9Y449vugQ2AYCjnC5nZi05n6ZOraKMhVMess41fn/rIWlZWpfc5cC+Om15 hrwA== 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=7f5RsnTNTx8RSV8v5fzAKuM6OGWx/ufBeLUOvCy7ZCI=; b=tirH2vQgPQIpN1seaPrneJPIs5VAJR4J0JggjEAgmOxz2ZQ3rZ5Hiz7JCF8xibzNpW BihW5x1FvSy5RpUX1BmSxABb8SdE/ay4t1QJvM4EmQAzO+Q5015qf6z7HKEH46SS8K29 zO8W6gr8CtvZEdSgSlyfblb7GcTCPEzL589Yr0av2vhHUkRDuj5Z7d3CtJWX09hnc/OJ T8TyyE8Nkq2aGaq+JbP2cCq4VLabCMl2kvykxxDlgyYZQK5BbfZ7WSGG3D24MTwyVCHA 5XMz23mc3sDwNSjNFjRTuxlHipgfF31tC0SaeR+uzu/OXNokKcMeziZlbakk+pbed9kK t4ag== 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 r184si457863qkf.16.2017.11.20.06.02.19; Mon, 20 Nov 2017 06:02:20 -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 CAA71608DC; Mon, 20 Nov 2017 14:02:19 +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 5E8696088A; Mon, 20 Nov 2017 14:00:36 +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 E3EDE607A0; Mon, 20 Nov 2017 14:00:28 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id CDAB060607 for ; Mon, 20 Nov 2017 14:00:20 +0000 (UTC) Received: from mxback6j.mail.yandex.net (mxback6j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10f]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 780DD218179A for ; Mon, 20 Nov 2017 17:00:19 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback6j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id zpAsWKko2L-0JKWl05f; Mon, 20 Nov 2017 17:00:19 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nKkSyfh6qf-0IbGtt9F; Mon, 20 Nov 2017 17:00:18 +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: Mon, 20 Nov 2017 17:00:13 +0300 Message-Id: <1511186413-3157-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> References: <1511186413-3157-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v8 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: d4b364849c4abb4c71e0c5260e1a793ebb8dc97d ** Merge commit sha: 806896e052ccb172565d49630ce6033f4e6ec9cd **/ platform/linux-generic/odp_classification.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index a5cba56a4..025f12593 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -190,6 +190,10 @@ 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; + capability->threshold_red.all_bits = 0; + capability->threshold_bp.all_bits = 0; return 0; }