On 12/10/2018 6:20 AM, Parav Pandit wrote: >> + >> +cdef class Gid(PyverbsObject): >> + cdef v.ibv_gid gid >> diff --git a/pyverbs/addr.pyx b/pyverbs/addr.pyx new file mode 100644 index >> 00000000..986521b9 >> --- /dev/null >> +++ b/pyverbs/addr.pyx >> @@ -0,0 +1,50 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB) # Copyright (c) >> +2018, Mellanox Technologies. All rights reserved. See COPYING file >> + >> +import sys >> +from libc.stdint cimport uint8_t >> +from .pyverbs_error import PyverbsUserError >> + >> +cdef extern from 'endian.h': >> + unsigned long be64toh(unsigned long host_64bits) >> + >> + >> +cdef class Gid(PyverbsObject): >> + """ >> + GID class represents ibv_gid. It enables user to query for GIDs values. >> + """ > A user usually wants to now the RoCE GID type and its associated netdev in case of RoCE. > So combining gid_attr in a 'gid' python object is more useful. User doesn't need to invoke multiple APIs to get a usable GID. > So please consider adding gid_attr (ndev, gid_type) to python gid object. > If it fails to read the gid_attr for zero gid, just have those strings as null and gid_type as invalid gid. Parav, your idea does seem a very comfortable solution for the user. However, Pyverbs is covering rdma-core API and as far as I know, it doesn't provide this information. Noa