From patchwork Wed Nov 15 11:00:09 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: 118934 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4157531qgn; Wed, 15 Nov 2017 03:01:59 -0800 (PST) X-Google-Smtp-Source: AGs4zMaZnFTEB0T6dx6/SC4tJlZK3mVng6s2Hj3PBNnwDoLtgf7llgZoCYnDo3E8ANOfFVoCxVhV X-Received: by 10.55.75.202 with SMTP id y193mr23873405qka.329.1510743719419; Wed, 15 Nov 2017 03:01:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510743719; cv=none; d=google.com; s=arc-20160816; b=jsPUV5Nrj5YP5/GghtrwO5BP1xpRKBNJdN11QmVleY4+wv8XaEB9Y2E2vrHB0LG5Ri ah1gQDq+XX3AHZk7ug6ePfI7BWCWFqsaAYf9fui/+oIYXrEjIdHZI63viaB7chzecb8K aCQ5sxO1ZeNDSHgeMRq5APCK3wnk+YujgvQpsaPMx1VQTi9gmQmwUEzbDIdXGhUjvdJw ED8vLhQMDkgej63SzZB0V3NCRFKNwC2sOkqfWI/84DAO4gT06MCTSD5GIDVLTjUA/spx lrq3L7DXntcNbfUsh/ZgaTRQkTBVCuq5F/+MqD25uTaIbqrV/oLDhJI/PGg4GAPLCnDv ooBg== 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=kxJJV7J0wqhKLGIQO3b/TRdCo2RqIYFzlPGC6nL+o+Q=; b=Jm03VolwIQB3+WpAZVhCJX5m/Plpvj8RUDWHMOhW1yoOPuQQeTol9+MbnKFrLOtReQ ZZSbplpHZZYUAhhujR806iKOLioypqLf+yYuKoxcc4D0k+sVU2DTQTXfxkzPe/Ow+Tek cQ6VTSupK9LyoQjBXPxPMOxAb7ieFPKDcwVGA7A4PPG0PiCkzL4odOeu9EO+t2yJVUda AvTT89Dj9RpjRZoQAPw2yXL7kDjrLg48mJ6qJA2aJRV9ql9bvVAHupLCKho6PkZb6Ll5 Xj64VoJm92YSSVPUWiLQvPWJdsnI8NPb2+xQNLfoCzFtocq2Jxn+5Cu6vI6mdKM2vaHK x7lA== 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 r62si2804047qkh.90.2017.11.15.03.01.59; Wed, 15 Nov 2017 03:01:59 -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 1DCA9607C2; Wed, 15 Nov 2017 11:01:59 +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 B8816606A1; Wed, 15 Nov 2017 11:00: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 DCD1A6038B; Wed, 15 Nov 2017 11:00:26 +0000 (UTC) Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [5.45.198.248]) by lists.linaro.org (Postfix) with ESMTPS id F2B986038F for ; Wed, 15 Nov 2017 11:00:15 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 721DF188C19 for ; Wed, 15 Nov 2017 14:00:14 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id HHNoLF6dFB-0E2OBNgC; Wed, 15 Nov 2017 14:00:14 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 85x2bh5VFm-0Dw8mhEj; Wed, 15 Nov 2017 14:00:13 +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 14:00:09 +0300 Message-Id: <1510743612-1242-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> References: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v5 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: 4f0291a1c2fcd19243f1ced69f46d9b2d58fedb7 **/ 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 11:00:10 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: 118936 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4159499qgn; Wed, 15 Nov 2017 03:03:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ1r/e523SDiEhywhQK7Rp2nbgH9TaVezEmp1ZivYIVP3HPuO8gOfCTkVQxhYKV8p8nURIi X-Received: by 10.55.207.20 with SMTP id e20mr24609871qkj.1.1510743810492; Wed, 15 Nov 2017 03:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510743810; cv=none; d=google.com; s=arc-20160816; b=WHIkfFdTzrVICbfsCLslNScK0wGySzxnhCeawtI9J0LjRHMiNKBT/do/geoLm0VwUk JLZO0V0shj2wN2bgjYdlVt8o1nJffIZzEQcFYU+o21iWkpRZybjKgag5TxM2DvVBCskr 9LLrJ68gMKSwk3jYKBCryvz/dTrEIvUtJZadBZJwKl0IT1iLQukEmwKAO2XMJrbPORDp JnqMnTl5E3RotC5xtA/jPGxsklayhXPFmm/wb8Y9dkM3mGHb0gTVGUw/UnWS+nIy96Sy 510a3KwblF0wKjneJCAkGTK6xzJEVoQ2dLe+CfZ72DYy2li7opkOLRYdFiQ2YusihSdF N6dw== 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=JJCGz+bi5/y27Zrly+6ALj/q9gAip92qbMDWMwvXY+U=; b=plu7rwcoOx81RGsyv0I7NRfxcUTdwnh3/SPGmfsjSdRv+Q5owjDbbcI12D6F0zIZzX 4NCW/07OarZRS4ruLDo6gGwUUoJbkVXh0BV+n39PoNwCv7oj4XZwAAc1DN11oyR2FT81 9L/0lvkytSlboISlbvN2N0Jor4q+LISkpoq3Ze4mKHSkSOxsWH6IEZ/DAv+rEu2+f8n9 HluoDUbXh6A1qboBnD2uPrivhcBYsrtvc+HZAo6+7fxBSQEeN+8OzSCzXq+SdJxxO2Il uMxg1BF+fyrU0rPJFuAZ5VR0W5lGaiFCSCWKaVChjVHywWG/1Sc0IdkMQbvDCASd4ktY RtYg== 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 n81si7859019qke.290.2017.11.15.03.03.30; Wed, 15 Nov 2017 03:03:30 -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 18CB56072F; Wed, 15 Nov 2017 11:03:30 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 469336073F; Wed, 15 Nov 2017 11:00:53 +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 AE3F66038F; Wed, 15 Nov 2017 11:00:29 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id E96A160513 for ; Wed, 15 Nov 2017 11:00:16 +0000 (UTC) Received: from mxback12j.mail.yandex.net (mxback12j.mail.yandex.net [IPv6:2a02:6b8:0:1619::87]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 5A2E5560243E for ; Wed, 15 Nov 2017 14:00:15 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback12j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id BS8ZsPFu1q-0FHCSOwR; Wed, 15 Nov 2017 14:00:15 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 85x2bh5VFm-0EwqW3jL; Wed, 15 Nov 2017 14:00:14 +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 14:00:10 +0300 Message-Id: <1510743612-1242-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> References: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v5 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: 4f0291a1c2fcd19243f1ced69f46d9b2d58fedb7 **/ 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..91f5103b2 --- /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 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_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_PKT, + + /** 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; + } 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 Wed Nov 15 11: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: 118935 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4158250qgn; Wed, 15 Nov 2017 03:02:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMZQ4Rtd0AmFUraa9Gy8HhRSDf8788jnZlga4JlGwCqJ45tvbZFq8ZxXBzm3rAojqpE7M0il X-Received: by 10.200.40.15 with SMTP id 15mr5838294qtq.74.1510743753997; Wed, 15 Nov 2017 03:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510743753; cv=none; d=google.com; s=arc-20160816; b=GeD0cPkcGCEnKD3W6fb2lyiaSGp8hQ/72fIF7x/ZDUPenvKhHWZUcsQ3QsJ9mWiKL6 lYwuT/13z6YLFesFVoYHSqLO59bsbT8pz8SPN43+aW+UnzkuS5xPvOTbfZ/FZNIOedHb wwhG9p900BGAl0LevXWSroj9cW4pW5GRteXzMNApToUZSJQUK6E0z9hC6DMUAEfjDMry QE4033G4EOAOp7wuSepEgHGyaitADwL9NREa5vTXreirn0AIsVuQpIOaE/yOKBJw3sDN Ytf86nC15I/ekBWac4g8lca5/N4ZCQA0gr8ZieLJVSaSWFtqB8ano67CdxKPMBHoSOzZ yUng== 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=YEV0QY9ADb75mhbvqMeksHV6bovjs0nPP5sjXuGiZ8w=; b=NkgbfHVPh6Q2VcuydKRNpL/KT77r+3h0C3+tdEbpKI959axYgUBqV26Sbu/RnhX+2y lBFeOI8wP4STEieraadGN9/5zKmx7BLwrV987tRkrkk6zuem7IJTZ/kPp9v+RF65EFKb 63MdIr4Z68hVSTpj6uZ+0u3G4/IAvOiSXjx4vAfu2zIZmBbM857CtdwpGXRD1/R04E9R c9/70Lu60Hy4lMrOrkHkpmbdXBnbLCqWhj/gC6kJo82PuEG11gge3b/W/tAoI5uPjJEG m4mWHiRwxr8Y3IBtXeurredzrDQCcTfS3tqlJa5S6WwpxDU4XQvczoOak+UN70WYpkzU CTkQ== 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 j65si52959qkj.244.2017.11.15.03.02.33; Wed, 15 Nov 2017 03:02: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 9E4CE60762; Wed, 15 Nov 2017 11:02: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 09897606B3; Wed, 15 Nov 2017 11: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 A65456038B; Wed, 15 Nov 2017 11:00:29 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id 711936068B for ; Wed, 15 Nov 2017 11:00:17 +0000 (UTC) Received: from mxback12g.mail.yandex.net (mxback12g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:91]) by forward100p.mail.yandex.net (Yandex) with ESMTP id B50F05108D1D for ; Wed, 15 Nov 2017 14:00:15 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback12g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id mxcNo9oSCi-0FmCYG6Q; Wed, 15 Nov 2017 14:00:15 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 85x2bh5VFm-0FwOTHEU; Wed, 15 Nov 2017 14: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: Wed, 15 Nov 2017 14:00:11 +0300 Message-Id: <1510743612-1242-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> References: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v5 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: 4f0291a1c2fcd19243f1ced69f46d9b2d58fedb7 **/ 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 11:00:12 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: 118932 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4156783qgn; Wed, 15 Nov 2017 03:01:22 -0800 (PST) X-Google-Smtp-Source: AGs4zMaGAJENTdq8rjZaftONPdb9BM2htbO/safB+tDJY/EruBwHIvje4NP2/OiutkavBx3YSDtj X-Received: by 10.200.9.91 with SMTP id z27mr24550167qth.207.1510743682884; Wed, 15 Nov 2017 03:01:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510743682; cv=none; d=google.com; s=arc-20160816; b=qhpJTBO2hZ8Jru75XAX5ZHGpzDUyhAgpj+5TMsIVxTS9jLXPqRMG3eEo9TcKtH8LR/ gT2Jj7Af6fUJIf0Y/GUvamtvTSuF2AaqcMYUF5Hu+X9vBMILLg6G773ekWRNdtgQ6iTY Lx7lZNPjzcavknmE1xI0qjtA/gut+Uh27HUPOwGDdL4EsFHa9b9ATtFfVaWWSXRy1AO5 zxqdO4Tevldqyq0FwXkQn/Onw789251qMsVdiANsK+bfKagMF2ljLHxpj5tWe2zYX4Qp oKreci0auVGu27MVvtch47xdojgxlNKIBLR/J1FxiNOpacLSMUrtZY0F+kl+sQpEQ8dM Xh7g== 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=+UfWyyiAUKkNW+Q1wct7RQXieL+KpEcf6+l8ZM29STk=; b=cTcMbpcmw3l94lrZA11bMQOpj5K5i27NItcqWz98d+IT1JcOVpGhTvKJHhJ8H47RFz aPAWSbIAYld4Lw36PFLy4SmnH2hcrnnp0MaZhaWdnw/RogT0AY+EmxdWoX+yUjeUE6OG Ve8nUugpU+psAJj6uy4YzMQxXSHMGpQ3nyyJrkXgjw3YuJQhum1E/qJ8bcAOAU/Lt+J9 g60rEifyeYePKsr73w0euIcYrcEyjAFJz/5D0FR2visvrnOzcNlnL7w6ECyjzjhtURQE qvaV39unk87g/27RQ28tGblrRppoANIZ41q2hq4QhhND2uGndG2Z4FchBknMD8cCIxS9 Swvg== 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 s72si3327558qka.75.2017.11.15.03.01.22; Wed, 15 Nov 2017 03:01:22 -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 9615B604A1; Wed, 15 Nov 2017 11:01:22 +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 5E1056068B; Wed, 15 Nov 2017 11: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 93503604A1; Wed, 15 Nov 2017 11:00:24 +0000 (UTC) Received: from forward104p.mail.yandex.net (forward104p.mail.yandex.net [77.88.28.107]) by lists.linaro.org (Postfix) with ESMTPS id A84A96069A for ; Wed, 15 Nov 2017 11:00:17 +0000 (UTC) Received: from mxback4g.mail.yandex.net (mxback4g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:165]) by forward104p.mail.yandex.net (Yandex) with ESMTP id 176C4184B95 for ; Wed, 15 Nov 2017 14:00:16 +0300 (MSK) Received: from smtp3p.mail.yandex.net (smtp3p.mail.yandex.net [2a02:6b8:0:1472:2741:0:8b6:8]) by mxback4g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id e7bPeGisOq-0G2CqBpY; Wed, 15 Nov 2017 14:00:16 +0300 Received: by smtp3p.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id 85x2bh5VFm-0FwCYTrW; Wed, 15 Nov 2017 14: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: Wed, 15 Nov 2017 14:00:12 +0300 Message-Id: <1510743612-1242-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> References: <1510743612-1242-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v5 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: 4f0291a1c2fcd19243f1ced69f46d9b2d58fedb7 **/ 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; }