[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 12 Dec 2013 12:20:14 -0800
From: Jesse Gross <jesse@...ira.com>
To: Francesco Fusco <ffusco@...hat.com>
Cc: netdev <netdev@...r.kernel.org>,
"dev@...nvswitch.org" <dev@...nvswitch.org>,
Daniel Borkmann <dborkman@...hat.com>,
Thomas Graf <tgraf@...hat.com>
Subject: Re: [PATCH net-next v2 2/2] net: ovs: use CRC32 accelerated flow hash
if available
On Thu, Dec 12, 2013 at 7:09 AM, Francesco Fusco <ffusco@...hat.com> wrote:
> Currently OVS uses jhash2() for calculating flow hashes in its
> internal flow_hash() function. The performance of the flow_hash()
> function is critical, as the input data can be hundreds of bytes
> long.
>
> OVS is largely deployed in x86_64 based datacenters. Therefore,
> we argue that the performance critical fast path of OVS should
> exploit underlying CPU features in order to reduce the per packet
> processing costs. We replace jhash2 with the hash implementation
> provided by the kernel hash lib, which exploits the crc32l
> instruction to achieve high performance
>
> Our patch greatly reduces the hash footprint from ~200 cycles of
> jhash2() to around ~90 cycles in case of ovs_flow_hash_crc()
> (measured with rdtsc over maximum length flow keys on an i7 Intel
> CPU).
>
> Additionally, we wrote a microbenchmark to stress the flow table
> performance. The benchmark inserts random flows into the flow
> hash and then performs lookups. Our hash deployed on a CRC32
> capable CPU reduces the lookup for 1000 flows, 100 masks from
> ~10,100us to ~6,700us, for example.
>
> Thus, simply use the newly introduced arch_fast_hash2() as a
> drop-in replacement.
>
> Signed-off-by: Francesco Fusco <ffusco@...hat.com>
> Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
> Signed-off-by: Thomas Graf <tgraf@...hat.com>
Acked-by: Jesse Gross <jesse@...ira.com>
Out of curiosity, did you try using crc32q? OVS data structures are
already aligned to 8 bytes. It would also be interesting to know if a
parallelized implementation is worthwhile, although my guess is that
the OVS flow key is not quite long enough.
--
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