[ovs-dev] [PATCH v2] ofproto-dpif-upcall: Fix using uninitialized fitness.

Ilya Maximets i.maximets at samsung.com
Mon Feb 26 08:10:11 UTC 2018


'upcall_xlate()' makes a decision to compose slow path actions
by checking the 'upcall->fitness', which is not initialized in
case of calling from the 'upcall_cb()'.

'upcall_cb()' receives the real flow, so the fitness should be
initialized as perfect.

Fixes following tests on travis:

    ofproto-dpif.at: ofproto-dpif megaflow - disabled - pmd
    ofproto-dpif.at: ofproto-dpif - conntrack - output action

CC: Ben Pfaff <blp at ovn.org>
Fixes: 687bafbb8a79 ("ofproto-dpif-upcall: Slow path flows that
                      datapath can't fully match.")
Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---

Version 2:
	* Struct initializer replaced with a simple assignment
	  for performance reasons. (Ben Pfaff)

 ofproto/ofproto-dpif-upcall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c
index 5eb20f7..23e459b 100644
--- a/ofproto/ofproto-dpif-upcall.c
+++ b/ofproto/ofproto-dpif-upcall.c
@@ -1266,6 +1266,7 @@ upcall_cb(const struct dp_packet *packet, const struct flow *flow, ovs_u128 *ufi
         return error;
     }
 
+    upcall.fitness = ODP_FIT_PERFECT;
     error = process_upcall(udpif, &upcall, actions, wc);
     if (error) {
         goto out;
-- 
2.7.4



More information about the dev mailing list