[dpdk-dev] [RFC] ethdev: introduce sample action for rte flow
Stephen Hemminger
stephen at networkplumber.org
Wed Jun 24 20:09:56 CEST 2020
On Wed, 24 Jun 2020 19:07:49 +0200
Thomas Monjalon <thomas at monjalon.net> wrote:
> >
> > +/**
> > + * @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.
More information about the dev
mailing list