@@ -1555,20 +1555,26 @@ bool net_device_val::verify_qp_creation(const char* ifname, enum ibv_qp_type qp_
15551555
15561556 qp = vma_ibv_create_qp (p_ib_ctx->get_ibv_pd (), &qp_init_attr);
15571557 if (qp) {
1558- success = true ;
1559- if (!priv_ibv_query_flow_tag_supported (qp, get_port_from_ifname (base_ifname))) {
1560- p_ib_ctx->set_flow_tag_capability (true );
1561- }
1562- nd_logdbg (" verified interface %s for flow tag capabilities : %s" , ifname, p_ib_ctx->get_flow_tag_capability () ? " enabled" : " disabled" );
1558+ if (qp_type == IBV_QPT_UD && priv_ibv_create_flow_supported (qp, get_port_from_ifname (base_ifname)) == -1 ) {
1559+ nd_logdbg (" Create_ibv_flow failed on interface %s (errno=%d %m), Traffic will not be offloaded" , ifname, errno);
1560+ goto qp_failure;
1561+ } else {
1562+ success = true ;
1563+ if (qp_type == IBV_QPT_RAW_PACKET && !priv_ibv_query_flow_tag_supported (qp, get_port_from_ifname (base_ifname))) {
1564+ p_ib_ctx->set_flow_tag_capability (true );
15631565
1566+ }
1567+ nd_logdbg (" verified interface %s for flow tag capabilities : %s" , ifname, p_ib_ctx->get_flow_tag_capability () ? " enabled" : " disabled" );
1568+ }
15641569 } else {
1565- nd_logdbg (" QP creation failed on interface %s (errno=%d %m), Traffic will not be offloaded \n " , ifname, errno);
1570+ nd_logdbg (" QP creation failed on interface %s (errno=%d %m), Traffic will not be offloaded" , ifname, errno);
1571+ qp_failure:
15661572 int err = errno; // verify_raw_qp_privliges can overwrite errno so keep it before the call
15671573 if (validate_raw_qp_privliges () == 0 ) {
15681574 // MLNX_OFED raw_qp_privliges file exist with bad value
15691575 vlog_printf (VLOG_WARNING," *******************************************************************************************************\n " );
15701576 vlog_printf (VLOG_WARNING," * Interface %s will not be offloaded.\n " , ifname);
1571- vlog_printf (VLOG_WARNING," * Working in this mode might causes VMA malfunction over Ethernet interfaces\n " );
1577+ vlog_printf (VLOG_WARNING," * Working in this mode might causes VMA malfunction over Ethernet/InfiniBand interfaces\n " );
15721578 vlog_printf (VLOG_WARNING," * WARNING: the following steps will restart your network interface!\n " );
15731579 vlog_printf (VLOG_WARNING," * 1. \" echo options ib_uverbs disable_raw_qp_enforcement=1 > /etc/modprobe.d/ib_uverbs.conf\"\n " );
15741580 vlog_printf (VLOG_WARNING," * 2. Restart openibd or rdma service depending on your system configuration\n " );
0 commit comments