iPXE
|
Infiniband path lookups. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_mi.h>
#include <ipxe/ib_pathrec.h>
Go to the source code of this file.
Data Structures | |
struct | ib_cached_path |
A cached path. More... | |
Macros | |
#define | IB_NUM_CACHED_PATHS 4 |
Number of path cache entries. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | ib_path_complete (struct ib_device *ibdev, struct ib_mad_interface *mi, struct ib_mad_transaction *madx, int rc, union ib_mad *mad, struct ib_address_vector *av __unused) |
Handle path transaction completion. More... | |
struct ib_path * | ib_create_path (struct ib_device *ibdev, struct ib_address_vector *av, struct ib_path_operations *op) |
Create path. More... | |
void | ib_destroy_path (struct ib_device *ibdev, struct ib_path *path) |
Destroy path. More... | |
static struct ib_cached_path * | ib_find_path_cache_entry (struct ib_device *ibdev, union ib_gid *dgid) |
Find path cache entry. More... | |
static void | ib_cached_path_complete (struct ib_device *ibdev, struct ib_path *path, int rc, struct ib_address_vector *av __unused) |
Handle cached path transaction completion. More... | |
int | ib_resolve_path (struct ib_device *ibdev, struct ib_address_vector *av) |
Resolve path. More... | |
Variables | |
static struct ib_mad_transaction_operations | ib_path_op |
Path transaction completion operations. More... | |
static struct ib_cached_path | ib_path_cache [IB_NUM_CACHED_PATHS] |
Path cache. More... | |
static unsigned int | ib_path_cache_idx |
Oldest path cache entry index. More... | |
static struct ib_path_operations | ib_cached_path_op |
Cached path transaction completion operations. More... | |
Infiniband path lookups.
Definition in file ib_pathrec.c.
#define IB_NUM_CACHED_PATHS 4 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Handle path transaction completion.
ibdev | Infiniband device |
mi | Management interface |
madx | Management transaction |
rc | Status code |
mad | Received MAD (or NULL on error) |
av | Source address vector (or NULL on error) |
Definition at line 51 of file ib_pathrec.c.
References ib_path::av, ib_path_operations::complete, DBGC, dgid, ib_path_record::dlid, ENETUNREACH, ib_address_vector::gid, ib_device::gid, ib_address_vector::gid_present, ib_mad::hdr, htons, ib_destroy_madx(), IB_GID_ARGS, IB_GID_FMT, ib_madx_get_ownerdata(), IB_MGMT_STATUS_OK, ib_address_vector::lid, mad, ib_path::madx, memcmp(), ib_device::name, ntohs, NULL, ib_path::op, out, ib_sa_data::path_record, ib_gid::prefix, ib_address_vector::rate, ib_path_record::rate_selector__rate, rc, ib_path_record::reserved__sl, ib_gid::s, ib_mad::sa, ib_mad_sa::sa_data, ib_address_vector::sl, ib_mad_hdr::status, and strerror().
struct ib_path* ib_create_path | ( | struct ib_device * | ibdev, |
struct ib_address_vector * | av, | ||
struct ib_path_operations * | op | ||
) |
Create path.
ibdev | Infiniband device |
av | Address vector to complete |
op | Path operations |
path | Path |
Definition at line 107 of file ib_pathrec.c.
References ib_path::av, free, ib_address_vector::gid, ib_device::gid, ib_device::gsi, htonl, htons, ib_create_madx(), ib_destroy_madx(), ib_madx_set_ownerdata(), IB_MGMT_CLASS_SUBN_ADM, IB_MGMT_METHOD_GET, ib_path_op, IB_SA_ATTR_PATH_REC, IB_SA_CLASS_VERSION, IB_SA_PATH_REC_DGID, IB_SA_PATH_REC_SGID, ib_path::ibdev, mad, ib_path::madx, memcpy(), memset(), NULL, ib_path::op, op, ib_mad::sa, sa, and zalloc().
Referenced by ib_create_conn(), and ib_resolve_path().
Destroy path.
ibdev | Infiniband device |
path | Path |
Definition at line 156 of file ib_pathrec.c.
References free, ib_device::gsi, ib_destroy_madx(), and ib_path::madx.
Referenced by ib_cached_path_complete(), ib_cm_path_complete(), ib_create_conn(), ib_destroy_conn(), and ib_resolve_path().
|
static |
Find path cache entry.
ibdev | Infiniband device |
dgid | Destination GID |
path | Path cache entry, or NULL |
Definition at line 189 of file ib_pathrec.c.
References ib_path::av, dgid, ib_address_vector::gid, IB_NUM_CACHED_PATHS, ib_path_cache, ib_path::ibdev, memcmp(), NULL, and ib_cached_path::path.
Referenced by ib_resolve_path().
|
static |
Handle cached path transaction completion.
ibdev | Infiniband device |
path | Path |
rc | Status code |
av | Address vector, or NULL on error |
Definition at line 216 of file ib_pathrec.c.
References ib_destroy_path(), ib_path_get_ownerdata(), memset(), ib_cached_path::path, and rc.
int ib_resolve_path | ( | struct ib_device * | ibdev, |
struct ib_address_vector * | av | ||
) |
Resolve path.
ibdev | Infiniband device |
av | Address vector to complete |
rc | Return status code |
This provides a non-transactional way to resolve a path, via a cache similar to ARP.
Definition at line 249 of file ib_pathrec.c.
References ib_path::av, DBGC, DBGC2, ENOENT, ENOMEM, gid, ib_address_vector::gid, ib_address_vector::gid_present, ib_cached_path_op, ib_create_path(), ib_destroy_path(), ib_find_path_cache_entry(), IB_GID_ARGS, IB_GID_FMT, IB_NUM_CACHED_PATHS, ib_path_cache, ib_path_cache_idx, ib_path_set_ownerdata(), ib_address_vector::lid, memset(), ib_device::name, ib_cached_path::path, ib_address_vector::rate, and ib_address_vector::sl.
Referenced by eoib_duplicate(), eoib_tx_av(), and ipoib_transmit().
|
static |
Path transaction completion operations.
Definition at line 94 of file ib_pathrec.c.
Referenced by ib_create_path().
|
static |
Path cache.
Definition at line 176 of file ib_pathrec.c.
Referenced by ib_find_path_cache_entry(), and ib_resolve_path().
|
static |
Oldest path cache entry index.
Definition at line 179 of file ib_pathrec.c.
Referenced by ib_resolve_path().
|
static |
Cached path transaction completion operations.
Definition at line 235 of file ib_pathrec.c.
Referenced by ib_resolve_path().