From patchwork Mon Jun 5 12:27:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Balasubramanian Manoharan X-Patchwork-Id: 101388 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp885819qgd; Mon, 5 Jun 2017 05:27:32 -0700 (PDT) X-Received: by 10.237.37.74 with SMTP id w10mr17948218qtc.14.1496665652669; Mon, 05 Jun 2017 05:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496665652; cv=none; d=google.com; s=arc-20160816; b=Q/LEBfGTZXO3NJ6u3mOtblkwbzs/QXOX2dAKoYavqxwtpWU92GXvef+O0VPVEh5jQX GMWGCU0mkVL0NMjfxMzAIwIyRvRi8Zm2Z03W2/zucg6dEok5Tei5gVQPWbvzjN4sq2dv O0WA5r+uamtncw1viNUpOuD9ErLA3TekORVftw6alZ4i+a2Pk4HRGezlARG1DVnGRMa8 QoUcag6XPMFyp4hrqlZNMaG5xaId4EZBK9WqyiXPt/ro7yyN5vlGBkK92LOKoR6byglU DU+RgMiSvuKqzhizxYNvyof2/BqFou4oGQSsKnFaT9420YZP9ZL9oaQjavQf+6dMWwYv 6wig== 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:message-id:date:to:from :delivered-to:arc-authentication-results; bh=QOXSp2e7kcZppL0y2OMunqAeXVRsnn8z3I7SVga+W1U=; b=sXKt0rbVqx8Q8av3jOn9Mo9IeOAS/A96v7U4mNnjAnyZB57zA7JvzO54pY6Nc8d+3a JyzVXpWf0WoMB/jcJHut3+EygOBIuCZlK/GCiIpCEpw7Fz4XoqFCaviVHdsXuxqo0KCU c6ktQwbaSTgi4C+QhVfpHiJFXbU+zJ3R08rInZMMDuUmeZhtcf3FbTBj5eul3G4CQh1w vMUGWlOuIFQ5NlQfLx52/5C9W1ZQwlyJH5Lsna4/CaCtm3bEWZuo4HG3FiLNwTObzhwG XRWmfzkXGq4BKld6ZwLqGxlJ3i9jbYvckGfwusRSn2O02FQzN8Zd7W9+p0N8Kz/iX8h3 RYCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id i8si18853342qke.58.2017.06.05.05.27.32; Mon, 05 Jun 2017 05:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E2F5D60BF7; Mon, 5 Jun 2017 12:27:31 +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=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, RCVD_IN_SORBS_SPAM, 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 3E3CE6085D; Mon, 5 Jun 2017 12:27: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 A558560B51; Mon, 5 Jun 2017 12:27:26 +0000 (UTC) Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by lists.linaro.org (Postfix) with ESMTPS id BD11760854 for ; Mon, 5 Jun 2017 12:27:25 +0000 (UTC) Received: by mail-pf0-f182.google.com with SMTP id m17so82466697pfg.3 for ; Mon, 05 Jun 2017 05:27:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=QOXSp2e7kcZppL0y2OMunqAeXVRsnn8z3I7SVga+W1U=; b=VWm/prQsnrwBjy+OCooATAMSR4zPpuMZYuZRfKBC6quVgS+IuCWvWHUp1fXmd48TUo vxOhrWOBCNuVk6mLv0XeBKhR7pWM6twimSSHB+GL3SaSyexXyFxxsRs+rYcGtIhabYhx Cr7FNBrFwidUNnn61P6HKKA4la5wEZ8oqj6J4UWvpgumIZSG7MXMHq67htwxZhFq7Ngo q2/IMVg4C8Ypb0yi9rpXeakvwtl5+FmHswN0JY9bD4H+rSEjfZ1vlx3v54UZKldXD/rL GNQtDXN4OJ9qDw03205H/5M0JU1cnctdnm5UHCQJG1M6Y7X0EXHy8OlIOB13pySOkqfq WhLQ== X-Gm-Message-State: AODbwcBuW7c7v63bna8+v6W3E3LeRG+ecXqllB2W6TSUKSDz4OnJ0Z5L t2uBhzJHztlAVx22lkMeG7ov X-Received: by 10.98.48.5 with SMTP id w5mr20246587pfw.44.1496665644720; Mon, 05 Jun 2017 05:27:24 -0700 (PDT) Received: from localhost.localdomain ([223.227.124.66]) by smtp.gmail.com with ESMTPSA id r29sm28659924pfg.95.2017.06.05.05.27.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Jun 2017 05:27:24 -0700 (PDT) From: Balasubramanian Manoharan To: lng-odp@lists.linaro.org Date: Mon, 5 Jun 2017 05:27:17 -0700 Message-Id: <1496665637-15790-1-git-send-email-bala.manoharan@linaro.org> X-Mailer: git-send-email 1.9.1 Subject: [lng-odp] [RFC] api: pool: add threshold limit to the pool 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" Adds threshold limit of the pool to the pool parameters. This threshold limit is a percentage of total size of the pool. Signed-off-by: Balasubramanian Manoharan --- include/odp/api/spec/pool.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) -- 1.9.1 diff --git a/include/odp/api/spec/pool.h b/include/odp/api/spec/pool.h index 6fc5b6b..1c1ebe4 100644 --- a/include/odp/api/spec/pool.h +++ b/include/odp/api/spec/pool.h @@ -20,6 +20,7 @@ extern "C" { #endif #include +#include /** @defgroup odp_pool ODP POOL * Operations on a pool. @@ -127,6 +128,9 @@ typedef struct odp_pool_capability_t { * The value of zero means that limited only by the available * memory size for the pool. */ uint32_t max_uarea_size; + + /** Pool Threshold limit support */ + odp_support_t pool_threshold_limit; } pkt; /** Timeout pool capabilities */ @@ -214,6 +218,17 @@ typedef struct odp_pool_param_t { defined by pool capability pkt.max_uarea_size. Specify as 0 if no user area is needed. */ uint32_t uarea_size; + + /** Pool threshold limit in percentage + * + * This value denotes the threshold limit of the pool in + * percentage of the total size of the pool and is used + * to configure the Random Early Discard (RED). + * When the number of packets in the pool is greater + * than this value RED is initiated in the pool and + * further incoming packets to the pool are dropped in + * a random sequence. */ + uint8_t threshold_limit; } pkt; /** Parameters for timeout pools */ @@ -329,6 +344,23 @@ uint64_t odp_pool_to_u64(odp_pool_t hdl); void odp_pool_param_init(odp_pool_param_t *param); /** + * Set threshold limit of the pool + * + * Set the threshold limit of the pool as a percentage of the total + * size of the pool. This value is used to configure Random Early Discard(RED) + * parameters of the pool and any incoming packets to the pool after reaching + * this threshold is dropped in a random sequence. + * + * @param pool Pool handle + * @param threshold_limit Threshold limit of the pool. + * + * @retval 0 on success + * @retval -1 on failure + */ + +int odp_pool_threshold_limit(odp_pool_t pool, uint8_t threshold_limit); + +/** * @} */