From patchwork Thu Nov 9 18: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: 118476 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1222061edl; Thu, 9 Nov 2017 10:04:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMaS8D3eMmthxH4FkZamfU/IZZAhc4PXi7oyFJH+PNztljFn0fsP03w/pL1PAk6vPKwhXsMh X-Received: by 10.200.43.193 with SMTP id n1mr2290975qtn.101.1510250690115; Thu, 09 Nov 2017 10:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510250690; cv=none; d=google.com; s=arc-20160816; b=eacsXaBmd4QxxhX3OR4EJy/uwg/jsitxwBRr6aQXG/WZeHjSrUfvjysu8LVqR8y3Vn LJBPnM2MI6t0BxU+0ytwOt0q+4fjGuFkyqzuWtUum+nLEtl07uW1bOvZ9UimQz26GQDv xlmwbb4lcmHbRdqvfreT6mAKIkIqUy9Pe0pM6Yvr/grNFiNG7EMOcNkuHF92qo/QWzpj EYkS0iXYjfLEkbTWW7edC6yDFzOlkAclBBOGH1H7pMGZoI5q5jH6QF/JncHgmVZ0URDM WU5LSPQS6+r9bSEj5Af8fAydBcb5J/IrBG2BNZdlWeGk4UsLCHHD2x/an5jdgjkL6VvB LwIA== 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=LNmDAEoDIxq+siyiTQZyHWi+JazNXovQJX/txc2YGmY=; b=OghWXCBfYjZIlqcYhtZhJ7kM6gVmcAfezQ2VmywCHVQV3G6taTCyamWyi+ucRCidCM 64Crsob2kZlaE70lug6M8y9g8qYETNawTziwdO/bZb1ytks5Wfaldkx2o0e5bBMrFJo5 GsRbGccASbX3eJ5xC0z2F8c4fq6h09ZJznJtf8NXkv/N1wk4E/OU846V+KHtdnMi/DUo BXoGI+aFo3yBwwttTEzDgwpxvtFvF/Ec3Qw3SLZvm9cp21oHlMm331wypRfrQuHArvpm +WM3mhQkk89pUtPmnUOtCBnf51s4CZ2GhIk+gI1NRIMsPnvjpzrhBh6LRVKIQx2KEOMn fnOg== 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 a124si437261qkd.293.2017.11.09.10.04.49; Thu, 09 Nov 2017 10:04:50 -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 AF1AA60CCE; Thu, 9 Nov 2017 18:04:49 +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 0D9CF6101E; Thu, 9 Nov 2017 18:01:20 +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 34B9060A54; Thu, 9 Nov 2017 18:01:03 +0000 (UTC) Received: from forward103p.mail.yandex.net (forward103p.mail.yandex.net [77.88.28.106]) by lists.linaro.org (Postfix) with ESMTPS id 337EB609FF for ; Thu, 9 Nov 2017 18:00:20 +0000 (UTC) Received: from mxback5o.mail.yandex.net (mxback5o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1f]) by forward103p.mail.yandex.net (Yandex) with ESMTP id 0DA4A2187BB3 for ; Thu, 9 Nov 2017 21:00:18 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback5o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id xArN9xlxAq-0IRGnYaw; Thu, 09 Nov 2017 21:00:18 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ej6QpjG6ho-0HnOoYmi; Thu, 09 Nov 2017 21: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: Thu, 9 Nov 2017 21:00:13 +0300 Message-Id: <1510250416-6484-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> References: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v4 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: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 0f3d27771374d5b525af19461f31d0e308b05874 **/ include/odp/api/spec/std_types.h | 7 +++++++ platform/linux-generic/include/odp/api/std_types.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/include/odp/api/spec/std_types.h b/include/odp/api/spec/std_types.h index ec6a6df6d..97f5ad994 100644 --- a/include/odp/api/spec/std_types.h +++ b/include/odp/api/spec/std_types.h @@ -32,6 +32,13 @@ 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. + */ + +/** * @} */ diff --git a/platform/linux-generic/include/odp/api/std_types.h b/platform/linux-generic/include/odp/api/std_types.h index b61f33f4c..2104db03d 100644 --- a/platform/linux-generic/include/odp/api/std_types.h +++ b/platform/linux-generic/include/odp/api/std_types.h @@ -29,6 +29,8 @@ extern "C" { typedef int odp_bool_t; +typedef uint16_t odp_percent_t; + /** * @} */ From patchwork Thu Nov 9 18:00:14 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: 118473 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1220056edl; Thu, 9 Nov 2017 10:03:12 -0800 (PST) X-Google-Smtp-Source: ABhQp+Q5O1QRo8Zea21z33NjYFY15xfDxSxJhervHEY3oaUvHC7C+qYsmiiJjJA5Jk1WI8TAbQyZ X-Received: by 10.55.4.148 with SMTP id 142mr2224912qke.121.1510250592442; Thu, 09 Nov 2017 10:03:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510250592; cv=none; d=google.com; s=arc-20160816; b=vpnqsKx54VQD++6AYAk6msTO7LIzIZ9VNkg5hxsrD9cBzBqIzUMFEEP3pC56mQeDd/ +rKswMfFj0pWRtWC4WJEWAOm0gxESkV4YmX5nIu5xWUlruZv41foq0nt6YX4ZfUlajfw zlZgkAhUXW+6WlOWYBhXgWtXU9LDLoAf8A2DaCNnPaywViJ6CksazwtEuD8f428/jDPY xjeJJzk/XP20ljcp8C7QQb8kgM47iyfRkN8wzLJ298DrGawB+PO5FpJLkTL23GZUXqr7 0tnNSfp5coeDS0daGwzuiShRIzhcrF5fwyqZFii/wZZsPJhInUQOrlaGr38OD7HrO6dO xowg== 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=vEfdLy3iFOxBw1pUgpDnftM90XElIl01ut4KW3khCjY=; b=Xy0XBzpibANvlhrQ0lxcLj2nLD3HzlBQlZXRIfU/u3AL1rW24ZtzwpZ+DQY4PYGJaS UV2rfZ7SJ/+JhaLSsYlffAR4/kRFC0p9q3HmcBt4x384rUiuOtymhoe2ILW6MnsX4XLo rMdgS9bbFTwgHqY/Fwy0MVr9cbR5f50G5dhwB8z1YvD1YSblo0TpojaJYGrnj+2gMh9M e+DFLWaMYqZgBb3K4HU6kZ1I9fw7N64Bt+9r3EqGHt4UhsCRnsAuP0ckzNmmMi6Lr483 KYJBjIhnhx+4P6fNxrW/J7IZyeAYCLNI6Z5lIVdpM+lC+1R/IjjN8ns3Me3UBU2wFGbs /AwA== 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 k186si4021541qkd.376.2017.11.09.10.03.12; Thu, 09 Nov 2017 10:03: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 254E861023; Thu, 9 Nov 2017 18:03:12 +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 2808D60B67; Thu, 9 Nov 2017 18:01:06 +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 7EABD60B66; Thu, 9 Nov 2017 18:00:56 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 3E4AC60B66 for ; Thu, 9 Nov 2017 18:00:21 +0000 (UTC) Received: from mxback6o.mail.yandex.net (mxback6o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::20]) by forward100o.mail.yandex.net (Yandex) with ESMTP id A387F2A20CFB for ; Thu, 9 Nov 2017 21:00:19 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback6o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id NmJfIp2id6-0J70Ym26; Thu, 09 Nov 2017 21:00:19 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ej6QpjG6ho-0JnCjuAh; Thu, 09 Nov 2017 21:00:19 +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: Thu, 9 Nov 2017 21:00:14 +0300 Message-Id: <1510250416-6484-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> References: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v4 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: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 0f3d27771374d5b525af19461f31d0e308b05874 **/ 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 d53181ceb..8ab150ad9 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -44,6 +44,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..48d01dd4e --- /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_type_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 pkt_cnt:1; + + /** Total size of all transient packets in bytes */ + uint8_t pkt_size:1; + }; + + /** All bits of the bit field structure */ + uint8_t all_bits; +} odp_threshold_type_t; + +/** + * ODP Threshold types + * + * Different types of threshold measurements + */ +typedef enum { + /** Percentage of the total size of pool or queue */ + odp_percent_e, + + /** Total number of all transient packets */ + odp_pkt_count_e, + + /** Total size of all transient packets in bytes */ + odp_pkt_size_e +} odp_threshold_type_e; + +/** + * ODP Threshold + * + * Threshold configuration + */ +typedef struct odp_threshold_t { + /** Type of threshold */ + odp_threshold_type_e 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; + } pkt_count; + + /** Packet size */ + struct { + /** Max size of all packets */ + uint64_t max; + + /** Min size of all packets */ + uint64_t min; + } pkt_size; + }; +} odp_threshold_t; + +#ifdef __cplusplus +} +#endif + +#include +#endif diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index c54067609..2b5056e4d 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 Thu Nov 9 18: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: 118475 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1221432edl; Thu, 9 Nov 2017 10:04:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMZLYJIX8DksPSpRUsK1XObg/bE/7t3PFvLnLUQiAJ3n1Ls8WUDlu25wBymTbaTG9ynz4lJA X-Received: by 10.55.138.135 with SMTP id m129mr2096265qkd.214.1510250655899; Thu, 09 Nov 2017 10:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510250655; cv=none; d=google.com; s=arc-20160816; b=gn+xHEr2cQmBKyjNhFOw+j9ZL1e8CA3RoXgaO2cRp3MbceugO4btvKMoEejr7kiyz7 olXwpZr6AkCsiWn2/No0AkdDIQjSIg4DfxvTJ/2BK/FvvcaWm6hgPOXcKkJ6K5KmS7Vp tTS8aKKiQJ6DwUHViRVhPNtTAttN8ksjFKA5z7nXROT2pfE5HwP2fQKV7DjZenoIlAQz N0sl/dBB7wbmaJQvxbeXcQ1P+4pKNy76dEY9WMSWWuITR6mhuyMa27WO2eszOn/IMiRI 39Kt9YqQE9AibMO+xUnYC1ZLdyT4LHzoU8e5Ff8aMIwAveuYnLDD/Je3fLl7gIxUtK3S PJNw== 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=ODlY/Rb2yqJtDtiUNL2lLKJzlsYOpDXR1iQLPEFfKAs=; b=G5TB5IHqP/tlTh+bpcXBwuSW2IKyTfwHUc/niE/Sro6PV3K71FezQP8Z4hvGjveGMy 1hv8qHRPbMViny36UL2F7arO7HZyi8xwaR5BWZkFAOOqw5eKE0caHBbwx6WTawbMZvOG qk9J6ZP8SKjFQ6o/02emR19y78bIv9/z/O4dj2sZAUBQdfnCb8NlbBZii8t/o/S4uDp7 TtvHNdsRzvdAbcTxaLDXqhPoCPhw+dVaoZJo8uuzutQzK20LIGvnqQa7ps1GMGVn1BZq BwK9yStvnA2j2irPELESOgyEdFEwtImSBJNGGZQ2i/wO2y8HTHXAxlEXMQVh6s5p4uH/ U5VQ== 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 14si3477983qtv.210.2017.11.09.10.04.15; Thu, 09 Nov 2017 10:04:15 -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 925B860CBA; Thu, 9 Nov 2017 18:04:15 +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 B256461017; Thu, 9 Nov 2017 18:01:13 +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 9095560A54; Thu, 9 Nov 2017 18:01:02 +0000 (UTC) Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [37.140.190.180]) by lists.linaro.org (Postfix) with ESMTPS id 45DA560B67 for ; Thu, 9 Nov 2017 18:00:21 +0000 (UTC) Received: from mxback1g.mail.yandex.net (mxback1g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:162]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 3F8942A25770 for ; Thu, 9 Nov 2017 21:00:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback1g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id sFqIuKHsJD-0Kme4tDW; Thu, 09 Nov 2017 21:00:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ej6QpjG6ho-0JnSP6LO; Thu, 09 Nov 2017 21:00:19 +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: Thu, 9 Nov 2017 21:00:15 +0300 Message-Id: <1510250416-6484-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> References: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v4 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: 0f3d27771374d5b525af19461f31d0e308b05874 **/ 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..f66dfab30 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; /** From patchwork Thu Nov 9 18:00:16 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: 118474 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp1221207edl; Thu, 9 Nov 2017 10:04:03 -0800 (PST) X-Google-Smtp-Source: AGs4zMaYvdHDAb+bK8tcHxlJdpbkeeS7Ea7RqiSP5DtVuIoTY0twyyz/F+2KGqR8hfSKbxfbcIE4 X-Received: by 10.200.38.148 with SMTP id 20mr2274240qto.157.1510250643013; Thu, 09 Nov 2017 10:04:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510250643; cv=none; d=google.com; s=arc-20160816; b=LY8sZWVWmfQcVEz/YUVCxZmI0TCGLzB7XVzvWQLWySBfWBUYPlXJOS6xovz3Gk3XB3 sI0cyJxeh4jwZ7F8lB/RBed8ISWIr1fTKBP/AvEsyDH4EaeOzHaAaphpuIbKkeg/vJCH dfZGPo5wmmwxfc+EdJCPEP0/bUG+6xPhWu1tPRIaCdAgj1BhE+pynNcoIwV2wo/Krnv0 cbH6FPBfmcBXwlcvG+D2BE8rs4s7JbEsx4Cf1wfx+tquY0ZqBwpLsmhzZ/HohlEIWDVW VSoniku/EXij5bZY/lxxCbJ3Pc4VAKVl5D+VjnEFp4Ij44WFWfGasT2Qc2h75JJtY1l2 Bj6w== 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=cJM57Td32CNlpkTIYvdxaXuqDnfPhhV+L28pAQk0pDY=; b=WBEK7BECRPYZ+LjYzX7mecKKKk01VVxXUWHTXtqeY6u3bOhMyl/AQHY3XD6MSNCNG9 /Bfu+U1CxsPRV33OTg6EcScxx0EVyMxX/qWngCItSV7wkfJGsdYuBbXScgIHptoogE7u hb9br54MXPElbRG+Bj3tBXbXPqL4f0oTJm18GGN+SELvnHF6JP+Pm1r0mwCx7J2nbXiq K8KkP1Ayg0Dv235MbCjyjQgCRXpnnMCxgQKjAI+Y0/9C/A6q4TBQZFuVQTF/PBl/WsDl cmkdDughebjJtuc9YiucZq9khL1MpsZFadWP+R3S0JiCR7p0/vzQ9o13vntrhZ7oqV+l nroA== 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 h67si6698867qkc.426.2017.11.09.10.04.02; Thu, 09 Nov 2017 10:04:02 -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 A1CE860C1E; Thu, 9 Nov 2017 18:04:02 +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 7619D61007; Thu, 9 Nov 2017 18:01:11 +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 35F1661015; Thu, 9 Nov 2017 18:00:58 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id D1F6660BDF for ; Thu, 9 Nov 2017 18:00:21 +0000 (UTC) Received: from mxback7j.mail.yandex.net (mxback7j.mail.yandex.net [IPv6:2a02:6b8:0:1619::110]) by forward105j.mail.yandex.net (Yandex) with ESMTP id D2890188C07 for ; Thu, 9 Nov 2017 21:00:20 +0300 (MSK) Received: from smtp2p.mail.yandex.net (smtp2p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:7]) by mxback7j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 8ELyKyIzwr-0KKewv8j; Thu, 09 Nov 2017 21:00:20 +0300 Received: by smtp2p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id ej6QpjG6ho-0KnaTWlN; Thu, 09 Nov 2017 21:00:20 +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: Thu, 9 Nov 2017 21:00:16 +0300 Message-Id: <1510250416-6484-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> References: <1510250416-6484-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v4 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: d22c949cc466bf28de559855a1cb525740578137 ** Merge commit sha: 0f3d27771374d5b525af19461f31d0e308b05874 **/ 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; }