[PATCH v3 1/2] ethdev: add random item support

Dariusz Sosnowski dsosnowski at nvidia.com
Fri Dec 8 19:54:13 CET 2023


Hi Michael,

> +Item: ``RANDOM``
> +^^^^^^^^^^^^^^^^
> +
> +Matches a random value.
> +
> +The rundom number is generated by PMD,
s/rundom/random

I'm not sure that mentioning PMD here is fully correct, because in my opinion it implies that SW generates it.
HW, SW and system clock were mentioned as examples of sources of randomness in previous discussions on this API.

Also, I think it's worth adding that "number == unsigned integer with at most 32 bits."
It gives some leeway for any driver implementing this API - value is uint32_t but not all bits must be used.
For example, some HW may support only 16-bit random number generation.
Such HW might implement validation on mask, where mask with more than 16 bits would be rejected.

What do you think about the following proposal based on those comments?
 
"A random unsigned integer (at most 32-bit) is generated for each packet
during flow rule processing, by either HW, SW or some external source.
Application can match on either exact value or range of values."

> +Application shouldn't assume that this value is kept during the life
> +time of the packet.
s/life time/lifetime

Best regards,
Dariusz Sosnowski



More information about the dev mailing list