From patchwork Wed Nov 8 14: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: 118259 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5323275qgn; Wed, 8 Nov 2017 06:00:37 -0800 (PST) X-Google-Smtp-Source: ABhQp+QxE05MhZzZQmHCB6YFMUgs2FRSkBk1rhKOC7MXA9zOKWT/e3n8F34dW1hPj+ReTpNt3UUp X-Received: by 10.200.38.194 with SMTP id 2mr896036qtp.196.1510149637319; Wed, 08 Nov 2017 06:00:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510149637; cv=none; d=google.com; s=arc-20160816; b=LA6pHHqsEJOMjXuD8Q2TN2AdKtpSeNnXLT+vCs3yBWfGq0KZKqRRKxvsMPIQGRGl4t k2vhVHhbV4YMWuLjCpF5SGxdlUMFdBcqw+Y8ludxugrwFwuN8Ff9ZtuRYpM6OiO+K9az O6618wNs+KIAJajEDavvvN53pn4GT6ueyJSEn+wY05zevlC9Rj3myiPCjopjCmMhFfLg 8/0khSmA0sg5AVLmJYpMj8KotEwlh2vGju3j3jOkBqPr9Mkn0diiC2h58wwNFfeLoBOQ hpHDilWJYEkjeLA9YabWjRqLP+maQPhxJdkscV5UUqk6LNAn93KxsoG5DAyKe1Hg2bYl mZCQ== 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=cyjmuCdQ6fnROop+n4GHdhSD1rENdW9HoKD17R+DOxI=; b=APUuyvcmQk6LSB5WyVLxa444+HOy5KTmmcvOfMciS18kCOrD7w7pVy59rVFk7skXxw gJNfQYw2SHBWntawKpGvauR7WpqhlN3DMq3P7ZaKSgwg4GzYS9aJ7HSFgObzxTzI5gvv HpBcbEX/5YSj1M8M6ZdIO3xt72hK3RElPXDIUhtrom8MT+Xgn+tgTZS+6Qg33gtlDDY7 ZAdURo0fd0u+AZDw0boBpLpxXC2lvG/QySxd9H+Oh7O2v/d4bbZdhK98BY7cubwn7LTP 6s9VyOfmZ38YdBKbU9HE4nDxDAQhQqjN4Q2eKANI9wC/N3Tv77M7/8kqlKc3Wq/3soqP 48Kg== 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 i32si4049042qkh.473.2017.11.08.06.00.36; Wed, 08 Nov 2017 06:00:37 -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 8EF2060C29; Wed, 8 Nov 2017 14:00:36 +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,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 61E61606A1; Wed, 8 Nov 2017 14:00:28 +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 AFD7D60B56; Wed, 8 Nov 2017 14:00:20 +0000 (UTC) Received: from forward102j.mail.yandex.net (forward102j.mail.yandex.net [5.45.198.243]) by lists.linaro.org (Postfix) with ESMTPS id A11EC606A1 for ; Wed, 8 Nov 2017 14:00:18 +0000 (UTC) Received: from mxback7o.mail.yandex.net (mxback7o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::21]) by forward102j.mail.yandex.net (Yandex) with ESMTP id 6E32C5601FFD for ; Wed, 8 Nov 2017 17:00:16 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback7o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id LdNJmsFmjr-0Gv4f77a; Wed, 08 Nov 2017 17:00:16 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YHHquvKMKk-0Fh4O3Lu; Wed, 08 Nov 2017 17: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, 8 Nov 2017 17:00:11 +0300 Message-Id: <1510149614-31459-2-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> References: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v2 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: 4c2f383b93c80fa98e8e676897db02dbc8b56112 **/ 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 Wed Nov 8 14: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: 118261 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5328318qgn; Wed, 8 Nov 2017 06:03:52 -0800 (PST) X-Google-Smtp-Source: ABhQp+RWcTv1ngRyXRmSjdzMiDK1VhFTHH5PvA5/uQ17J2qrOkd0DJtCMJrSDwgxZWHxf5lKGaoz X-Received: by 10.237.61.49 with SMTP id g46mr913877qtf.239.1510149831913; Wed, 08 Nov 2017 06:03:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510149831; cv=none; d=google.com; s=arc-20160816; b=otd75PvLnaXUWVA79TlMGdQuo21NvMwbspUAei63VmnGsY5YhPQZpF3O1jKkvjsnUK 6aSg35l9FjffJ0Zs1GoPYLFySwvMGmEBiltgxGO9cPY7paAUsDSg97Pnf2RCry+iXEJx +6gam+LRztckMVJzWHQ75W6B7Xa6y+3mhg5WnsvPGqfrWreD3EUMdzh2g2aRSVb4er6X xmoYo+yk8U36Q1T4bPJSQjZXPQj6H/g5tZWLoPHhiSs+dRkvfnmPpv3D/uV7exfq97Ez klr0zwFS9Sd8IZRMgA3MAVLrNBFpT2MTuAUf+MY1RueuBdpHMjGQEdZID78DaYCQBREs KrSw== 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=QG+WNvOECbuwGNu3EG8Kp4wf2pLlZ0MpScSmdVFT56Q=; b=yD94CLY+bAzO6jrcvn9z43xmwqazWKhQFzdfOl+vJrdpgVmSxUHFKmBYXrlp1yrEDL /RtFPSoVj8j+Mx0z+RxmDfN0JUIDo0yPWkeiM71w0OFzsBUFMWwrWBBagBj2HE7jMXs5 CRc9VJRBh5YGSR3zJi9eORgvDbQmE38sh53q9dhA+OPcN6fsLXW+MNJfiB81jcN9f+sI 55LZmVXWe1T2cbtbbgAfkSf3PFnmsQNT6jNyhsTuoYn3xu1p7j02RRE2FQlUko/OjQfI 3TxgDSL1e7DhDzONh8E6MEgqAF/0AEg1OkH1UN6X9A+X6w+M7C/fLYcdnxo+J5Yfg12W pHdg== 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 d130si78899qka.400.2017.11.08.06.03.51; Wed, 08 Nov 2017 06:03:51 -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 5FCFE6101A; Wed, 8 Nov 2017 14:03: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=-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 38E0260C88; Wed, 8 Nov 2017 14:00: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 B38F0606A1; Wed, 8 Nov 2017 14:00:27 +0000 (UTC) Received: from forward105o.mail.yandex.net (forward105o.mail.yandex.net [37.140.190.183]) by lists.linaro.org (Postfix) with ESMTPS id DCF6560890 for ; Wed, 8 Nov 2017 14:00:18 +0000 (UTC) Received: from mxback17j.mail.yandex.net (mxback17j.mail.yandex.net [IPv6:2a02:6b8:0:1619::93]) by forward105o.mail.yandex.net (Yandex) with ESMTP id 631024443517 for ; Wed, 8 Nov 2017 17:00:17 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback17j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id H55QiBzvJI-0HvG8OcS; Wed, 08 Nov 2017 17:00:17 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YHHquvKMKk-0GhqMvud; Wed, 08 Nov 2017 17:00:16 +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, 8 Nov 2017 17:00:12 +0300 Message-Id: <1510149614-31459-3-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> References: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v2 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: 4c2f383b93c80fa98e8e676897db02dbc8b56112 **/ include/Makefile.am | 1 + include/odp/api/spec/threshold.h | 102 +++++++++++++++++++++ platform/linux-generic/Makefile.am | 1 + platform/linux-generic/include/odp/api/threshold.h | 34 +++++++ 4 files changed, 138 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..54502e9e0 --- /dev/null +++ b/include/odp/api/spec/threshold.h @@ -0,0 +1,102 @@ +/* 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 { + struct { + /** Max percentage value */ + odp_percent_t max; + + /** Min percentage value */ + odp_percent_t min; + } percent; /** Percentage */ + + struct { + /** Max packet count */ + uint64_t max; + + /** Min packet count */ + uint64_t min; + } pkt_count; /** Packet count */ + + struct { + /** Max size of all packets */ + uint64_t max; + + /** Min size of all packets */ + uint64_t min; + } pkt_size; /** Packet 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 8 14: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: 118262 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5330203qgn; Wed, 8 Nov 2017 06:05:04 -0800 (PST) X-Google-Smtp-Source: ABhQp+RS3BgXBK2ZpPWzpOUYBlJOV12PtO8Ux8xnKtNtS2GTFI0S9FEdy+CZeSUzVd09PGr9S3tB X-Received: by 10.36.85.139 with SMTP id e133mr755642itb.147.1510149904569; Wed, 08 Nov 2017 06:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510149904; cv=none; d=google.com; s=arc-20160816; b=J4QyGUOMFxaYoXw3FnGxN4WsSPvDmnCrpjVF78IcNn77ZvkjDEwPy+EADwDAxjeA61 +TDIlqc54+vZ4ZbSF0ZaC0cVJ90P9bOmIiNNRbH7QzXyoGpA8IcNnbaRisQOuT56wW/5 vG6C2Ils5F52EaZB86e7p5FBct9P7CTwvu0DSl/S4KpjXoVIk0ey34oqSo4AAHxy32YC sq56FPxDVtaeieHONCt7ZThRoWBaAZJnbU3/GeQlOHYangwOCgfoYWPCFcDGpgAphZ7L eWRC5GQEK3e2BTxNdpGpV04Ps5NddOfWZtoOQcHIdJWP2Gc1h/Fbhn83NNqw4o9twc/9 NJCA== 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=22Mxs4xIMv29dshChbApRAz8j5kxjdx25sNjWiVlaC4=; b=oFFqvcSzHSG7BeGI2jj7whABaYWGcM7O3h7QGCK+dccjTH/xCA9TfTcONBK/vMTko/ gZHsvrpyf5hksE77TVSbkN9bpNrY942H/PnYA4IPs4AU2dP5CCYKkqFgaownjLwSqZ1x rWJsZYefNfOXkGRm2Xk3WoQQ6/qmlzRnyt9muVFXuzB2Y9XbT4JPwWH0p1KsgY9znD5m LFdw7ka4KMrlznnH40CJ63B3QiNxKYaBYYWwJcriG7H9rWDJx6kTPfd80qluFUYf2+EP RROYM/9axtdaHI2Qm+cyv7N3SOZw9s+KwBFTjh0bOhNdyErHPHE68yqfmVaVsuoydF/y f2qQ== 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 v132si3556780iod.270.2017.11.08.06.05.04; Wed, 08 Nov 2017 06:05:04 -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 E858F60C88; Wed, 8 Nov 2017 14:05:03 +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,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 9748760C29; Wed, 8 Nov 2017 14:01:01 +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 1EB97606A1; Wed, 8 Nov 2017 14:00:28 +0000 (UTC) Received: from forward103j.mail.yandex.net (forward103j.mail.yandex.net [5.45.198.246]) by lists.linaro.org (Postfix) with ESMTPS id 322DB609B5 for ; Wed, 8 Nov 2017 14:00:19 +0000 (UTC) Received: from mxback3o.mail.yandex.net (mxback3o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::1d]) by forward103j.mail.yandex.net (Yandex) with ESMTP id D5C5034C411F for ; Wed, 8 Nov 2017 17:00:17 +0300 (MSK) Received: from smtp3o.mail.yandex.net (smtp3o.mail.yandex.net [2a02:6b8:0:1a2d::27]) by mxback3o.mail.yandex.net (nwsmtp/Yandex) with ESMTP id WlhTqbXnlO-0HpOBlI5; Wed, 08 Nov 2017 17:00:17 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YHHquvKMKk-0Hh8vAa2; Wed, 08 Nov 2017 17: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: Wed, 8 Nov 2017 17:00:13 +0300 Message-Id: <1510149614-31459-4-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> References: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v2 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: 4c2f383b93c80fa98e8e676897db02dbc8b56112 **/ 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..d9f42c99e 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 Wed Nov 8 14: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: 118260 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5324901qgn; Wed, 8 Nov 2017 06:01:37 -0800 (PST) X-Google-Smtp-Source: ABhQp+SF6R1WLUqtVx6AQTuv3CkHEgqzcn99GvCG5Qcj+MsmnWJRXfcIpX9sINUmwPO6JRVOsm0V X-Received: by 10.200.47.85 with SMTP id k21mr951302qta.286.1510149697266; Wed, 08 Nov 2017 06:01:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510149697; cv=none; d=google.com; s=arc-20160816; b=OJR6z5ibSm1Kv7hNbia0wHg+dDnSYKjoO/wrvtAswbTRz6/wkCgBnJ+6q2HS5Ak1Wx GgWwlKD8y1ohMF+vYnZMiYf/C4Y1r6vKztHC1czIKacbPRG9kYPwo0FVFhKz7roc/yip QX2aDvMusQG7pyL7+6pB3CzBZRze5u43YLecD+BeaEUnk2nXJDeiPb76HdbGK9x0zpii rwgyTVjUtnU+PsPJlRx8AXMTuLk9R71yVjXkwzgT/RUKG59Ur1JvUB401U9jdByekTt/ UPCGA1fM6vtsT2jFoh3ha2AMKQLPbWPwKNVJo81exsn3lgyjlQt3NiyrK7c2bxgjNqZc iyUw== 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=ujZyzPOl9F3HWKJBeKJy64BzkKhF+2V/WHIzGYeJQkE=; b=Ayl3xkffeUnjVPk3JE5eB2F5M8ALmIeo2nJ3eQ6Pz4ZMa29fiXjryPWI9YFOpeUVNC BzMIGL667z61jVdEO3ZDbV5CQmtvqSat6WoAp7D23YlriLyU5Voc9Pf7ShtECCStinyY nrfairBfqvb0Q17eDCP1r0OVHbMDpxfX71JYhQ5POggQfNlXL3xhYR/ZO4OSBdCtF5Hv oniUN/l09U6/G0KaRVgJ1u7akcO8bwwZ6D5AbAi3DfwZgje0+1NRbp3enM+CZnUZ+F1N B2tOLs2d10/LcClWnrLm4x9T0uvThB60uvXDYSPthcCHnupV1N8qCiwMnef/yytE+FGM 1T/Q== 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 z51si3042267qtj.412.2017.11.08.06.01.37; Wed, 08 Nov 2017 06:01:37 -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 E794D60B4C; Wed, 8 Nov 2017 14:01:36 +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 B454460BFF; Wed, 8 Nov 2017 14:00:35 +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 A20A560B4C; Wed, 8 Nov 2017 14:00:23 +0000 (UTC) Received: from forward100p.mail.yandex.net (forward100p.mail.yandex.net [77.88.28.100]) by lists.linaro.org (Postfix) with ESMTPS id E818060AF8 for ; Wed, 8 Nov 2017 14:00:19 +0000 (UTC) Received: from mxback11g.mail.yandex.net (mxback11g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:90]) by forward100p.mail.yandex.net (Yandex) with ESMTP id 679FE5103CF5 for ; Wed, 8 Nov 2017 17:00:18 +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 oyWqKPRv3X-0ILeMicM; Wed, 08 Nov 2017 17:00:18 +0300 Received: by smtp3o.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id YHHquvKMKk-0HhiMdCM; Wed, 08 Nov 2017 17: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: Wed, 8 Nov 2017 17:00:14 +0300 Message-Id: <1510149614-31459-5-git-send-email-odpbot@yandex.ru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> References: <1510149614-31459-1-git-send-email-odpbot@yandex.ru> Github-pr-num: 277 Subject: [lng-odp] [PATCH API-NEXT v2 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: 4c2f383b93c80fa98e8e676897db02dbc8b56112 **/ platform/linux-generic/odp_classification.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/linux-generic/odp_classification.c b/platform/linux-generic/odp_classification.c index a5cba56a4..7fa125ec2 100644 --- a/platform/linux-generic/odp_classification.c +++ b/platform/linux-generic/odp_classification.c @@ -190,6 +190,8 @@ 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; return 0; }