24/06/2020 20:09, Stephen Hemminger: > > > +/** > > > + * @warning > > > + * @b EXPERIMENTAL: this structure may change without prior notice > > > + * > > > + * RTE_FLOW_ACTION_TYPE_SAMPLE > > > + * > > > + * Adds a sample action to a matched flow. > > > + * > > > + * The matching packets will be duplicated to a special queue or vport > > > + * in the predefined probabiilty, All the packets continues processing > > > + * on the default flow path. > > > + * > > > + * When the sample ratio is set to 1 then the packets will be 100% > > > mirrored. > > > + * Additional action list be supported to add for sampled or mirrored > > > packets. > > > + */ > > > +struct rte_flow_action_sample { > > > + /* packets sampled equals to '1/ratio' */ > > > + const uint32_t ratio; > > > + /* sub-action list specific for the sampling hit cases */ > > > + const struct rte_flow_action *actions; > > > +}; > > Putting const on the ratio value is not necessary. > Other flow_actions don't do that. > > Note: rte_flow action structures seem to have lots of holes. > The value of those holes is undefined. You may want to swap the fields.
Why is it a problem to have holes with undefined value? If swapping, the hole will be at the end, right?