The rationale for locking mac learning table entires wrt. gratuitous
ARP packets and bond interfaces was too cryptic for me to understand.
After reading vswitchd/INTERNALS the issue is understandable, but we
can still improve the comment to prevent such confusion in future.

Signed-off-by: Jarno Rajahalme <ja...@ovn.org>
---
 ofproto/ofproto-dpif-xlate.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 1e2957c..74e3387 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -2077,8 +2077,13 @@ OVS_REQ_RDLOCK(ml->rwlock)
     }
 
     if (is_gratuitous_arp(flow, wc)) {
-        /* We don't want to learn from gratuitous ARP packets that are
-         * reflected back over bond slaves so we lock the learning table. */
+        /* Gratuitous ARP packets received over non-bond interfaces could be
+         * reflected back over bond slaves.  We don't want to learn from these
+         * reflected packets, so we lock each entry for which a gratuitous ARP
+         * packet was received over a non-bond interface and refrain from
+         * learning from gratuitous ARP packets that arrive over bond
+         * interfaces for this entry while the lock is in effect.  See
+         * vswitchd/INTERNALS for more in-depth discussion on this topic. */
         if (!in_xbundle->bond) {
             return true;
         } else if (mac_entry_is_grat_arp_locked(mac)) {
-- 
2.1.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to