net/mlx5: fix deprecated library API for Rx padding
authorYongseok Koh <yskoh@mellanox.com>
Tue, 15 Jan 2019 17:38:59 +0000 (09:38 -0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Jan 2019 08:47:26 +0000 (09:47 +0100)
In rdma-core library IBV_WQ_FLAG_RX_END_PADDING is renamed to
IBV_WQ_FLAGS_PCI_WRITE_END_PADDING. Way to query the capability is also
changed.

Fixes: 43e9d9794cde ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org
Signed-off-by: Yongseok Koh <yskoh@mellanox.com>
Reviewed-by: Erez Ferber <erezf@mellanox.com>
Acked-by: Shahaf Shuler <shahafs@mellanox.com>
drivers/net/mlx5/Makefile
drivers/net/mlx5/meson.build
drivers/net/mlx5/mlx5.c
drivers/net/mlx5/mlx5_rxq.c

index 688678a..9a7da18 100644 (file)
@@ -120,6 +120,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
                infiniband/verbs.h \
                enum IBV_FLOW_SPEC_MPLS \
                $(AUTOCONF_OUTPUT)
+       $Q sh -- '$<' '$@' \
+               HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING \
+               infiniband/verbs.h \
+               enum IBV_WQ_FLAGS_PCI_WRITE_END_PADDING \
+               $(AUTOCONF_OUTPUT)
        $Q sh -- '$<' '$@' \
                HAVE_IBV_WQ_FLAG_RX_END_PADDING \
                infiniband/verbs.h \
index 6413cef..4540c45 100644 (file)
@@ -103,6 +103,8 @@ if build
                'mlx5dv_create_flow_action_packet_reformat' ],
                [ 'HAVE_IBV_DEVICE_MPLS_SUPPORT', 'infiniband/verbs.h',
                'IBV_FLOW_SPEC_MPLS' ],
+               [ 'HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING', 'infiniband/verbs.h',
+               'IBV_WQ_FLAGS_PCI_WRITE_END_PADDING' ],
                [ 'HAVE_IBV_WQ_FLAG_RX_END_PADDING', 'infiniband/verbs.h',
                'IBV_WQ_FLAG_RX_END_PADDING' ],
                [ 'HAVE_IBV_DEVX_OBJ', 'infiniband/mlx5dv.h',
index 741bc7f..a913a59 100644 (file)
@@ -1066,8 +1066,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                                 IBV_RAW_PACKET_CAP_SCATTER_FCS);
        DRV_LOG(DEBUG, "FCS stripping configuration is %ssupported",
                (config.hw_fcs_strip ? "" : "not "));
-#ifdef HAVE_IBV_WQ_FLAG_RX_END_PADDING
+#if defined(HAVE_IBV_WQ_FLAG_RX_END_PADDING)
        hw_padding = !!attr.rx_pad_end_addr_align;
+#elif defined(HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING)
+       hw_padding = !!(attr.device_cap_flags_ex &
+                       IBV_DEVICE_PCI_WRITE_END_PADDING);
 #endif
        if (config.hw_padding && !hw_padding) {
                DRV_LOG(DEBUG, "Rx end alignment padding isn't supported");
index 34c8338..10b6ce0 100644 (file)
@@ -881,12 +881,15 @@ mlx5_rxq_ibv_new(struct rte_eth_dev *dev, uint16_t idx)
                attr.wq.ibv.create_flags |= IBV_WQ_FLAGS_SCATTER_FCS;
                attr.wq.ibv.comp_mask |= IBV_WQ_INIT_ATTR_FLAGS;
        }
-#ifdef HAVE_IBV_WQ_FLAG_RX_END_PADDING
        if (config->hw_padding) {
+#if defined(HAVE_IBV_WQ_FLAG_RX_END_PADDING)
                attr.wq.ibv.create_flags |= IBV_WQ_FLAG_RX_END_PADDING;
                attr.wq.ibv.comp_mask |= IBV_WQ_INIT_ATTR_FLAGS;
-       }
+#elif defined(HAVE_IBV_WQ_FLAGS_PCI_WRITE_END_PADDING)
+               attr.wq.ibv.create_flags |= IBV_WQ_FLAGS_PCI_WRITE_END_PADDING;
+               attr.wq.ibv.comp_mask |= IBV_WQ_INIT_ATTR_FLAGS;
 #endif
+       }
 #ifdef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT
        attr.wq.mlx5 = (struct mlx5dv_wq_init_attr){
                .comp_mask = 0,