From patchwork Wed Nov 15 14:00:18 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: 118951 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4355064qgn; Wed, 15 Nov 2017 06:06:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ9IYP7vyFaN5slz4eg12PbYwJzsFjgCtIp4+sDndtHKqTjbOg84fgSPZ9qwjazuYQ0pzpE X-Received: by 10.55.204.205 with SMTP id n74mr25804385qkl.25.1510754772457; Wed, 15 Nov 2017 06:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754772; cv=none; d=google.com; s=arc-20160816; b=QpPjgYuDtbb/9GYqTLoTQOW1uigJV/r9itDopdPt/z/sbVdMLVcjCz4lUQUsAZD5Vi J9NRw7aKy5rd4CSchdyjag5DjJvcdadz9M1e6UvyWgn6p3JzSC8O78l5Y4UTnlY19hxE qqxANf71ZbpqzDWv2EnUb5j74mRxwiav77EjPx/tcRtnf+OjTNJ35IR6PXKBRDc/Gbsi oN117fAjk8gmRlIVYazfrDQtsWwMjbqrD3X4p+XdowT5mbJieweqrSx7T+FSW0GUPAeV oalqntmfJKMAUFcbD4dkSfByRgeZ8yiIKPRGGz6LPZ0b7l3sUdwOJ/t2MfMYQXsph4og OJDQ== 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=uCc9STbGoGo7LlPw5yTK94iScvbKim0MQHITX8V9rYE=; b=qcBY5tYgSz0Litun5m82Yr3gSeCOeRRAKSUh2TfN7ThlPyITa8ZywWHvX/mjmwyJHx ppYBCCReCQ18HyUpYTS5fekqGeJgr0D541opLFfHEs0BslwIuubGaXhUiwzhJ1ahpGKe HDj8/rNzFKKyG60vQQMDjEIcBZIYuHS+4JZxAViDjK39a/s259v/QkDBdDdZordzw7Rg odPZjBA1j+iZtOVfSRQHkhVQcIBMvOUOask12CAGHGrgARHW0Gw9sbzpulYr9DlJ9M4C J9oPEwNc/dH7KYtb0Hnf1JSagSUzDK04h7J3psRIMNOx2wMdd3MbAQAJUPC3TaXfwJBZ jRTA== 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 j65si329833qkj.244.2017.11.15.06.06.12; Wed, 15 Nov 2017 06:06:12 -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 E41C2607A9; Wed, 15 Nov 2017 14:06:11 +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 679DC60810; Wed, 15 Nov 2017 14:02:29 +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 8160D60804; Wed, 15 Nov 2017 14:02:16 +0000 (UTC) Received: from forward101p.mail.yandex.net (forward101p.mail.yandex.net [77.88.28.101]) by lists.linaro.org (Postfix) with ESMTPS id ED6F460723 for ; Wed, 15 Nov 2017 14:00:23 +0000 (UTC) Received: from mxback20j.mail.yandex.net (mxback20j.mail.yandex.net [IPv6:2a02:6b8:0:1619::114]) by forward101p.mail.yandex.net (Yandex) with ESMTP id E1B956A82E83 for ; Wed, 15 Nov 2017 17:00:22 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback20j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id IS4cPCYlAm-0MAmjxgv; Wed, 15 Nov 2017 17:00:22 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 1e1o95Ghl7-0MvCK8iN; Wed, 15 Nov 2017 17:00:22 +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, 15 Nov 2017 17:00:18 +0300 Message-Id: <1510754421-26137-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> References: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v6 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: ba93e355ddf151215aa18b59cbfca08fe175fe65 ** Merge commit sha: 1c3ff9a77c88059189428342ddcb563eaee2f74c **/ 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 Wed Nov 15 14:00:19 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: 118953 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4357321qgn; Wed, 15 Nov 2017 06:07:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMYnk279UgGbKupSoyVa9G6idJ7ICAXqh/B9uHqs5lvvW+wLdkTBNOvSyRkyHNEuN84wWZgc X-Received: by 10.237.39.211 with SMTP id m19mr23471483qtg.93.1510754865506; Wed, 15 Nov 2017 06:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754865; cv=none; d=google.com; s=arc-20160816; b=yq+XkAQf+JLPWmTqMENXCsg+R4Fb81+/GSDoxls/kUxulmAdy3ZQ34U4JcVyFGNVDQ 17A8d1+CA11kik1tOfmZCxQntNuUmbCTAFpdYepUJK+sm0XchuNyMnommfdZ5GwTHBn6 wjauQU+3r8Cr+BBjaKUYHJxOFM1k2gxn3zj2HJwYaufUbnE2cLOO8tQZcyhX5zGnGACW wiS2VS0Q7J/T/9oo6TBNeYQ599IPkAYpEj+iTqhNKSgBMCgbMF7FTmxoFSkoMqQhBgGc Kk4zMwNrlnM7MescFR3up9OxBz1pShI3LRFrY4n37SasDerGWGdU7Gx6pcrvM5oUSc6b eQ0Q== 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=IXjntQ+htkRatvkOFAdynyjbjsYNxJjWglSgT+PK9II=; b=ffjmi5wfWAuDa0wvb+O1dF7fhmAdy24+KkwON0VzHE5Ckq9NGxJ0148IGkMFKvCnuI fEE+2fTbhIfZg9O1BDGImwHtguBsSXSVDcwU97Zu18jBI1/TzVnRo1csxKPFrqQ0uRlj +G6PSUwQulz63q/ZkuohWAdk0xt6ts8w0kFfdDw4yQJtTr1iU89TevUpeQ9XKxRtVEGm 4Ji8QAMxisl2ZmuUJfA/utkyhum7RR73Zh5J/tLDZrjjfeyIz/YSsDjJ/GvCk3pVl4Xb jzi08tjgk/Y8xwX/nAvtm+cvXz6LCfUfeOAi3+8GKA/BYdczo7Nc5igeNdzU/n0BauC/ dLWA== 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 k190si1098166qkd.376.2017.11.15.06.07.45; Wed, 15 Nov 2017 06:07:45 -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 2134760856; Wed, 15 Nov 2017 14:07:45 +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 65E1B60805; Wed, 15 Nov 2017 14:02:43 +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 F3C7360836; Wed, 15 Nov 2017 14:02:32 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id E773C6072E for ; Wed, 15 Nov 2017 14:00:25 +0000 (UTC) Received: from mxback14j.mail.yandex.net (mxback14j.mail.yandex.net [IPv6:2a02:6b8:0:1619::90]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 436E9510356C for ; Wed, 15 Nov 2017 17:00:24 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback14j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id qkvu9cdydW-0NVSdf21; Wed, 15 Nov 2017 17:00:23 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 1e1o95Ghl7-0Mvm80AX; Wed, 15 Nov 2017 17:00:22 +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, 15 Nov 2017 17:00:19 +0300 Message-Id: <1510754421-26137-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> References: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v6 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: ba93e355ddf151215aa18b59cbfca08fe175fe65 ** Merge commit sha: 1c3ff9a77c88059189428342ddcb563eaee2f74c **/ 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 Wed Nov 15 14:00:20 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: 118954 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4358372qgn; Wed, 15 Nov 2017 06:08:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMaIFUk4kUZs7uB8GK+d9KFacL41VyVfu/SEd9keA9KQixfUcbCSVlluGjDtriRXpZLZtAFz X-Received: by 10.200.25.177 with SMTP id u46mr18995502qtj.282.1510754913560; Wed, 15 Nov 2017 06:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754913; cv=none; d=google.com; s=arc-20160816; b=UnMk6RtCUlCPmW6XAE4Kiro2/Pqrrk3UKgs+XnFW30AqSawmXJLBwi0oONpUnpOKt2 kPj8xJomQx9B2n5S8FY1OiCJRQBbOv4Kqcwkz/wlVHtOdYCMUhJh9eEzU3TAgapzbjwb UvH6mi+SYy9sr0i4kUe3Yug5Px6D0sAj5PA3cTLylBdKqtxFxd4Peq42iNfGLDLUc51E okrgWBjLp0dCGv9sgFmTnLgxccfpIBIusaV4+NoDifIM+FGNdZlcSrbN115IJpHksMxp 0wC38IWmtBkIxQ5v8AMKSVWJX/Oa+22mtg/PhyURSrsxkeTnOVZTbY4Cj7ThDwltADhc B7eg== 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=qeHo7VptpNDaBxqPX6yw13wjP2I/dtDbzxiZd3OSmAE=; b=gqr9PY8t7nM3itypBdNsEO5zyN6l04tGTCqW4dHUm1OVPNXLfQPWLmO8/GLikRiWji bxFtdK2WybK9wSpP6no+KJbqPqjnMYbVsVXg3ehHYNT/vfrk0XP8DlcGoUrh9IFbRKb+ Zze3ybFTVNqNGnCakHI5Esq9/QTRlZ6FCEgA2OwULv57Wqc/gF72NSPG2JU/Dr7YsFnq xqlM4OZRwn4avfVbxO3gNLIu4ZMDNendWqfBWI418QT7Wv4D3irEvqrx1az2fqKNijYx TJ1tFFhznSMQROeqomnb70tM3ANAtE6QKNmjopQuFR3ZK8+PbpBONn+zVRfe6do54cpZ 4HIw== 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 q32si8154867qkq.242.2017.11.15.06.08.33; Wed, 15 Nov 2017 06:08:33 -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 462F560805; Wed, 15 Nov 2017 14:08:33 +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 9B92060804; Wed, 15 Nov 2017 14:02:50 +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 8770B606B3; Wed, 15 Nov 2017 14:02:33 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id E952760690 for ; Wed, 15 Nov 2017 14:00:27 +0000 (UTC) Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 1A6BE44452A2 for ; Wed, 15 Nov 2017 17:00:26 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 1G2f3SBHDf-0POSTIZ8; Wed, 15 Nov 2017 17:00:25 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 1e1o95Ghl7-0Ovul9Ob; Wed, 15 Nov 2017 17:00:24 +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, 15 Nov 2017 17:00:20 +0300 Message-Id: <1510754421-26137-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> References: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v6 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: ba93e355ddf151215aa18b59cbfca08fe175fe65 ** Merge commit sha: 1c3ff9a77c88059189428342ddcb563eaee2f74c **/ include/odp/api/spec/classification.h | 67 +++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/include/odp/api/spec/classification.h b/include/odp/api/spec/classification.h index 0c4a95c5f..ce7a4eae2 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,54 @@ 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 between the + * specified threshold. RED is enabled when 'red_enable' boolean is true and + * the resource limit is equal to or greater than the minimum threshold value. + * 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 becomes zero when resource in the pool/queue is less than + * or equal to minimum threshold and it becomes 100% when resource in the + * pool/queue is greater than or equal to maximum threshold. + * 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 +184,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 +267,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 Wed Nov 15 14:00:21 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: 118952 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4356066qgn; Wed, 15 Nov 2017 06:06:52 -0800 (PST) X-Google-Smtp-Source: AGs4zMaKQ8wg1PffH7Pf9OLLRWn3Qx65R7e5hdd38dJ4mff7gwh/rUuIOUXzWaAh08hZAIp3yLH5 X-Received: by 10.200.46.119 with SMTP id s52mr5183268qta.192.1510754812091; Wed, 15 Nov 2017 06:06:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510754812; cv=none; d=google.com; s=arc-20160816; b=dkxajAeTr8zs79kKmnXMFFLDrq0Xogj4g7xbm18YHKpqcMXPbCtjjU0Xn39AtxEt0l PxX8/3BviejvGUX98sImSVZi46RW8WlJiOrXNnm2cGfWIgDEPnHJz9pa21fLccSRg1xZ 19xh9qBs61Jb3m5PlCXkLUiHHZE1M4EBoiEouNGje3Vr3qWXfhwe5aleoCC5f/iV6lgr m3NfFOeBK1M0LVx92rlFghjNzmZEMs0ynR9sbeypT0isp9ts34hieqEy4YfLXzm/1LUG iZqCGQT2L7wJvP7T8EFu94x3Vfm3PHQS8AM0PunvvI4mRHJRzH3/dT4v2ji4ppKU1Pok 5AsA== 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=a83wdsUvAcmhXTLUgydSr4k77DGbFA/rA2Ncqoauyyg=; b=eQ7SRZEfPzltGmqXDby/0xYIcCCvPeIaqU1CiM4A8yTAsBjO1+3wQ1IgjGx43JTtZZ AMJAZ3MpS550Xt9X62gwt9bSfgyu/DbiLxoPG95xDeCgzxZdry12/YA8HdhetS4rQDx7 9KZNwJkuwdar9SVTJy25DgF6kaJG7DvMNtyszN11J+mPbcExEoebj23VFRt9nkNrL/UU MoAaWxQdbPlqjoYcsz7d2ekddJYBeXssvdU2z4c1nsV/+pWTzUJCD/0IuJL2NavFGRHj mHC1OLj+4YR9G3FpkkIzZ85Ts82x7i3SoxO2XUPVP6dzJuF+Xl1BLDhbIzVER4G0aQog frMw== 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 8si2884504qtp.6.2017.11.15.06.06.51; Wed, 15 Nov 2017 06:06:52 -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 B9648607F9; Wed, 15 Nov 2017 14:06:51 +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 E209660690; Wed, 15 Nov 2017 14:02: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 5928660836; Wed, 15 Nov 2017 14:02:30 +0000 (UTC) Received: from forward102p.mail.yandex.net (forward102p.mail.yandex.net [77.88.28.102]) by lists.linaro.org (Postfix) with ESMTPS id 4E22D6069A for ; Wed, 15 Nov 2017 14:00:28 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward102p.mail.yandex.net (Yandex) with ESMTP id E05834301CFB for ; Wed, 15 Nov 2017 17:00:26 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback11g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id UhLUDTLAPv-0QLig2HZ; Wed, 15 Nov 2017 17:00:26 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 1e1o95Ghl7-0QvaxIbn; Wed, 15 Nov 2017 17:00:26 +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, 15 Nov 2017 17:00:21 +0300 Message-Id: <1510754421-26137-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> References: <1510754421-26137-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v6 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: ba93e355ddf151215aa18b59cbfca08fe175fe65 ** Merge commit sha: 1c3ff9a77c88059189428342ddcb563eaee2f74c **/ 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; }