diff mbox

[ovs-dev] xlate: Clarify comment about mac learning table entry locking.

Message ID 1472863841-66523-1-git-send-email-jarno@ovn.org
State Accepted
Headers show

Commit Message

Jarno Rajahalme Sept. 3, 2016, 12:50 a.m. UTC
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 <jarno@ovn.org>
---
 ofproto/ofproto-dpif-xlate.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

Ben Pfaff Sept. 3, 2016, 1:37 a.m. UTC | #1
On Fri, Sep 02, 2016 at 05:50:41PM -0700, Jarno Rajahalme wrote:
> 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 <jarno@ovn.org>

Acked-by: Ben Pfaff <blp@ovn.org>
Jarno Rajahalme Sept. 6, 2016, 7:31 p.m. UTC | #2
> On Sep 2, 2016, at 6:37 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> On Fri, Sep 02, 2016 at 05:50:41PM -0700, Jarno Rajahalme wrote:
>> 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 <jarno@ovn.org>
> 
> Acked-by: Ben Pfaff <blp@ovn.org>

Pushed to master,

  Jarno
diff mbox

Patch

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)) {