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; /**