Message ID | 1606818591-23265-1-git-send-email-dceara@redhat.com |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] pinctrl: Honor always_learn_from_arp_request for self created MAC_Bindings. | expand |
On Tue, Dec 1, 2020 at 4:00 PM Dumitru Ceara <dceara@redhat.com> wrote: > > Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html > Reported-by: Renat Nurgaliyev <impleman@gmail.com> > Suggested-by: Han Zhou <hzhou@ovn.org> > Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by self originated GARPs.") > Signed-off-by: Dumitru Ceara <dceara@redhat.com> Thanks for the fix. I applied this patch to master. I think this needs to be backported, but it doesn't apply cleanly to the branch. Can you please submit the backport patches ? Thanks Numan > --- > controller/pinctrl.c | 7 +++++++ > northd/ovn-northd.c | 7 +++++++ > tests/ovn.at | 19 +++++++++++++++++++ > 3 files changed, 33 insertions(+) > > diff --git a/controller/pinctrl.c b/controller/pinctrl.c > index 291202c..c6540c1 100644 > --- a/controller/pinctrl.c > +++ b/controller/pinctrl.c > @@ -3907,6 +3907,13 @@ send_garp_locally(struct ovsdb_idl_txn *ovnsb_idl_txn, > continue; > } > > + /* Skip datapaths that don't automatically learn ARPs from requests. */ > + if (!smap_get_bool(&remote->datapath->external_ids, > + "always_learn_from_arp_request", > + true)) { > + continue; > + } > + > struct ds ip_s = DS_EMPTY_INITIALIZER; > > ip_format_masked(ip, OVS_BE32_MAX, &ip_s); > diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c > index 47a177c..4ca0271 100644 > --- a/northd/ovn-northd.c > +++ b/northd/ovn-northd.c > @@ -1189,6 +1189,13 @@ ovn_datapath_update_external_ids(struct ovn_datapath *od) > if (nat_default_ct >= 0) { > smap_add_format(&ids, "snat-ct-zone", "%d", nat_default_ct); > } > + > + bool learn_from_arp_request = > + smap_get_bool(&od->nbr->options, "always_learn_from_arp_request", > + true); > + if (!learn_from_arp_request) { > + smap_add(&ids, "always_learn_from_arp_request", "false"); > + } > } > > sbrec_datapath_binding_set_external_ids(od->sb, &ids); > diff --git a/tests/ovn.at b/tests/ovn.at > index 5b7a64c..97e3e49 100644 > --- a/tests/ovn.at > +++ b/tests/ovn.at > @@ -15962,6 +15962,25 @@ fffffffffffff0000000010108060001080006040001f00000000101ac1804c8000000000000ac18 > fffffffffffff0000000010108060001080006040001f00000000101ac1804dd000000000000ac1804dd > ]) > > +# Now make sure that always_learn_from_arp_request=false is also honored > +# for locally injected mac bindings. > +check ovn-nbctl set logical_router lr0 options:always_learn_from_arp_request=false > +check ovn-nbctl set logical_router lr1 options:always_learn_from_arp_request=false > +check ovn-nbctl --wait=hv sync > + > +# Recreate two floating IPs, one for each VIF. > +check ovn-nbctl lr-nat-del lr0 dnat_and_snat 172.24.4.100 > +check ovn-nbctl lr-nat-del lr1 dnat_and_snat 172.24.4.200 > + > +check ovn-sbctl --all destroy mac_binding > + > +check ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.24.4.100 10.0.0.10 > +check ovn-nbctl lr-nat-add lr1 dnat_and_snat 172.24.4.200 20.0.0.10 > +check ovn-nbctl --wait=hv sync > + > +check_row_count MAC_Binding 0 logical_port=lr0-pub ip=172.24.4.200 > +check_row_count MAC_Binding 0 logical_port=lr1-pub ip=172.24.4.100 > + > OVN_CLEANUP([hv1]) > AT_CLEANUP > > -- > 1.8.3.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
On 12/1/20 2:29 PM, Numan Siddique wrote: > On Tue, Dec 1, 2020 at 4:00 PM Dumitru Ceara <dceara@redhat.com> wrote: >> >> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html >> Reported-by: Renat Nurgaliyev <impleman@gmail.com> >> Suggested-by: Han Zhou <hzhou@ovn.org> >> Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by self originated GARPs.") >> Signed-off-by: Dumitru Ceara <dceara@redhat.com> > > Thanks for the fix. I applied this patch to master. Thanks Numan! > > I think this needs to be backported, but it doesn't apply cleanly to > the branch. Can you please submit the backport patches ? > I sent a backport patch here: http://patchwork.ozlabs.org/project/ovn/patch/1606837724-23775-1-git-send-email-dceara@redhat.com/ Regards, Dumitru
On Tue, Dec 1, 2020 at 7:50 AM Dumitru Ceara <dceara@redhat.com> wrote: > > On 12/1/20 2:29 PM, Numan Siddique wrote: > > On Tue, Dec 1, 2020 at 4:00 PM Dumitru Ceara <dceara@redhat.com> wrote: > >> > >> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html > >> Reported-by: Renat Nurgaliyev <impleman@gmail.com> > >> Suggested-by: Han Zhou <hzhou@ovn.org> > >> Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by self originated GARPs.") > >> Signed-off-by: Dumitru Ceara <dceara@redhat.com> > > > > Thanks for the fix. I applied this patch to master. > > Thanks Numan! > > > > > I think this needs to be backported, but it doesn't apply cleanly to > > the branch. Can you please submit the backport patches ? > > > I sent a backport patch here: > http://patchwork.ozlabs.org/project/ovn/patch/1606837724-23775-1-git-send-email-dceara@redhat.com/ > > Regards, > Dumitru > Hi Dumitru and Numan, Sorry that I didn't get a chance to review it before it was merged. I figured out a problem and I sent a patch as a follow-up fix: https://patchwork.ozlabs.org/project/ovn/patch/20201202074553.1120122-1-hzhou@ovn.org/ Thanks, Han
On Wed, Dec 2, 2020 at 1:21 PM Han Zhou <hzhou@ovn.org> wrote: > > On Tue, Dec 1, 2020 at 7:50 AM Dumitru Ceara <dceara@redhat.com> wrote: > > > > On 12/1/20 2:29 PM, Numan Siddique wrote: > > > On Tue, Dec 1, 2020 at 4:00 PM Dumitru Ceara <dceara@redhat.com> wrote: > > >> > > >> Reported-at: > https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html > > >> Reported-by: Renat Nurgaliyev <impleman@gmail.com> > > >> Suggested-by: Han Zhou <hzhou@ovn.org> > > >> Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by > self originated GARPs.") > > >> Signed-off-by: Dumitru Ceara <dceara@redhat.com> > > > > > > Thanks for the fix. I applied this patch to master. > > > > Thanks Numan! > > > > > > > > I think this needs to be backported, but it doesn't apply cleanly to > > > the branch. Can you please submit the backport patches ? > > > > > I sent a backport patch here: > > > http://patchwork.ozlabs.org/project/ovn/patch/1606837724-23775-1-git-send-email-dceara@redhat.com/ > > > > Regards, > > Dumitru > > > > Hi Dumitru and Numan, > > Sorry that I didn't get a chance to review it before it was merged. I > figured out a problem and I sent a patch as a follow-up fix: > This patch was required to address a scale issue in our setup. Sorry that I merged it sooner and I missed the problem. Thanks for the follow up patch to address this. > https://patchwork.ozlabs.org/project/ovn/patch/20201202074553.1120122-1-hzhou@ovn.org/ > > Thanks, > Han > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev >
On Wed, Dec 2, 2020 at 1:28 AM Numan Siddique <numans@ovn.org> wrote: > > On Wed, Dec 2, 2020 at 1:21 PM Han Zhou <hzhou@ovn.org> wrote: > > > > On Tue, Dec 1, 2020 at 7:50 AM Dumitru Ceara <dceara@redhat.com> wrote: > > > > > > On 12/1/20 2:29 PM, Numan Siddique wrote: > > > > On Tue, Dec 1, 2020 at 4:00 PM Dumitru Ceara <dceara@redhat.com> wrote: > > > >> > > > >> Reported-at: > > https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html > > > >> Reported-by: Renat Nurgaliyev <impleman@gmail.com> > > > >> Suggested-by: Han Zhou <hzhou@ovn.org> > > > >> Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by > > self originated GARPs.") > > > >> Signed-off-by: Dumitru Ceara <dceara@redhat.com> > > > > > > > > Thanks for the fix. I applied this patch to master. > > > > > > Thanks Numan! > > > > > > > > > > > I think this needs to be backported, but it doesn't apply cleanly to > > > > the branch. Can you please submit the backport patches ? > > > > > > > I sent a backport patch here: > > > > > http://patchwork.ozlabs.org/project/ovn/patch/1606837724-23775-1-git-send-email-dceara@redhat.com/ > > > > > > Regards, > > > Dumitru > > > > > > > Hi Dumitru and Numan, > > > > Sorry that I didn't get a chance to review it before it was merged. I > > figured out a problem and I sent a patch as a follow-up fix: > > > > This patch was required to address a scale issue in our setup. Sorry > that I merged it sooner and I missed the problem. > Thanks for the follow up patch to address this. > Understand. No worries Numan. > > https://patchwork.ozlabs.org/project/ovn/patch/20201202074553.1120122-1-hzhou@ovn.org/ > > > > Thanks, > > Han > > _______________________________________________ > > dev mailing list > > dev@openvswitch.org > > https://mail.openvswitch.org/mailman/listinfo/ovs-dev > >
diff --git a/controller/pinctrl.c b/controller/pinctrl.c index 291202c..c6540c1 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -3907,6 +3907,13 @@ send_garp_locally(struct ovsdb_idl_txn *ovnsb_idl_txn, continue; } + /* Skip datapaths that don't automatically learn ARPs from requests. */ + if (!smap_get_bool(&remote->datapath->external_ids, + "always_learn_from_arp_request", + true)) { + continue; + } + struct ds ip_s = DS_EMPTY_INITIALIZER; ip_format_masked(ip, OVS_BE32_MAX, &ip_s); diff --git a/northd/ovn-northd.c b/northd/ovn-northd.c index 47a177c..4ca0271 100644 --- a/northd/ovn-northd.c +++ b/northd/ovn-northd.c @@ -1189,6 +1189,13 @@ ovn_datapath_update_external_ids(struct ovn_datapath *od) if (nat_default_ct >= 0) { smap_add_format(&ids, "snat-ct-zone", "%d", nat_default_ct); } + + bool learn_from_arp_request = + smap_get_bool(&od->nbr->options, "always_learn_from_arp_request", + true); + if (!learn_from_arp_request) { + smap_add(&ids, "always_learn_from_arp_request", "false"); + } } sbrec_datapath_binding_set_external_ids(od->sb, &ids); diff --git a/tests/ovn.at b/tests/ovn.at index 5b7a64c..97e3e49 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -15962,6 +15962,25 @@ fffffffffffff0000000010108060001080006040001f00000000101ac1804c8000000000000ac18 fffffffffffff0000000010108060001080006040001f00000000101ac1804dd000000000000ac1804dd ]) +# Now make sure that always_learn_from_arp_request=false is also honored +# for locally injected mac bindings. +check ovn-nbctl set logical_router lr0 options:always_learn_from_arp_request=false +check ovn-nbctl set logical_router lr1 options:always_learn_from_arp_request=false +check ovn-nbctl --wait=hv sync + +# Recreate two floating IPs, one for each VIF. +check ovn-nbctl lr-nat-del lr0 dnat_and_snat 172.24.4.100 +check ovn-nbctl lr-nat-del lr1 dnat_and_snat 172.24.4.200 + +check ovn-sbctl --all destroy mac_binding + +check ovn-nbctl lr-nat-add lr0 dnat_and_snat 172.24.4.100 10.0.0.10 +check ovn-nbctl lr-nat-add lr1 dnat_and_snat 172.24.4.200 20.0.0.10 +check ovn-nbctl --wait=hv sync + +check_row_count MAC_Binding 0 logical_port=lr0-pub ip=172.24.4.200 +check_row_count MAC_Binding 0 logical_port=lr1-pub ip=172.24.4.100 + OVN_CLEANUP([hv1]) AT_CLEANUP
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2020-November/377876.html Reported-by: Renat Nurgaliyev <impleman@gmail.com> Suggested-by: Han Zhou <hzhou@ovn.org> Fixes: a2b88dc51365 ("pinctrl: Directly update MAC_Bindings created by self originated GARPs.") Signed-off-by: Dumitru Ceara <dceara@redhat.com> --- controller/pinctrl.c | 7 +++++++ northd/ovn-northd.c | 7 +++++++ tests/ovn.at | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+)