]> git.droids-corp.org - dpdk.git/commitdiff
common/mlx5: fix relaxed ordering support detection
authorShiri Kuzin <shirik@mellanox.com>
Tue, 12 May 2020 12:21:44 +0000 (15:21 +0300)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 18 May 2020 18:35:56 +0000 (20:35 +0200)
Relaxed ordering is a PCI optimization that allows reordering
of reads/writes in order to improve performance.

In order to enable this optimization only when relaxed ordering
is supported, it is checked if IBV_ACCESS_RELAXED_ORDERING is
defined in verbs.h.

Since IBV_ACCESS_RELAXED_ORDERING is an enum and not
defined relaxed ordering wasn't enabled even when supported.

This issue is fixed by using AUTOCONF to check if relaxed
ordering is supported and disabling only if it isn't.

Fixes: 53ac93f71ad1 ("net/mlx5: create relaxed ordering memory regions")
Signed-off-by: Shiri Kuzin <shirik@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
drivers/common/mlx5/Makefile
drivers/common/mlx5/meson.build
drivers/common/mlx5/mlx5_glue.h

index 8b663ef25fd710ca0b42a9e88911d361457e25e5..0d8cc1bf577069ca6e9f2b976ed7968b49b2271b 100644 (file)
@@ -67,6 +67,11 @@ mlx5_autoconf.h.new: FORCE
 
 mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
        $Q $(RM) -f -- '$@'
+       $Q sh -- '$<' '$@' \
+               HAVE_IBV_RELAXED_ORDERING \
+               infiniband/verbs.h \
+               enum IBV_ACCESS_RELAXED_ORDERING \
+               $(AUTOCONF_OUTPUT)
        $Q sh -- '$<' '$@' \
                HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT \
                infiniband/mlx5dv.h \
index 165aa25523e8122af6c6505872dd15c00cf30840..5a802ba344ae0bcd74ccc0b87fa5d189944ac55f 100644 (file)
@@ -94,6 +94,8 @@ has_member_args = [
 # [ "MACRO to define if found", "header for the search",
 #   "symbol to search" ]
 has_sym_args = [
+       [ 'HAVE_IBV_RELAXED_ORDERING', 'infiniband/verbs.h',
+       'IBV_ACCESS_RELAXED_ORDERING ' ],
        [ 'HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT', 'infiniband/mlx5dv.h',
        'MLX5DV_CQE_RES_FORMAT_CSUM_STRIDX' ],
        [ 'HAVE_IBV_DEVICE_TUNNEL_SUPPORT', 'infiniband/mlx5dv.h',
index 184c41071e8cd6979919d28c53a3c0c27dbe7e8b..81d6a2267dc5e63ccec328e472684d34c7b9f766 100644 (file)
@@ -98,7 +98,7 @@ struct mlx5dv_var { uint32_t page_id; uint32_t length; off_t mmap_off;
                        uint64_t comp_mask; };
 #endif
 
-#ifndef IBV_ACCESS_RELAXED_ORDERING
+#ifndef HAVE_IBV_RELAXED_ORDERING
 #define IBV_ACCESS_RELAXED_ORDERING 0
 #endif