lkml.org 
[lkml]   [2018]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v2] neighbour: confirm neigh entries when ARP packet is received
    On Tue, 11 Sep 2018 11:04:06 -0700
    Vasily Khoruzhick <vasilykh@arista.com> wrote:

    > diff --git a/net/core/neighbour.c b/net/core/neighbour.c
    > index aa19d86937af..56a554597db5 100644
    > --- a/net/core/neighbour.c
    > +++ b/net/core/neighbour.c
    > @@ -1180,6 +1180,12 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
    > lladdr = neigh->ha;
    > }
    >
    > + /* Update confirmed timestamp for neighbour entry after we
    > + * received ARP packet even if it doesn't change IP to MAC binding.
    > + */
    > + if (new & NUD_CONNECTED)
    > + neigh->confirmed = jiffies;

    You might want to do:
    if ((new & NUD_CONNECTED) && neigh->confirmed != jiffies)
    neigh->confirmed = jiffies;

    This avoid poisoning the cacheline with unnecessary write.

    \
     
     \ /
      Last update: 2018-09-11 20:12    [W:8.067 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site