02/02/2023 14:47, Gregory Etelson: > 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>
I feel this kind of explanation would have been better in rte_flow.rst instead of a "doxygen-like" documentation. Greogory, Ori, feels lucky, you've just got promoted as the rewriters of the whole rte_flow.rst :)