@@ -960,7 +960,8 @@ claim_lport(const struct sbrec_port_binding *pb,
/* Check if the port encap binding, if any, has changed */
struct sbrec_encap *encap_rec =
sbrec_get_port_encap(chassis_rec, iface_rec);
- if (encap_rec && pb->encap != encap_rec) {
+ if ((encap_rec && pb->encap != encap_rec) ||
+ (!encap_rec && pb->encap)) {
if (sb_readonly) {
return false;
}
@@ -2462,6 +2462,15 @@ encap_rec=$(fetch_column Encap _uuid chassis_name=hv2 type=geneve ip=192.168.0.2
check_row_count Port_Binding 1 logical_port=lp21 encap=$encap_rec
check_row_count Port_Binding 1 logical_port=lp22 encap=$encap_rec
+# Remove the encap-ip setting in vif, which should trigger encap removal from
+# Port_Binding.
+as hv1 ovs-vsctl remove Interface vif11 external-ids encap-ip
+wait_row_count Port_Binding 1 logical_port=lp11 'encap=[[]]'
+
+# Change it back and continue the test
+as hv1 ovs-vsctl set Interface vif11 external-ids:encap-ip=192.168.0.1
+wait_row_count Port_Binding 1 logical_port=lp11 'encap!=[[]]'
+
# Pre-populate the hypervisors' ARP tables so that we don't lose any
# packets for ARP resolution (native tunneling doesn't queue packets
# for ARP resolution).
The external_ids:encap-ip was supported to optionally specify encap IP for a logical switch port. However, when the external_ids:encap-ip is unset, the implementation didn't clear the column in Port_Binding. This patch fixes it and updated the test to cover this scenario. Fixes: dd527a283cd8 ("Support for multiple VTEP in OVN") Cc: Venugopal Iyer <venugopali@nvidia.com> Signed-off-by: Han Zhou <hzhou@ovn.org> --- controller/binding.c | 3 ++- tests/ovn.at | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)