From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47F5CC61DA4 for ; Thu, 2 Feb 2023 09:17:08 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C79042D2C; Thu, 2 Feb 2023 10:17:07 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id AA1F840689 for ; Thu, 2 Feb 2023 10:17:06 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 30C4150; Thu, 2 Feb 2023 12:17:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 30C4150 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1675329426; bh=Fwo2FhVSjBkB4kO/LvW/cOvvhybE7JpJBw1otdANMvQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=qlYnyuSIFYTJirte3I1SGYKCL3IzMtQOySy54aWWV/B4Tg8LZsGVwFXLMTGRUVePR dziDm7+oL8WO1GkVTtQa+fRfYiMJVXUf29VFZf5RciAdG8lVDSem1DmawvD3YdadRA E85brw2qrAlGpMFwgKdRRJJob4Ta3H+Sa8qoSzts= Message-ID: <2d58bfec-d184-c69d-d524-0c58aa9c839e@oktetlabs.ru> Date: Thu, 2 Feb 2023 12:17:06 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v8 2/2] ethdev: add quota flow action and item Content-Language: en-US To: Gregory Etelson , dev@dpdk.org Cc: matan@nvidia.com, rasland@nvidia.com, Ori Kam , Aman Singh , Yuying Zhang , Ferruh Yigit , Thomas Monjalon References: <20221221073547.988-1-getelson@nvidia.com> <20230201151646.3500-1-getelson@nvidia.com> <20230201151646.3500-2-getelson@nvidia.com> From: Andrew Rybchenko Organization: OKTET Labs In-Reply-To: <20230201151646.3500-2-getelson@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 2/1/23 18:16, Gregory Etelson wrote: > Quota action limits traffic according to pre-defined configuration. > Quota reflects overall traffic usage regardless bandwidth. > Quota flow action initialized with signed tokens number value. > Quota flow action updates tokens number according to > these rules: > 1. if quota was configured to count packet length, for each packet > of size S, tokens number reduced by S. > 2. If quota was configured to count packets, each packet decrements > tokens number. > quota action sets packet metadata according to a number of remaining > tokens number: > PASS - remaining tokens number is non-negative. > BLOCK - remaining tokens number is negative. > > Quota flow item matches on that data > > Application updates tokens number in quota flow action > with SET or ADD calls: > SET(QUOTA, val) - arm quota with new tokens number set to val > ADD(QUOTA, val) - increase existing quota tokens number by val > > Both SET and ADD return to application number of tokens stored in port > before update. > > If quota state was BLOCK (negative action tokens number) > application can change it to PASS after providing enough tokens to > raise action tokens number to 0 or above. > > Application must create a rule with quota action to mark flow and > match on the mark with quota item in following flow rule. > > Signed-off-by: Gregory Etelson > Acked-by: Ori Kam Acked-by: Andrew Rybchenko