diff mbox series

[ovs-dev,v2,3/6] dpif-netdev/mfex: Add packet hash check to autovalidator

Message ID 20210824142803.1376058-4-kumar.amber@intel.com
State Superseded
Headers show
Series MFEX Optimizations IPv6 + Hashing | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Kumar Amber Aug. 24, 2021, 2:28 p.m. UTC
From: kumar Amber <kumar.amber@intel.com>

This patch adds the per profile AVX512 opt hashing to autovalidator
for validating the hash values against the scalar hash.

Signed-off-by: Kumar Amber <kumar.amber@intel.com>
---
 lib/dpif-netdev-private-extract.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

0-day Robot Aug. 24, 2021, 3:02 p.m. UTC | #1
Bleep bloop.  Greetings Kumar Amber, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author kumar Amber <kumar.amber@intel.com> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Kumar Amber <kumar.amber@intel.com>
Lines checked: 46, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/lib/dpif-netdev-private-extract.c b/lib/dpif-netdev-private-extract.c
index b3d96075c..263629903 100644
--- a/lib/dpif-netdev-private-extract.c
+++ b/lib/dpif-netdev-private-extract.c
@@ -303,6 +303,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);
 
         /* Store known good metadata to compare with optimized metadata. */
         good_l2_5_ofs[i] = packet->l2_5_ofs;
@@ -352,6 +355,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 (!miniflow_equal(&keys[i].mf, &test_keys[i].mf)) {
                 uint32_t block_cnt = miniflow_n_values(&keys[i].mf);
                 ds_put_format(&log_msg, "Autovalidation blocks failed\n"