[ovs-discuss] Fw: The VM with SRIOV unable to get metadata from localport on gateway node.

zhihui.ding at easystack.cn zhihui.ding at easystack.cn
Tue Oct 19 15:34:14 UTC 2021


We try to fix issues about that unable to get metadata from localport on gateway node by the folllowing patch. And this patch assumes that in a logical switch has only a ha-chassis-group for external ports, put a high priority flows to forward traffic from localport to localnet in table:OFTABLE_CHECK_LOOPBACK.

@@ -1344,6 +1298,31 @@ consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name,
         ofctrl_add_flow(flow_table, OFTABLE_LOCAL_OUTPUT, 100,
                         binding->header_.uuid.parts[0],
                         &match, ofpacts_p, &binding->header_.uuid);
+
+        /* Table 39, priority 180.
+         * =======================
+         *
+         * Forward local traffic from a localport to a localnet port
+         * when the gateway chassis has an external port. */
+        if (!strcmp(binding->type, "external")) {
+            match_init_catchall(&match);
+            ofpbuf_clear(ofpacts_p);
+            match_set_metadata(&match, htonll(dp_key));
+            match_set_reg(&match, MFF_LOG_OUTPORT - MFF_REG0,
+                          localnet_port->tunnel_key);
+            match_set_reg_masked(&match, MFF_LOG_FLAGS - MFF_REG0,
+                                 MLF_LOCALPORT, MLF_LOCALPORT);
+            if (binding->chassis == chassis) {
+                /* Forward traffic from localport to localnet port */
+                for (int i = 0; i < MFF_N_LOG_REGS; i++) {
+                    put_load(0, MFF_REG0 + i, 0, 32, ofpacts_p);
+                }
+                put_resubmit(OFTABLE_LOG_EGRESS_PIPELINE, ofpacts_p);
+            }
+            ofctrl_add_flow(flow_table, OFTABLE_CHECK_LOOPBACK, 180,
+                            binding->header_.uuid.parts[0], &match,
+                            ofpacts_p, &binding->header_.uuid);
+        }
     } else {






 
From: 丁智慧
Date: 2021-10-19 09:41
To: bugs at openvswitch.org
Subject: The VM with SRIOV unable to get metadata from localport on gateway node.

Now we using external port type for a sriov interface,but when vm booting,the following problems occur:

[   98.774250] cloud-init[805]: 2021-10-15 18:49:10,676 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [3/120s]: request error [('Connection aborted.', error(113, 'No route to host'))]
[  101.780792] cloud-init[805]: 2021-10-15 18:49:13,682 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [6/120s]: request error [('Connection aborted.', error(113, 'No route to host'))]
[  104.788070] cloud-init[805]: 2021-10-15 18:49:16,689 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [9/120s]: request error [('Connection aborted.', error(113, 'No route to host'))]
[  107.792871] cloud-init[805]: 2021-10-15 18:49:19,695 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [12/120s]: request error [('Connection aborted.', error(113, 'No route to host'))]

And ovn-northd 21.06.0,ovn-controller 21.06.0, Open vSwitch Library 2.16.0,OpenStack W.

The Traffic from localport to localnet was dropped by this commit from 21.03 to 21.06 version.
https://github.com/ovn-org/ovn/commit/96959e56d634c8d888af9e3ee340602593c7e4fa.
--> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20211019/d7be3cea/attachment.html>


More information about the discuss mailing list