Skip to content

Commit

Permalink
Merge pull request #1419 from EdwardSro/pr-update-to-fc39
Browse files Browse the repository at this point in the history
Update to fc39
  • Loading branch information
jgunthorpe authored Jan 23, 2024
2 parents c8ee6b3 + 20ab780 commit bc6b4bc
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 78 deletions.
39 changes: 27 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,27 @@ if (NOT HAVE_WORKING_WERROR)
message(FATAL_ERROR "-Werror doesn't work (compiler always creates warnings?). Werror is required for CMake.")
endif()

# Look for Python. We prefer some variant of python 3 if the system has it.
FIND_PACKAGE(PythonInterp 3 QUIET)
if (PythonInterp_FOUND)
# pyverbs can only use python3:
if (NO_PYVERBS)
set(CYTHON_EXECUTABLE "")
# Use Python modules based on CMake version for backward compatibility
set(CYTHON_EXECUTABLE "")
if (${CMAKE_VERSION} VERSION_LESS "3.12")
# Look for Python. We prefer some variant of python 3 if the system has it
FIND_PACKAGE(PythonInterp 3 QUIET)
if (PythonInterp_FOUND)
# pyverbs can only use python3:
if (NOT NO_PYVERBS)
FIND_PACKAGE(cython)
endif()
else()
FIND_PACKAGE(cython)
# But we still must have python (be it 2) for the build process
FIND_PACKAGE(PythonInterp REQUIRED)
endif()
else()
# But we still must have python (be it 2) for the build process:
FIND_PACKAGE(PythonInterp REQUIRED)
set(CYTHON_EXECUTABLE "")
# FindPython looks preferably for Python3. If not found, version 2 is searched
FIND_PACKAGE(Python COMPONENTS Interpreter REQUIRED)
set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
if (NOT NO_PYVERBS AND Python_VERSION_MAJOR EQUAL 3)
FIND_PACKAGE(cython)
endif()
endif()

find_program(SYSTEMCTL_BIN systemctl HINTS "/usr/bin" "/bin")
Expand Down Expand Up @@ -450,8 +458,15 @@ if (CYTHON_EXECUTABLE)
# find a matching -devel installation but will happily return a non-matching
# one too. We need them both to match exactly to guarantee cython does the
# right thing.
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
EXACT REQUIRED)
if (${CMAKE_VERSION} VERSION_LESS "3.12")
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
EXACT REQUIRED)
else()
FIND_PACKAGE(Python ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}
EXACT COMPONENTS Development REQUIRED)
set(PYTHON_LIBRARIES ${Python_LIBRARIES})
set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS})
endif()

# Get a default installation path
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c
Expand Down
4 changes: 2 additions & 2 deletions buildlib/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resources:
image: ucfconsort.azurecr.io/rdma-core/centos9:44.0
endpoint: ucfconsort_registry
- container: fedora
image: ucfconsort.azurecr.io/rdma-core/fc38:46.0
image: ucfconsort.azurecr.io/rdma-core/fc39:49.0
endpoint: ucfconsort_registry
- container: xenial
image: ucfconsort.azurecr.io/rdma-core/ubuntu-16.04:28.0
Expand Down Expand Up @@ -195,7 +195,7 @@ stages:
CONTAINER: centos9
SPEC: redhat/rdma-core.spec
RPMBUILD_OPTS: --define 'EXTRA_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=1'
fedora38:
fedora39:
CONTAINER: fedora
SPEC: redhat/rdma-core.spec
RPMBUILD_OPTS: --define 'EXTRA_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug -DENABLE_WERROR=1'
Expand Down
8 changes: 4 additions & 4 deletions buildlib/cbuild
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ class centos9(Environment):
(" ".join(sorted(self.pkgs))))
return res

class fc38(Environment):
docker_parent = "fedora:38";
class fc39(Environment):
docker_parent = "fedora:39";
pkgs = centos8.pkgs | {"util-linux"}
name = "fc38";
name = "fc39";
specfile = "redhat/rdma-core.spec";
ninja_cmd = "ninja-build";
is_rpm = True;
Expand Down Expand Up @@ -626,7 +626,7 @@ environments = [centos7(),
jammy(),
jessie(),
stretch(),
fc38(),
fc39(),
leap(),
tumbleweed(),
debian_experimental(),
Expand Down
4 changes: 4 additions & 0 deletions pyverbs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ rdma_cython_module(pyverbs ""
enums.pyx
flow.pyx
fork.pyx
libibverbs.pyx
libibverbs_enums.pyx
librdmacm.pyx
librdmacm_enums.pyx
mem_alloc.pyx
mr.pyx
pd.pyx
Expand Down
5 changes: 4 additions & 1 deletion pyverbs/libibverbs.pxd
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2018, Mellanox Technologies. All rights reserved. See COPYING file

include 'libibverbs_enums.pxd'
#cython: language_level=3

from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
from posix.time cimport timespec
from pyverbs.libibverbs_enums cimport *


cdef extern from 'infiniband/verbs.h':

Expand Down
Empty file added pyverbs/libibverbs.pyx
Empty file.
Empty file added pyverbs/libibverbs_enums.pyx
Empty file.
7 changes: 5 additions & 2 deletions pyverbs/librdmacm.pxd
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019, Mellanox Technologies. All rights reserved. See COPYING file

include 'libibverbs.pxd'
include 'librdmacm_enums.pxd'
#cython: language_level=3

from libc.stdint cimport uint8_t, uint32_t
from pyverbs.librdmacm_enums cimport *
from pyverbs.libibverbs cimport *


cdef extern from '<rdma/rdma_cma.h>':

Expand Down
Empty file added pyverbs/librdmacm.pyx
Empty file.
Empty file added pyverbs/librdmacm_enums.pyx
Empty file.
3 changes: 3 additions & 0 deletions pyverbs/pd.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019, Mellanox Technologies. All rights reserved.

#cython: legacy_implicit_noexcept=True

from libc.stdint cimport uintptr_t, uint32_t
from libc.stdlib cimport malloc
import weakref
Expand Down
1 change: 1 addition & 0 deletions pyverbs/providers/efa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
rdma_cython_module(pyverbs/providers/efa efa
efa_enums.pyx
efadv.pyx
libefa.pyx
)
File renamed without changes.
22 changes: 0 additions & 22 deletions pyverbs/providers/efa/efa_enums.pyx
Original file line number Diff line number Diff line change
@@ -1,22 +0,0 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright 2020-2024 Amazon.com, Inc. or its affiliates. All rights reserved.

#cython: language_level=3

cdef extern from 'infiniband/efadv.h':

cpdef enum:
EFADV_DEVICE_ATTR_CAPS_RDMA_READ
EFADV_DEVICE_ATTR_CAPS_CQ_WITH_SGID
EFADV_DEVICE_ATTR_CAPS_RDMA_WRITE

cpdef enum:
EFADV_QP_DRIVER_TYPE_SRD

cpdef enum:
EFADV_WC_EX_WITH_SGID

cpdef enum:
EFADV_MR_ATTR_VALIDITY_RECV_IC_ID
EFADV_MR_ATTR_VALIDITY_RDMA_READ_IC_ID
EFADV_MR_ATTR_VALIDITY_RDMA_RECV_IC_ID
2 changes: 1 addition & 1 deletion pyverbs/providers/efa/efadv.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright 2020-2024 Amazon.com, Inc. or its affiliates. All rights reserved.

cimport pyverbs.providers.efa.efadv_enums as dve
cimport pyverbs.providers.efa.efa_enums as dve
cimport pyverbs.providers.efa.libefa as dv

from pyverbs.addr cimport GID
Expand Down
2 changes: 2 additions & 0 deletions pyverbs/providers/efa/libefa.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright 2020-2024 Amazon.com, Inc. or its affiliates. All rights reserved.

#cython: language_level=3

from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
cimport pyverbs.libibverbs as v

Expand Down
Empty file.
1 change: 1 addition & 0 deletions pyverbs/providers/mlx5/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ rdma_cython_module(pyverbs/providers/mlx5 mlx5
dr_matcher.pyx
dr_rule.pyx
dr_table.pyx
libmlx5.pyx
mlx5_enums.pyx
mlx5_vfio.pyx
mlx5dv.pyx
Expand Down
3 changes: 2 additions & 1 deletion pyverbs/providers/mlx5/libmlx5.pxd
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019 Mellanox Technologies, Inc. All rights reserved. See COPYING file

include 'mlx5dv_enums.pxd'
#cython: language_level=3

from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t
from posix.types cimport off_t
from libcpp cimport bool
cimport libc.stdio as s

from pyverbs.providers.mlx5.mlx5_enums cimport *
cimport pyverbs.libibverbs as v


Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,6 @@ cdef extern from 'infiniband/mlx5dv.h':
cdef unsigned long long MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID


_MLX5DV_RES_TYPE_QP = MLX5DV_RES_TYPE_QP
_MLX5DV_RES_TYPE_RWQ = MLX5DV_RES_TYPE_RWQ
_MLX5DV_RES_TYPE_DBR = MLX5DV_RES_TYPE_DBR
_MLX5DV_RES_TYPE_SRQ = MLX5DV_RES_TYPE_SRQ
_MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX = MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX
_MLX5DV_UAR_ALLOC_TYPE_BF = MLX5DV_UAR_ALLOC_TYPE_BF
_MLX5DV_UAR_ALLOC_TYPE_NC = MLX5DV_UAR_ALLOC_TYPE_NC
MLX5DV_QUERY_PORT_VPORT_ = MLX5DV_QUERY_PORT_VPORT
MLX5DV_QUERY_PORT_VPORT_VHCA_ID_ = MLX5DV_QUERY_PORT_VPORT_VHCA_ID
MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_RX_ = MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_RX
MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_TX_ = MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_TX
MLX5DV_QUERY_PORT_VPORT_REG_C0_ = MLX5DV_QUERY_PORT_VPORT_REG_C0
MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID_ = MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID


cdef extern from 'infiniband/mlx5_user_ioctl_verbs.h':
cdef enum mlx5_ib_uapi_flow_table_type:
pass
Expand All @@ -335,18 +320,3 @@ cdef extern from 'infiniband/mlx5_api.h':
cdef int MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL
cdef int MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2
cdef int MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL

MLX5DV_FLOW_TABLE_TYPE_RDMA_RX_ = MLX5DV_FLOW_TABLE_TYPE_RDMA_RX
MLX5DV_FLOW_TABLE_TYPE_RDMA_TX_ = MLX5DV_FLOW_TABLE_TYPE_RDMA_TX
MLX5DV_FLOW_TABLE_TYPE_NIC_RX_ = MLX5DV_FLOW_TABLE_TYPE_NIC_RX
MLX5DV_FLOW_TABLE_TYPE_NIC_TX_ = MLX5DV_FLOW_TABLE_TYPE_NIC_TX
MLX5DV_FLOW_TABLE_TYPE_FDB_ = MLX5DV_FLOW_TABLE_TYPE_FDB

MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL
1 change: 0 additions & 1 deletion pyverbs/providers/mlx5/mlx5_enums.pyx

This file was deleted.

34 changes: 34 additions & 0 deletions pyverbs/providers/mlx5/mlx5_enums.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2024 Nvidia All rights reserved.

#cython: language_level=3

_MLX5DV_RES_TYPE_QP = MLX5DV_RES_TYPE_QP
_MLX5DV_RES_TYPE_RWQ = MLX5DV_RES_TYPE_RWQ
_MLX5DV_RES_TYPE_DBR = MLX5DV_RES_TYPE_DBR
_MLX5DV_RES_TYPE_SRQ = MLX5DV_RES_TYPE_SRQ
_MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX = MLX5DV_PP_ALLOC_FLAGS_DEDICATED_INDEX
_MLX5DV_UAR_ALLOC_TYPE_BF = MLX5DV_UAR_ALLOC_TYPE_BF
_MLX5DV_UAR_ALLOC_TYPE_NC = MLX5DV_UAR_ALLOC_TYPE_NC

MLX5DV_QUERY_PORT_VPORT_ = MLX5DV_QUERY_PORT_VPORT
MLX5DV_QUERY_PORT_VPORT_VHCA_ID_ = MLX5DV_QUERY_PORT_VPORT_VHCA_ID
MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_RX_ = MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_RX
MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_TX_ = MLX5DV_QUERY_PORT_VPORT_STEERING_ICM_TX
MLX5DV_QUERY_PORT_VPORT_REG_C0_ = MLX5DV_QUERY_PORT_VPORT_REG_C0
MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID_ = MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID

MLX5DV_FLOW_TABLE_TYPE_RDMA_RX_ = MLX5DV_FLOW_TABLE_TYPE_RDMA_RX
MLX5DV_FLOW_TABLE_TYPE_RDMA_TX_ = MLX5DV_FLOW_TABLE_TYPE_RDMA_TX
MLX5DV_FLOW_TABLE_TYPE_NIC_RX_ = MLX5DV_FLOW_TABLE_TYPE_NIC_RX
MLX5DV_FLOW_TABLE_TYPE_NIC_TX_ = MLX5DV_FLOW_TABLE_TYPE_NIC_TX
MLX5DV_FLOW_TABLE_TYPE_FDB_ = MLX5DV_FLOW_TABLE_TYPE_FDB

MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TUNNEL_TO_L2
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L2_TUNNEL
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L3_TUNNEL_TO_L2
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL_ = \
MLX5DV_FLOW_ACTION_PACKET_REFORMAT_TYPE_L2_TO_L3_TUNNEL
2 changes: 1 addition & 1 deletion pyverbs/providers/mlx5/mlx5dv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from pyverbs.providers.mlx5.mlx5dv_crypto cimport Mlx5CryptoLoginAttr, Mlx5Crypt
from pyverbs.pyverbs_error import PyverbsUserError, PyverbsRDMAError, PyverbsError
from pyverbs.providers.mlx5.dr_action cimport DrActionFlowCounter, DrActionDestTir
from pyverbs.providers.mlx5.mlx5dv_sched cimport Mlx5dvSchedLeaf
cimport pyverbs.providers.mlx5.mlx5dv_enums as dve
cimport pyverbs.providers.mlx5.mlx5_enums as dve
cimport pyverbs.providers.mlx5.libmlx5 as dv
from pyverbs.mem_alloc import posix_memalign
from pyverbs.qp cimport QPInitAttrEx, QPEx
Expand Down
2 changes: 1 addition & 1 deletion pyverbs/providers/mlx5/mlx5dv_objects.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Note: This is not be confused with Mlx5<Obj> which holds the ibv_<obj>_ex that
from libc.stdint cimport uintptr_t, uint32_t

from pyverbs.pyverbs_error import PyverbsUserError, PyverbsRDMAError
cimport pyverbs.providers.mlx5.mlx5dv_enums as dve
cimport pyverbs.providers.mlx5.mlx5_enums as dve
cimport pyverbs.libibverbs as v


Expand Down

0 comments on commit bc6b4bc

Please sign in to comment.