On 12 Jul 2024, at 1:32, Adrian Moreno wrote: > Add support for parsing and formatting the new action. > > Also, flag OVS_ACTION_ATTR_SAMPLE as requiring datapath assistance if it > contains a nested OVS_ACTION_ATTR_PSAMPLE. The reason is that the > sampling rate from the parent "sample" is made available to the nested > "psample" by the kernel. > > Signed-off-by: Adrian Moreno <amore...@redhat.com>
Change look good to me, however one small nit below, guess this happened when moving the comment back in. Assume this will be fixed in next revision. Acked-by: Eelco Chaudron <echau...@redhat.com> > --- > include/linux/openvswitch.h | 28 +++++++++++ > lib/dpif-netdev.c | 1 + > lib/dpif.c | 3 +- > lib/odp-execute.c | 25 +++++++++- > lib/odp-util.c | 91 ++++++++++++++++++++++++++++++++++++ > lib/odp-util.h | 3 ++ > ofproto/ofproto-dpif-ipfix.c | 1 + > ofproto/ofproto-dpif-sflow.c | 1 + > python/ovs/flow/odp.py | 8 ++++ > tests/odp.at | 16 +++++++ > 10 files changed, 175 insertions(+), 2 deletions(-) > > diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h > index d9fb991ef..ac4f67c6a 100644 > --- a/include/linux/openvswitch.h > +++ b/include/linux/openvswitch.h > @@ -992,6 +992,31 @@ struct check_pkt_len_arg { > }; > #endif > > +#define OVS_PSAMPLE_COOKIE_MAX_SIZE 16 > +/** > + * enum ovs_pample_attr - Attributes for %OVS_ACTION_ATTR_PSAMPLE > + * action. > + * > + * @OVS_PSAMPLE_ATTR_GROUP: 32-bit number to identify the source of the > + * sample. > + * @OVS_PSAMPLE_ATTR_COOKIE: An optional variable-length binary cookie that > + * contains user-defined metadata. The maximum length is > + * OVS_PSAMPLE_COOKIE_MAX_SIZE bytes. > + * > + * Sends the packet to the psample multicast group with the specified group > and > + * cookie. It is possible to combine this action with the > + * %OVS_ACTION_ATTR_TRUNC action to limit the size of the sample. > + */ > +enum ovs_psample_attr { > + OVS_PSAMPLE_ATTR_GROUP = 1, /* u32 number. */ > + OVS_PSAMPLE_ATTR_COOKIE, /* Optional, user specified cookie. */ > + > + /* private: */ nit: The kernel file has private aligned differently. OVS_PSAMPLE_ATTR_GROUP = 1, /* u32 number. */ OVS_PSAMPLE_ATTR_COOKIE, /* Optional, user specified cookie. */ /* private: */ __OVS_PSAMPLE_ATTR_MAX }; > + __OVS_PSAMPLE_ATTR_MAX > +}; > + > +#define OVS_PSAMPLE_ATTR_MAX (__OVS_PSAMPLE_ATTR_MAX - 1) > + > /** > * enum ovs_action_attr - Action types. > * <SNIP> _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev