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 <getel...@nvidia.com>
Acked-by: Ori Kam <or...@nvidia.com>
Acked-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>