From patchwork Mon Nov 6 13:00:02 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: 118029 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2740521qgn; Mon, 6 Nov 2017 05:03:10 -0800 (PST) X-Google-Smtp-Source: ABhQp+T9B9+OSWgM6D2Q4v/PAF0MUqglK+Q+rVacb+eRl3ZGMVuA10s+8UjDqoKSoOGWNOC/pxFn X-Received: by 10.55.46.3 with SMTP id u3mr20877749qkh.340.1509973389997; Mon, 06 Nov 2017 05:03:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509973389; cv=none; d=google.com; s=arc-20160816; b=hG+wyN5PQk5dtraNsrfgEhq4ty/mJ8bAHZZMXio48/KD5SL/8x4AUYnX5sqJdn5FyZ J3rFqw6MEh45BHUd5O7CYrTChD/M2jtAfj20ps9vurWmm7QIm11RmOePYfZnNVMuJaiH uFPeGIyAc/LrK0pyTLvRAAOMez7d3I3BWBH1x5jHs83CEhmI+kDMOv561yjcMuk9ujb7 8NRNcQG9TwfxU6BhX/jesdYwdcFnXEwR4IvO4H1e/dGjexaxA+4+r4X4ovXrWS4hZL7d qUCrFcDvdANA1isOAx8Hfu9arqcPOun/Lw+NOnspL6Bh3enYx1Yde9r5TIMZMfOQ+Fn3 6f3Q== 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=MnsKMVtlCez45ewlXShn7Rv6yCxkB4k07D6rHhOc15g=; b=RL519XM6ZKy5DZvtxPtXUV4n0hhOYaFAciGifUuCQjGcVOrQJuAej5vB7YsO+1pwPl PZkKuubz1ORIAA4BYo099LrNs4fGgwh09m0c8qidLW7qmTwOwm6EfsxM3OqRuHsaEUU5 K2zCzBOsoeb7Qzb9Qcg7UOLL3erhVEYQElMC11DWI4jElV1g3cyYg7MparkdqNvJwkd0 NBsG36Lo38PgKeqZilc5qna5xrqGYarSVk4m9pAMVKAq0BLjYSzsjt0dX71V+JZynwNW YbU0t4idUHEss/AhRjJehqj9JMxjO6uONgYMFPxjmfSB5Ya1WARjP9T59o9e2IoUf0dO 0Heg== 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 l22si2382228qkj.89.2017.11.06.05.03.09; Mon, 06 Nov 2017 05:03:09 -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 B3C7160C0B; Mon, 6 Nov 2017 13:03:09 +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 A861B60BF1; Mon, 6 Nov 2017 13:00:38 +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 48417607A0; Mon, 6 Nov 2017 13:00:18 +0000 (UTC) Received: from forward101o.mail.yandex.net (forward101o.mail.yandex.net [37.140.190.181]) by lists.linaro.org (Postfix) with ESMTPS id CF9576069B for ; Mon, 6 Nov 2017 13:00:11 +0000 (UTC) Received: from mxback18j.mail.yandex.net (mxback18j.mail.yandex.net [IPv6:2a02:6b8:0:1619::94]) by forward101o.mail.yandex.net (Yandex) with ESMTP id 51CDA1344CAD for ; Mon, 6 Nov 2017 16:00:10 +0300 (MSK) Received: from smtp4o.mail.yandex.net (smtp4o.mail.yandex.net [2a02:6b8:0:1a2d::28]) by mxback18j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LTIKUJRFLm-0AdmFrIr; Mon, 06 Nov 2017 16:00:10 +0300 Received: by smtp4o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id nU8zA9xMmR-09hGruYs; Mon, 06 Nov 2017 16:00:09 +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, 6 Nov 2017 16:00:02 +0300 Message-Id: <1509973206-1972-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509973206-1972-1-git-send-email-odpbot@yandex.ru> References: <1509973206-1972-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v1 3/7] api: red: 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 configuration parameter adds back pressure configuration parameter 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: f8726f45026a85ce1dde794190c1eb35945dca3f **/ include/odp/api/spec/red.h | 79 ++++++++++++++++++++++++++++ platform/linux-generic/include/odp/api/red.h | 30 +++++++++++ 2 files changed, 109 insertions(+) create mode 100644 include/odp/api/spec/red.h create mode 100644 platform/linux-generic/include/odp/api/red.h diff --git a/include/odp/api/spec/red.h b/include/odp/api/spec/red.h new file mode 100644 index 000000000..c1aee238c --- /dev/null +++ b/include/odp/api/spec/red.h @@ -0,0 +1,79 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP RED + */ + +#ifndef ODP_API_RED_H_ +#define ODP_API_RED_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** 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 can be configured either in pool or queue depending on the platform + * capabilities. + */ +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. + * Back pressure can be configured either in the pool or queue based on the + * platform capabilities. + */ + +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; + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-generic/include/odp/api/red.h b/platform/linux-generic/include/odp/api/red.h new file mode 100644 index 000000000..8bd1596e5 --- /dev/null +++ b/platform/linux-generic/include/odp/api/red.h @@ -0,0 +1,30 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP RED + */ + +#ifndef ODP_PLAT_RED_H_ +#define ODP_PLAT_RED_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @} + */ + +#include + +#ifdef __cplusplus +} +#endif + +#endif