> This commit introduced the auto-validation function which
> allows users to compare the batch of packets obtained from
> different action implementations against the linear
> action implementation.
>
> The autovalidator function can be triggered at runtime using the
> following command:
>
> $ ovs-appctl dpif-netdev/action-impl-set autovalidator
>
> Signed-off-by: Emma Finn <[email protected]>
> Acked-by: Harry van Haaren <[email protected]>
Hi Emma,
Thanks for the patch, minor comment below.
> ---
> NEWS | 2 +
> lib/dp-packet.c | 23 +++++++++
> lib/dp-packet.h | 5 ++
> lib/odp-execute-private.c | 99 +++++++++++++++++++++++++++++++++++++++
> lib/odp-execute-private.h | 3 ++
> 5 files changed, 132 insertions(+)
>
> diff --git a/NEWS b/NEWS
> index afef81b40..26be454df 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -19,6 +19,8 @@ Post-v2.16.0
> * Add support for DPDK 21.11.
> * Forbid use of DPDK multiprocess feature.
> * Add support for running threads on cores >= RTE_MAX_LCORE.
> + * Add actions auto-validator function to compare different actions
> + implementations against default implementation.
> - Python:
> * For SSL support, the use of the pyOpenSSL library has been replaced
> with the native 'ssl' module.
> diff --git a/lib/dp-packet.c b/lib/dp-packet.c
> index 72f6d09ac..1e4ff35ef 100644
> --- a/lib/dp-packet.c
> +++ b/lib/dp-packet.c
> @@ -506,3 +506,26 @@ dp_packet_resize_l2(struct dp_packet *b, int
> increment)
> dp_packet_adjust_layer_offset(&b->l2_5_ofs, increment);
> return dp_packet_data(b);
> }
> +
> +bool
> +dp_packet_compare_and_log(struct dp_packet *good, struct dp_packet *test,
> + struct ds *err_str)
> +{
> + if ((good->l2_pad_size != test->l2_pad_size) ||
> + (good->l2_5_ofs != test->l2_5_ofs) ||
> + (good->l3_ofs != test->l3_ofs) ||
> + (good->l4_ofs != test->l4_ofs)) {
> + ds_put_format(err_str, "Autovalidation packet offsets failed"
> + "\n");
> + ds_put_format(err_str, "Good offsets: l2_pad_size %u,"
> + " l2_5_ofs : %u l3_ofs %u, l4_ofs %u\n",
> + good->l2_pad_size, good->l2_5_ofs,
> + good->l3_ofs, good->l4_ofs);
> + ds_put_format(err_str, "Test offsets: l2_pad_size %u,"
> + " l2_5_ofs : %u l3_ofs %u, l4_ofs %u\n",
> + test->l2_pad_size, test->l2_5_ofs,
> + test->l3_ofs, test->l4_ofs);
> + return false;
> + }
> + return true;
> +}
> diff --git a/lib/dp-packet.h b/lib/dp-packet.h
> index ee0805ae6..723215add 100644
> --- a/lib/dp-packet.h
> +++ b/lib/dp-packet.h
> @@ -236,6 +236,11 @@ void *dp_packet_steal_data(struct dp_packet *);
> static inline bool dp_packet_equal(const struct dp_packet *,
> const struct dp_packet *);
>
> +
Hi Emma, from that patch this looks like extra white space but in the code it
seems we've added a page break token which is not needed, would suggest
removing the additional token added and leaving the original token in place.
Other than that LGTM.
Thanks
Ian
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev