> -----Original Message-----
> From: Amber, Kumar <kumar.am...@intel.com>
> Sent: Wednesday 23 March 2022 12:40
> To: ovs-dev@openvswitch.org
> Cc: f...@sysclose.org; i.maxim...@ovn.org; Ferriter, Cian 
> <cian.ferri...@intel.com>; Stokes, Ian
> <ian.sto...@intel.com>; echau...@redhat.com; Van Haaren, Harry 
> <harry.van.haa...@intel.com>; Amber,
> Kumar <kumar.am...@intel.com>
> Subject: [PATCH v7 2/4] dpif-netdev/mfex: Add packet hash check to 
> autovalidator.
> 
> This patch adds the per profile AVX512 opt hashing to autovalidator
> for validating the optimized hash values against the scalar hash.

Hi Amber,

Is it more correct to say that this patch adds the scalar hash calls to the 
autovalidator. It also adds checks for comparing the scalar hash against the 
profile based hash calculated as part of AVX512 MFEX implementations.

The per profile AVX512 optimized hash was added to the autovalidator in the 
last commit. The autovalidator was already calling that code, we just add the 
checks and scalar hashing in this commit.

> 
> Signed-off-by: Kumar Amber <kumar.am...@intel.com>
> ---
>  lib/dpif-netdev-private-extract.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/lib/dpif-netdev-private-extract.c 
> b/lib/dpif-netdev-private-extract.c
> index 4b2f12015..63826b643 100644
> --- a/lib/dpif-netdev-private-extract.c
> +++ b/lib/dpif-netdev-private-extract.c
> @@ -252,6 +252,9 @@ dpif_miniflow_extract_autovalidator(struct 
> dp_packet_batch *packets,
>      DP_PACKET_BATCH_FOR_EACH (i, packet, packets) {
>          pkt_metadata_init(&packet->md, in_port);
>          miniflow_extract(packet, &keys[i].mf);
> +        keys[i].len = netdev_flow_key_size(miniflow_n_values(&keys[i].mf));
> +        keys[i].hash = dpif_netdev_packet_get_rss_hash_orig_pkt(packet,
> +                                                                &keys[i].mf);

The call to dpif_netdev_packet_get_rss_hash_orig_pkt() updates the ol_flags for 
that dp_packet to state that there is now a hash (DP_PACKET_OL_RSS_HASH). To 
ensure that the AVX512 hashing is always executed, we have to remove this 
'packet has a hash' flag after calling so other implementations can call it 
again.

Thanks,
Cian

> 
>          /* Store known good metadata to compare with optimized metadata. */
>          good_l2_5_ofs[i] = packet->l2_5_ofs;
> @@ -335,6 +338,15 @@ dpif_miniflow_extract_autovalidator(struct 
> dp_packet_batch *packets,
>                  failed = 1;
>              }
> 
> +            /* Check hashes are equal. */
> +            if ((keys[i].hash != test_keys[i].hash) ||
> +                (keys[i].len != test_keys[i].len)) {
> +                ds_put_format(&log_msg, "Good hash: %d len: %d\tTest hash:%d"
> +                              " len:%d\n", keys[i].hash, keys[i].len,
> +                              test_keys[i].hash, test_keys[i].len);
> +                failed = 1;
> +            }
> +
>              if (failed) {
>                  VLOG_ERR("Autovalidation for %s failed in pkt %d,"
>                           " disabling.", mfex_impls[j].name, i);
> --
> 2.25.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to