[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131023141309.GC26236@order.stressinduktion.org>
Date: Wed, 23 Oct 2013 16:13:09 +0200
From: Hannes Frederic Sowa <hannes@...essinduktion.org>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com
Subject: Re: [PATCH net-next 2/2] net: initialize hashrnd in flow_dissector with net_get_random_once
On Wed, Oct 23, 2013 at 06:58:34AM -0700, Eric Dumazet wrote:
> On Wed, 2013-10-23 at 13:12 +0200, Hannes Frederic Sowa wrote:
> > We also can defer the initialization of hashrnd in flow_dissector
> > to its first use. Since net_get_random_once is irqsave now we don't
> > have to audit the call paths if one of this functions get called by an
> > interrupt handler.
> >
> > Cc: David S. Miller <davem@...emloft.net>
> > Cc: Eric Dumazet <edumazet@...gle.com>
> > Signed-off-by: Hannes Frederic Sowa <hannes@...essinduktion.org>
> > ---
>
> This really works well if CONFIG_JUMP_LABEL=y
>
> I am afraid some arches do not really have this.
This is the problem with all users of net_get_random_once.
If an architecture does not have JUMP_LABEL or gcc does not provide
CC_HAVE_ASM_GOTO we have an unlikely branch in the code path and branch
to the epilogue of the function to generate the hash for the first
time. After that it's "just" a likely atomic boolean test.
I guess it is not that important to have a good secret hash key here as
this is solely used to dispatch the packets to cpus and does not store
anything in tables.
Greetings,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists