[ovs-dev] [PATCH] dpif-netdev: Call cpuid for x86 isa availability.

Ilya Maximets i.maximets at ovn.org
Fri Nov 19 15:24:50 UTC 2021


On 11/19/21 16:04, David Marchand wrote:
> On Wed, Nov 3, 2021 at 4:32 PM Ilya Maximets <i.maximets at ovn.org> wrote:
>>
>> On 10/12/21 21:49, David Marchand wrote:
>>> DPIF AVX512 optimisations currently rely on DPDK availability while
>>> they can be used without DPDK.
>>> Besides, checking for availability of some isa only has to be done once
>>> and won't change while a OVS process runs.
>>>
>>> Resolve isa availability in constructors by using a simplified query
>>> based on cpuid API that comes from the compiler.
>>>
>>> Note: this also fixes the check on BMI2 availability: DPDK had a bug
>>> for this isa, see https://git.dpdk.org/dpdk/commit/?id=aae3037ab1e0.
>>>
>>> Suggested-by: Ilya Maximets <i.maximets at ovn.org>
>>> Signed-off-by: David Marchand <david.marchand at redhat.com>
>>> ---
>>>  lib/automake.mk                        |  2 +
>>>  lib/cpu.c                              | 68 ++++++++++++++++++++++++++
>>>  lib/cpu.h                              | 34 +++++++++++++
>>>  lib/dpdk-stub.c                        |  9 ----
>>>  lib/dpdk.c                             | 52 --------------------
>>>  lib/dpdk.h                             |  1 -
>>>  lib/dpif-netdev-avx512.c               |  5 +-
>>>  lib/dpif-netdev-extract-avx512.c       | 14 +++---
>>>  lib/dpif-netdev-lookup-avx512-gather.c |  7 +--
>>>  9 files changed, 118 insertions(+), 74 deletions(-)
>>>  create mode 100644 lib/cpu.c
>>>  create mode 100644 lib/cpu.h
>>>
>>
>> Hi, David.  Thanks ofr the patch!
>>
>> I didn't check the actual values of cpuid bits, but the overall design
>> and implementation looks great!  This way non-dpdk setups (e.g. afxdp)
>> will be able to use optimized lookup functions.  This will also make
>> unit-testing easier.  This patch also eliminated string comparisons, which
>> is good to see.
>>
>> Next step, I suppose, will be to move AVX512 tests out of the DPDK testsuite
>> to one of generic ones?
> 
> If you refer to 50be6715c083 ("test/sytem-dpdk: Add unit test for mfex
> autovalidator"), there is another step in this direction by removing
> dependency on the net/pcap DPDK driver.
> https://patchwork.ozlabs.org/project/openvswitch/patch/20210927135732.16175-2-david.marchand@redhat.com/

Yes.  I'm aware of that.  After both patches accepted, there will be
no need to keep miniflow_extract tests in the system-dpdk testsuite.

> 
> 
>>
>> Harry, Cian, Amber, could you, please, review/test this out on your setup?
> 
> 
> Thanks.
> 



More information about the dev mailing list