From patchwork Fri Nov 17 10:00:09 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: 119144 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp316534qgn; Fri, 17 Nov 2017 02:02:18 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ6LKOOuHoCdD55QxtK1X4QkM8FXmS/XMlb4u7rC8NhpHHDVy/nrH8v1UWxXiwdIA3Ro4hD X-Received: by 10.55.113.4 with SMTP id m4mr7087160qkc.187.1510912937889; Fri, 17 Nov 2017 02:02:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510912937; cv=none; d=google.com; s=arc-20160816; b=1KTMtxvWjNr8eKyEX/RA76mA0kH+MxiFEKXR4Mk0Zn10RJmGqO8UqfHnj1pN2yKu7t 21oSlhZjSO+l6bQfj4KoWBsS1D+zj8hRO+2mx2Hhgu987fFeSks0tHDk9cJXFOcwhXd6 YtMBOJrpyuRDytO3hTg2Qc5P/V4hLM2iHMWFgL9At67XyJ5Z5k7UzRpsbMJNDnFa2Y/4 mBkrqtENl0rW56h5BiJthWkG9H3wgoKxACUpiMbzkUFEJALLLFmyxm+OZSEEr+lywQE1 F7JWKdeuJhFWKdwfgslnYMqbYWPsSP331J4lNFFwhlk0vcSoRLRNSuFfbYcwbbZueMxu 12EQ== 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=8X+rvktyesShiqzb5ECc9CImwWrPobwmPOgUyk0D2Rg=; b=wSLl1MJcMNM3M1cfInMxxorXDj2iRaROMkDZ9jOBL6jBi5x5L/YPRmnQcrIcwpvMPf oi+ZkDZZ3a6lQkasC8Wd2qpGyot4yYl/IX6aQii+XUeMkfM83Hoa362jMD8OF749WwOe dWeIi6RqIjHJSJ91Og4x985frSRV7hYuThO904XeJUpZBuvsC7xyl5EtAYGlBpOePU9l xnNED5rLS3Ul0Q+F6/icdEMTmjKu+gxnzAMcgZWZZs7ttvy0higsn0BjaWZgl9QbzT5n VxarjJdjFMTTqOYOi+x6rGnPiQH+WC6D7wr6FCH1SBs8FCwASVhdnAMye9nCyJBbER8Z SXgA== 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 59si1980080qte.208.2017.11.17.02.02.17; Fri, 17 Nov 2017 02:02:17 -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 80BC7607D6; Fri, 17 Nov 2017 10:02:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id D91E96074A; Fri, 17 Nov 2017 10:00:44 +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 6042D607B8; Fri, 17 Nov 2017 10:00:27 +0000 (UTC) Received: from forward102o.mail.yandex.net (forward102o.mail.yandex.net [37.140.190.182]) by lists.linaro.org (Postfix) with ESMTPS id 92C76607A9 for ; Fri, 17 Nov 2017 10:00:16 +0000 (UTC) Received: from mxback14g.mail.yandex.net (mxback14g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:93]) by forward102o.mail.yandex.net (Yandex) with ESMTP id C2D1F5A01FFA for ; Fri, 17 Nov 2017 13:00:14 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback14g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id ciLvMVOlaR-0EBS2pUE; Fri, 17 Nov 2017 13:00:14 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gGHK4ZnQM0-0EJ0v43C; Fri, 17 Nov 2017 13: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: Fri, 17 Nov 2017 13:00:09 +0300 Message-Id: <1510912812-30854-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> References: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v7 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: 79753e89098ca8ff03331d8983a575c41ec60623 **/ 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..f5eddd285 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" { @@ -32,6 +34,14 @@ 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. + */ + +typedef uint32_t odp_percent_t; +/** * @} */ From patchwork Fri Nov 17 10: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: 119142 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp315289qgn; Fri, 17 Nov 2017 02:01:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMZDFNAZgcvJ6acXhba6sVb+tFu6RQs7t0tmAmc7sDj7/kUMAWpWKhgdG+Fc1akx6AyrbkSq X-Received: by 10.55.133.65 with SMTP id h62mr7318983qkd.130.1510912879062; Fri, 17 Nov 2017 02:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510912879; cv=none; d=google.com; s=arc-20160816; b=LKnfj/vkk+HXCgX6pg6yeP8TLoAYh6xzDKTX1GAetq5un10uoqDMhmsFiOwA0t0IGt qoFRdclOH35SQuVEKRDtyVq+9yqd8TThLKzUyo1SoieIDWjqKzHTOWUXNVbEP9kAJtKk 4F2HMcW+Kjbwu/tg85bKCoQOpOcjKN9f5bVhR8caM2SADLBb86+Jynw2G47+KAPrxD9y CZHahewXyafv9pztzMDRReXdCBZgvMaKwV9Myy4X1//TbNwhXaxSEadomjvjXNaXjjM6 kDRa9w0VelP86Et1keTwSRqz2Io9In36Ls6wjNk23+6y9k+bFYn7m94EpaAJXnsq7i97 gsUQ== 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=kta4n6L41S0sSzyPplaWCF2l7CapYBn/NAwwyI75gCI=; b=Smvxind5NgQwbe3vHbU1lAiO3r5GLVDX9cDtIQfK9VSQFoLgzgDNyDhyCE56BvJqo3 y1K/1y2QaT/9Z8wPM4zT0QrnqNQvLgFKVDcXmXSC7QbA+avGuVhlr2vT8P5gaPUdffdb uBYS5lYq9+3oKIAQqCZxgot/zIj8qcIFNHAKyfpQ5SENRZl0zfJg2WIfkNw52OP0s4Gb bZDPzo+r6Zmo2asjB4683rekldD/HQEfMDen6/eJPDbBOgRNk6K82xRJtmJ6stodry0h O0OKLkyNFqUbfAQy8fawalwaV4D9Ts+xBC0iCfSVCxZkchORGqnrSTeQj3RWyeZoUtIc GqGQ== 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 t196si3195723qke.63.2017.11.17.02.01.18; Fri, 17 Nov 2017 02:01:19 -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 9494060805; Fri, 17 Nov 2017 10:01: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 0516E607B2; Fri, 17 Nov 2017 10:00:32 +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 68C31607B3; Fri, 17 Nov 2017 10:00:23 +0000 (UTC) Received: from forward106o.mail.yandex.net (forward106o.mail.yandex.net [37.140.190.187]) by lists.linaro.org (Postfix) with ESMTPS id 85C15607AD for ; Fri, 17 Nov 2017 10:00:17 +0000 (UTC) Received: from mxback4o.mail.yandex.net (mxback4o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1e]) by forward106o.mail.yandex.net (Yandex) with ESMTP id E159F781C58 for ; Fri, 17 Nov 2017 13:00:15 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback4o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id SCvA7IUpNI-0FvaDnXn; Fri, 17 Nov 2017 13:00:15 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gGHK4ZnQM0-0EJ0MwJc; Fri, 17 Nov 2017 13: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: Fri, 17 Nov 2017 13:00:10 +0300 Message-Id: <1510912812-30854-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> References: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v7 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: 79753e89098ca8ff03331d8983a575c41ec60623 **/ 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..ec06fe56e --- /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 { + /** 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 Fri Nov 17 10: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: 119145 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp317071qgn; Fri, 17 Nov 2017 02:02:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMaNwaZFf/WlJuOLquz7WIw5UrrwL5suUqYCiRHXBrgLT7mnQ9D82/YwZmyPGcvIXDqm79fI X-Received: by 10.233.216.70 with SMTP id u67mr7697985qkf.133.1510912964094; Fri, 17 Nov 2017 02:02:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510912964; cv=none; d=google.com; s=arc-20160816; b=yHqMfTlxoGf7xzVUx01/cbXkk0CCBj9n/zbdlVT0ALGqDciQg6XyZvqzRK/TeQMIHa a1sxrZtEvjKCDjzqfZcvWF2hCJSJQXrJ8rUyjQ7iYdTpAwSbVOXX++ljkf+CcqpNB74a nGijnW/75rxvJFs6MqWJ2RtYwHOFL8Zm88+FcC0Dn3p2Y1pNCOxyjPIDDjo3neZVNLJ+ fbu6azFhbyikxf13Zdad3VgSXZd6iehG0hGb5tMTRlLoFp6edy5GrLK+cr6K6CxBVTc3 lYDIM4YihxPbPFfwvBCIR+6kgg1JsbF8Y4n9iXVPaZuBLUlg+piEKK7FWNtJAyoEltyo s6Dg== 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=OmYxQQ8abf44yxvEfemTnbJNED7iysiLXmwyBoj7Jlo=; b=c4wDOOTjek8j1SAtbrTE593esXUNUEpR+NmDrY/wOhJo3iQepG8ihaYPH9nuQMjBtS WXzuIWK0PtGzUd7HLFvoELNjsGPAXQHr9RQ13/st7nlhNclM4gtZ6EhcjDmHp73EwETh CKmsEt0psU9rp8i9LADiwgAAKT2uUvtsBjmiLRzTNYjFnTHlAWOYpCiuQzIUDH0Mj9YY /B3ANl8ON02wsZQevWHStXhnwAJqxcD/RQ1RLJpqAvNZgBHXwJ/ecyA9V4S3ubmOzTyG Mqexot2xosDof9+DXfCRHOYgMvzyXeMjCJ5xHcSbsVEm2zppYaueM6lY9UqwlyeUAp45 hU3g== 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 j29si3240564qtj.339.2017.11.17.02.02.43; Fri, 17 Nov 2017 02:02:44 -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 C005B607BA; Fri, 17 Nov 2017 10:02:43 +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 2777F60814; Fri, 17 Nov 2017 10:00:51 +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 2EF1D607B2; Fri, 17 Nov 2017 10:00:30 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 759B9607B2 for ; Fri, 17 Nov 2017 10:00:18 +0000 (UTC) Received: from mxback3j.mail.yandex.net (mxback3j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10c]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 705E32A21A5C for ; Fri, 17 Nov 2017 13:00:16 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback3j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lJeHoV8fKf-0GjWf3gL; Fri, 17 Nov 2017 13:00:16 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gGHK4ZnQM0-0FJ0McfR; Fri, 17 Nov 2017 13: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: Fri, 17 Nov 2017 13:00:11 +0300 Message-Id: <1510912812-30854-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> References: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v7 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: 79753e89098ca8ff03331d8983a575c41ec60623 **/ 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..faaac8ba9 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 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 red_enable; + + /** Threshold parameters for RED + * RED is enabled when the resource limit is equal to or greater than + * the minimum threshold value and is disabled otherwise + */ + 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 +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 Fri Nov 17 10: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: 119143 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp316220qgn; Fri, 17 Nov 2017 02:02:02 -0800 (PST) X-Google-Smtp-Source: AGs4zMaaWNbAfRk1SkH+Hv290hoX2yRi0Awny+bwhG8eZirC+vz7PG5bqIAi6Tdo9memyjyyLzT0 X-Received: by 10.55.21.200 with SMTP id 69mr7345419qkv.286.1510912922216; Fri, 17 Nov 2017 02:02:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510912922; cv=none; d=google.com; s=arc-20160816; b=w9M2prgpnCJk9fs5Wp5ciFbPMEzZ7tFpJbhdlMmH77HV2pump6og58SDNUZ4l48jpu CHqzvc5049x2Lmbd22NWEDA5Fzi1nO0+1kvutQEjCgUY+INEkYZV1yZC13G4n34zeJn6 xIY16R//P+64Kj1vbRBpbUwObtFmm1GH2Pln+RsiUMj9LgRjjzkyWYx7/DkfR+reAqCm 7PK9BWJnhU+hNHo7ANNJNnt9kmjfUrW/QFxJWOlwjxuMhFHXLwl18b2i7dwR7nioPrmV nPEGNBbKmRE8FW3C5PCHRaLbUBKIWdiuGlmPlSF1ANY3db9buiTuojbFGXT+rmxZgk3/ 7oQg== 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=MFZ5Xw1aviX0ezNGo+8/HVrzzcsOOlLMdZpMxtCbSDE=; b=iRRG1eWX/ppu4oc0BRxfusLIzYYQByYP7U6hOpiZRpExa23R93xN7vvb4yE019FDH0 UdyBClM4p0kWenQ9ZOxKm93Z1hcZ6gYnuUPGymp1GwX2cCE6bBMHl43b6ciDfyzANoc5 i2ImjRpxdx0z3QLCW1+9nc5+dLssrobCZSS3XyBtYOImKBT7pWN1lydK2ZQFLe72G2oL sBNh5nVYxqbVDx3uQxpei71uZVvkhI/SbiHsKX0Kj1WSsqOU3P1bycWUr7UgTRqH1RnP SwXeSmQOmfS0j4dQL1gR28dpGaENpgL8IBwmP/ES2UXqlh9CyKGCzl74uFnG+TigFuNQ obrA== 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 34si3297047qkw.125.2017.11.17.02.02.01; Fri, 17 Nov 2017 02:02:02 -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 D6C00607B3; Fri, 17 Nov 2017 10:02:01 +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 A0664607DC; Fri, 17 Nov 2017 10:00:40 +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 0631C607BA; Fri, 17 Nov 2017 10:00:27 +0000 (UTC) Received: from forward104j.mail.yandex.net (forward104j.mail.yandex.net [5.45.198.247]) by lists.linaro.org (Postfix) with ESMTPS id 67562607AE for ; Fri, 17 Nov 2017 10:00:18 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward104j.mail.yandex.net (Yandex) with ESMTP id F150844488 for ; Fri, 17 Nov 2017 13:00:16 +0300 (MSK) Received: from smtp1j.mail.yandex.net (smtp1j.mail.yandex.net [2a02:6b8:0:801::ab]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LwgzHGI1hl-0GmeKIWL; Fri, 17 Nov 2017 13:00:16 +0300 Received: by smtp1j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id gGHK4ZnQM0-0GJmXviV; Fri, 17 Nov 2017 13:00:16 +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: Fri, 17 Nov 2017 13:00:12 +0300 Message-Id: <1510912812-30854-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> References: <1510912812-30854-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v7 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: 79753e89098ca8ff03331d8983a575c41ec60623 **/ 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; }