From patchwork Wed Oct 25 11:00:15 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: 117102 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp703821qgn; Wed, 25 Oct 2017 04:00:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QO8SvOUE1+Dz8+eWHYte0gqqYcTlT+4GQh8HSMF4aTpQfSSF8Of4C2nvkIc5leoozxfoCP X-Received: by 10.55.159.88 with SMTP id i85mr2339318qke.350.1508929258366; Wed, 25 Oct 2017 04:00:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508929258; cv=none; d=google.com; s=arc-20160816; b=OuyUIznmmGNme9SO3DK7/U9fgzzSvsA3MFg0z29YaeG5JJhPGJeOlvY9NYJgJV2gUO 9zbaEHZCBu0U1w9VXeHgzHTPc48IWy90ni4/h2nRUsYrqYDWBBn2sviCMGiIoVXDWpEp mwtd1PGanS6o8HMRI2QnZOxosmsdixHwd2ZZRFO4r9vYWRT1jvSWJ0mVbaDIgVwRYP+8 p0QtrwP49PnDG4cIgW4uwk/SLA6xFyS3bmcYhfIzxlUlDNcvK2klDJ8ccQri7TonPW/j 1OPkhtqqQN9vUS470gO48JdfMI19+dWfFBnP8HXxG6IOvX3W7H+/HLuZCGHhln3Ba4CV dImg== 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=DSAAMqo7kzE0J/TkvzuEzIZRHLIXygSieNkEBuMP1fk=; b=M2Q1JTjRyutlHA2g1Mt+gNiUbU9IsSJtzPmBLf/Unn8UZL8kstkHoqpDCmtGTMJbQv ECuqF1jMqRhgGBRmUBrtA28JWzxyZAloYa8VowrBpZxEL0RfM4YTTb34CNAYcJWnQ8fr F97FFuxhwpmaKnIVP93OoX2L4BFt5ZJsTj/bCMsSNeXLFEgS3qRhKksrE9Q4QiQQP70G 4LYOhDO3scEqgedEmvx3DkLdFpJshmbbZY9r5EfQcI9UBeh0ZR6SZDzCErqQ1uAT2g/u E9MOOj+ovlJccBg4xsJGSnetAozuoZIWN3MHYk8HqFXbijJMkmV35EJ2ZiHhYD8+Zqaj VsFA== 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 v66si2093219qkd.230.2017.10.25.04.00.57; Wed, 25 Oct 2017 04:00:58 -0700 (PDT) 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 8FEA260ACE; Wed, 25 Oct 2017 11:00:57 +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 85D5B60981; Wed, 25 Oct 2017 11:00:52 +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 8E06060A76; Wed, 25 Oct 2017 11:00:44 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id 2608E60981 for ; Wed, 25 Oct 2017 11:00:42 +0000 (UTC) Received: from mxback10j.mail.yandex.net (mxback10j.mail.yandex.net [IPv6:2a02:6b8:0:1619::113]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 89F0A44455D8 for ; Wed, 25 Oct 2017 14:00:40 +0300 (MSK) Received: from smtp4j.mail.yandex.net (smtp4j.mail.yandex.net [2a02:6b8:0:1619::15:6]) by mxback10j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id rRnLVgDcep-0eSW6GJe; Wed, 25 Oct 2017 14:00:40 +0300 Received: by smtp4j.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OZKatYosQH-0e70uGT0; Wed, 25 Oct 2017 14:00:40 +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, 25 Oct 2017 14:00:15 +0300 Message-Id: <1508929216-1022-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508929216-1022-1-git-send-email-odpbot@yandex.ru> References: <1508929216-1022-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 172 Subject: [lng-odp] [PATCH API-NEXT v12 1/2] 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 172 (bala-manoharan:random_early_discard) ** https://github.com/Linaro/odp/pull/172 ** Patch: https://github.com/Linaro/odp/pull/172.patch ** Base sha: 825f75ed8644ef57c5648961e7982daf13cd9375 ** Merge commit sha: 00781af865ca4957425afd4ef3d6041aa63244e0 **/ include/odp/api/spec/classification.h | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0c4a95c5f..1ed0dcd5c 100644 --- a/include/odp/api/spec/classification.h +++ b/include/odp/api/spec/classification.h @@ -135,6 +135,13 @@ 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; + + /** Support for Back Pressure to the remote peer */ + odp_support_t back_pressure; + } odp_cls_capability_t; /** @@ -206,6 +213,53 @@ typedef struct odp_cls_cos_param { /** Drop policy associated with CoS */ odp_cls_drop_t drop_policy; + + /** 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. */ + + /** 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; + + /** RED parameters */ + struct { + /** Maximum threshold value for RED */ + uint32_t max_threshold; + + /** Minimum threshold value for RED */ + uint32_t min_threshold; + } red; + + /** A boolean to enable Back pressure + * When true, back pressure is enabled and configured with the BP + * parameters. Otherwise BP parameters are ignored. When back pressure + * is enabled for a particular flow, the HW can send back pressure + * information to the remote peer indicating a network congestion */ + odp_bool_t bp_enable; + + /** BP parameters */ + struct { + /** Threshold value for back pressure. + * BP is enabled when queue or pool size is equal to or greater + * than the backpressure threshold. BP threshold is expressed + * as number packets in either queue or pool. */ + uint32_t bp_threshold; + } bp; } odp_cls_cos_param_t; /**