[PATCH 2/2] ethdev: add quota flow action and item
Ori Kam
orika at nvidia.com
Sun Jan 8 14:47:21 CET 2023
Hi Gregory,
> -----Original Message-----
> From: Gregory Etelson <getelson at nvidia.com>
> Sent: Wednesday, 21 December 2022 9:36
>
> 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.
>
> 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 <getelson at nvidia.com>
> ---
Acked-by: Ori Kam <orika at nvidia.com>
More information about the dev
mailing list