From patchwork Wed Nov 8 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: 118262 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5330203qgn; Wed, 8 Nov 2017 06:05:04 -0800 (PST) X-Google-Smtp-Source: ABhQp+RS3BgXBK2ZpPWzpOUYBlJOV12PtO8Ux8xnKtNtS2GTFI0S9FEdy+CZeSUzVd09PGr9S3tB X-Received: by 10.36.85.139 with SMTP id e133mr755642itb.147.1510149904569; Wed, 08 Nov 2017 06:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510149904; cv=none; d=google.com; s=arc-20160816; b=J4QyGUOMFxaYoXw3FnGxN4WsSPvDmnCrpjVF78IcNn77ZvkjDEwPy+EADwDAxjeA61 +TDIlqc54+vZ4ZbSF0ZaC0cVJ90P9bOmIiNNRbH7QzXyoGpA8IcNnbaRisQOuT56wW/5 vG6C2Ils5F52EaZB86e7p5FBct9P7CTwvu0DSl/S4KpjXoVIk0ey34oqSo4AAHxy32YC sq56FPxDVtaeieHONCt7ZThRoWBaAZJnbU3/GeQlOHYangwOCgfoYWPCFcDGpgAphZ7L eWRC5GQEK3e2BTxNdpGpV04Ps5NddOfWZtoOQcHIdJWP2Gc1h/Fbhn83NNqw4o9twc/9 NJCA== 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=22Mxs4xIMv29dshChbApRAz8j5kxjdx25sNjWiVlaC4=; b=oFFqvcSzHSG7BeGI2jj7whABaYWGcM7O3h7QGCK+dccjTH/xCA9TfTcONBK/vMTko/ gZHsvrpyf5hksE77TVSbkN9bpNrY942H/PnYA4IPs4AU2dP5CCYKkqFgaownjLwSqZ1x rWJsZYefNfOXkGRm2Xk3WoQQ6/qmlzRnyt9muVFXuzB2Y9XbT4JPwWH0p1KsgY9znD5m LFdw7ka4KMrlznnH40CJ63B3QiNxKYaBYYWwJcriG7H9rWDJx6kTPfd80qluFUYf2+EP RROYM/9axtdaHI2Qm+cyv7N3SOZw9s+KwBFTjh0bOhNdyErHPHE68yqfmVaVsuoydF/y f2qQ== 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 v132si3556780iod.270.2017.11.08.06.05.04; Wed, 08 Nov 2017 06:05:04 -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 E858F60C88; Wed, 8 Nov 2017 14:05: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 9748760C29; Wed, 8 Nov 2017 14:01:01 +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 1EB97606A1; Wed, 8 Nov 2017 14:00:28 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 322DB609B5 for ; Wed, 8 Nov 2017 14:00:19 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward103j.mail.yandex.net (Yandex) with ESMTP id D5C5034C411F for ; Wed, 8 Nov 2017 17:00:17 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WlhTqbXnlO-0HpOBlI5; Wed, 08 Nov 2017 17:00:17 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YHHquvKMKk-0Hh8vAa2; Wed, 08 Nov 2017 17:00:17 +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 17:00:13 +0300 Message-Id: <1510149614-31459-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> References: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v2 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: 4c2f383b93c80fa98e8e676897db02dbc8b56112 **/ 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..d9f42c99e 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; /**