iPXE
|
SCSI RDMA Protocol over Infiniband. More...
#include <stdlib.h>
#include <errno.h>
#include <ipxe/interface.h>
#include <ipxe/uri.h>
#include <ipxe/open.h>
#include <ipxe/base16.h>
#include <ipxe/acpi.h>
#include <ipxe/efi/efi_path.h>
#include <ipxe/srp.h>
#include <ipxe/infiniband.h>
#include <ipxe/ib_cmrc.h>
#include <ipxe/ib_srp.h>
Go to the source code of this file.
Data Structures | |
struct | ib_srp_root_path |
IB SRP root path parameters. More... | |
struct | ib_srp_root_path_parser |
IB SRP root path component parser. More... | |
Macros | |
#define | EINVAL_BYTE_STRING_LEN __einfo_error ( EINFO_EINVAL_BYTE_STRING_LEN ) |
#define | EINFO_EINVAL_BYTE_STRING_LEN |
#define | EINVAL_INTEGER __einfo_error ( EINFO_EINVAL_INTEGER ) |
#define | EINFO_EINVAL_INTEGER |
#define | EINVAL_RP_TOO_SHORT __einfo_error ( EINFO_EINVAL_RP_TOO_SHORT ) |
#define | EINFO_EINVAL_RP_TOO_SHORT |
#define | IB_SRP_NUM_RP_COMPONENTS ( sizeof ( ib_srp_rp_parser ) / sizeof ( ib_srp_rp_parser[0] ) ) |
Number of IB SRP root path components. More... | |
Enumerations | |
enum | ib_srp_parse_flags { IB_SRP_PARSE_REQUIRED = 0x0000, IB_SRP_PARSE_OPTIONAL = 0x8000, IB_SRP_PARSE_FLAG_MASK = 0xf000 } |
IB SRP parse flags. More... | |
Functions | |
FILE_LICENCE (BSD2) | |
static void | ib_srp_free (struct refcnt *refcnt) |
Free IB SRP device. More... | |
static void | ib_srp_close (struct ib_srp_device *ib_srp, int rc) |
Close IB SRP device. More... | |
static struct acpi_descriptor * | ib_srp_describe (struct ib_srp_device *ib_srp) |
Get IB SRP ACPI descriptor. More... | |
static int | ib_srp_open (struct interface *block, struct ib_device *ibdev, union ib_gid *dgid, union ib_guid *service_id, union srp_port_id *initiator, union srp_port_id *target, struct scsi_lun *lun) |
Open IB SRP device. More... | |
static int | ib_srp_parse_byte_string (const char *rp_comp, uint8_t *bytes, unsigned int size_flags) |
Parse IB SRP root path byte-string value. More... | |
static int | ib_srp_parse_integer (const char *rp_comp, int default_value) |
Parse IB SRP root path integer value. More... | |
static int | ib_srp_parse_sgid (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path source GID. More... | |
static int | ib_srp_parse_initiator_id_ext (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path initiator identifier extension. More... | |
static int | ib_srp_parse_initiator_hca_guid (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path initiator HCA GUID. More... | |
static int | ib_srp_parse_dgid (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path destination GID. More... | |
static int | ib_srp_parse_pkey (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path partition key. More... | |
static int | ib_srp_parse_service_id (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path service ID. More... | |
static int | ib_srp_parse_lun (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path LUN. More... | |
static int | ib_srp_parse_target_id_ext (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path target identifier extension. More... | |
static int | ib_srp_parse_target_ioc_guid (const char *rp_comp, struct ib_srp_root_path *rp) |
Parse IB SRP root path target I/O controller GUID. More... | |
static int | ib_srp_parse_root_path (const char *rp_string, struct ib_srp_root_path *rp) |
Parse IB SRP root path. More... | |
static int | ib_srp_open_uri (struct interface *parent, struct uri *uri) |
Open IB SRP URI. More... | |
static int | ib_sbft_complete (struct acpi_descriptor *desc __unused) |
Check if IB SRP boot firmware table descriptor is complete. More... | |
static int | ib_sbft_install (int(*install)(struct acpi_header *acpi)) |
Install IB SRP boot firmware table(s) More... | |
Variables | |
struct acpi_model ib_sbft_model | __acpi_model |
IB sBFT model. More... | |
static struct interface_operation | ib_srp_cmrc_op [] |
IB SRP CMRC interface operations. More... | |
static struct interface_descriptor | ib_srp_cmrc_desc |
IB SRP CMRC interface descriptor. More... | |
static struct interface_operation | ib_srp_srp_op [] |
IB SRP SRP interface operations. More... | |
static struct interface_descriptor | ib_srp_srp_desc |
IB SRP SRP interface descriptor. More... | |
static struct ib_srp_root_path_parser | ib_srp_rp_parser [] |
IB SRP root path components. More... | |
struct uri_opener ib_srp_uri_opener | __uri_opener |
IB SRP URI opener. More... | |
SCSI RDMA Protocol over Infiniband.
Definition in file ib_srp.c.
#define EINVAL_BYTE_STRING_LEN __einfo_error ( EINFO_EINVAL_BYTE_STRING_LEN ) |
#define EINFO_EINVAL_BYTE_STRING_LEN |
#define EINVAL_INTEGER __einfo_error ( EINFO_EINVAL_INTEGER ) |
#define EINFO_EINVAL_INTEGER |
#define EINVAL_RP_TOO_SHORT __einfo_error ( EINFO_EINVAL_RP_TOO_SHORT ) |
#define EINFO_EINVAL_RP_TOO_SHORT |
#define IB_SRP_NUM_RP_COMPONENTS ( sizeof ( ib_srp_rp_parser ) / sizeof ( ib_srp_rp_parser[0] ) ) |
enum ib_srp_parse_flags |
IB SRP parse flags.
Enumerator | |
---|---|
IB_SRP_PARSE_REQUIRED | |
IB_SRP_PARSE_OPTIONAL | |
IB_SRP_PARSE_FLAG_MASK |
FILE_LICENCE | ( | BSD2 | ) |
|
static |
Free IB SRP device.
refcnt | Reference count |
Definition at line 78 of file ib_srp.c.
References container_of, free, ib_srp_device::ibdev, and ibdev_put().
Referenced by ib_srp_open().
|
static |
Close IB SRP device.
ib_srp | IB SRP device |
rc | Reason for close |
Definition at line 92 of file ib_srp.c.
References ib_srp_device::cmrc, intf_shutdown(), rc, and ib_srp_device::srp.
Referenced by ib_srp_open().
|
static |
Get IB SRP ACPI descriptor.
ib_srp | IB SRP device |
desc | ACPI descriptor |
Definition at line 106 of file ib_srp.c.
References ib_srp_device::desc.
|
static |
Open IB SRP device.
block | Block control interface |
ibdev | Infiniband device |
dgid | Destination GID |
service_id | Service ID |
initiator | Initiator port ID |
target | Target port ID |
lun | SCSI LUN |
rc | Return status code |
Definition at line 143 of file ib_srp.c.
References acpi_init(), block, ib_srp_device::cmrc, DBGC, ib_srp_device::desc, sbft_ib_subtable::dgid, dgid, ENOMEM, ipxe_ib_sbft::ib, ib_cmrc_open(), IB_GID_ARGS, IB_GID_FMT, IB_GUID_ARGS, IB_GUID_FMT, ib_srp_close(), ib_srp_cmrc_desc, ib_srp_free(), ib_srp_srp_desc, ib_srp_device::ibdev, ibdev_get(), sbft_srp_subtable::initiator, intf_init(), lun, sbft_scsi_subtable::lun, memcpy(), rc, ib_device::rdma_key, ref_init, ref_put, ib_srp_device::refcnt, ib_srp_device::sbft, ipxe_ib_sbft::scsi, sbft_ib_subtable::service_id, service_id, ipxe_ib_sbft::srp, ib_srp_device::srp, srp_open(), strerror(), sbft_srp_subtable::target, and zalloc().
Referenced by ib_srp_open_uri().
|
static |
Parse IB SRP root path byte-string value.
rp_comp | Root path component string |
default_value | Default value to use if component string is empty |
value | Value |
Definition at line 242 of file ib_srp.c.
References bytes, EINVAL_BYTE_STRING_LEN, IB_SRP_PARSE_FLAG_MASK, IB_SRP_PARSE_OPTIONAL, size, and strlen().
Referenced by ib_srp_parse_dgid(), ib_srp_parse_initiator_hca_guid(), ib_srp_parse_initiator_id_ext(), ib_srp_parse_service_id(), ib_srp_parse_sgid(), ib_srp_parse_target_id_ext(), and ib_srp_parse_target_ioc_guid().
|
static |
Parse IB SRP root path integer value.
rp_comp | Root path component string |
default_value | Default value to use if component string is empty |
value | Value |
Definition at line 272 of file ib_srp.c.
References EINVAL_INTEGER, end, strtoul(), and value.
Referenced by ib_srp_parse_pkey().
|
static |
Parse IB SRP root path source GID.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 293 of file ib_srp.c.
References ib_gid::bytes, ib_device::gid, ib_srp_parse_byte_string(), IB_SRP_PARSE_OPTIONAL, last_opened_ibdev(), memcpy(), NULL, and ib_srp_root_path::sgid.
|
static |
Parse IB SRP root path initiator identifier extension.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 313 of file ib_srp.c.
References ib_guid::bytes, ib_srp_initiator_port_id::ib, ib_srp_parse_byte_string(), IB_SRP_PARSE_OPTIONAL, ib_srp_initiator_port_id::id_ext, and ib_srp_root_path::initiator.
|
static |
Parse IB SRP root path initiator HCA GUID.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 329 of file ib_srp.c.
References ib_guid::bytes, ib_gid::guid, ib_srp_initiator_port_id::hca_guid, ib_srp_initiator_port_id::ib, ib_srp_parse_byte_string(), IB_SRP_PARSE_OPTIONAL, ib_srp_root_path::initiator, memcpy(), ib_gid::s, and ib_srp_root_path::sgid.
|
static |
Parse IB SRP root path destination GID.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 349 of file ib_srp.c.
References ib_gid::bytes, ib_srp_root_path::dgid, ib_srp_parse_byte_string(), and IB_SRP_PARSE_REQUIRED.
|
static |
Parse IB SRP root path partition key.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 363 of file ib_srp.c.
References IB_PKEY_DEFAULT, ib_srp_parse_integer(), pkey, and ib_srp_root_path::pkey.
|
static |
Parse IB SRP root path service ID.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 380 of file ib_srp.c.
References ib_guid::bytes, ib_srp_parse_byte_string(), IB_SRP_PARSE_REQUIRED, and ib_srp_root_path::service_id.
|
static |
Parse IB SRP root path LUN.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 394 of file ib_srp.c.
References ib_srp_root_path::lun, and scsi_parse_lun().
|
static |
Parse IB SRP root path target identifier extension.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 406 of file ib_srp.c.
References ib_guid::bytes, ib_srp_target_port_id::ib, ib_srp_parse_byte_string(), IB_SRP_PARSE_REQUIRED, ib_srp_target_port_id::id_ext, and ib_srp_root_path::target.
|
static |
Parse IB SRP root path target I/O controller GUID.
rp_comp | Root path component string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 422 of file ib_srp.c.
References ib_guid::bytes, ib_srp_target_port_id::ib, ib_srp_parse_byte_string(), IB_SRP_PARSE_REQUIRED, ib_srp_target_port_id::ioc_guid, and ib_srp_root_path::target.
|
static |
Parse IB SRP root path.
rp_string | Root path string |
rp | IB SRP root path |
rc | Return status code |
Definition at line 467 of file ib_srp.c.
References DBG, EINVAL_RP_TOO_SHORT, ENOMEM, free, IB_SRP_NUM_RP_COMPONENTS, ib_srp_rp_parser, ib_srp_root_path_parser::parse, rc, strdup(), and strerror().
Referenced by ib_srp_open_uri().
Open IB SRP URI.
parent | Parent interface |
uri | URI |
rc | Return status code |
Definition at line 525 of file ib_srp.c.
References DBG, ib_srp_root_path::dgid, EINVAL, ENODEV, find_ibdev(), ib_srp_open(), ib_srp_parse_root_path(), ib_srp_root_path::initiator, ib_srp_root_path::lun, memset(), uri::opaque, rc, ib_srp_root_path::service_id, ib_srp_root_path::sgid, ib_srp_target_port_id::srp, ib_srp_initiator_port_id::srp, and ib_srp_root_path::target.
|
static |
|
static |
Install IB SRP boot firmware table(s)
install | Installation method |
rc | Return status code |
Definition at line 582 of file ib_srp.c.
References sbft_table::acpi, cpu_to_le16, cpu_to_le32, DBGC, desc, ib_device::gid, ipxe_ib_sbft::ib, sbft_table::ib_offset, ib_srp_device::ibdev, acpi_header::length, list_for_each_entry, memcpy(), offsetof, sbft_ib_subtable::pkey, ib_device::pkey, rc, acpi_header::revision, ib_srp_device::sbft, SBFT_SIG, sbft_table::scsi_offset, sbft_ib_subtable::sgid, acpi_header::signature, sbft_table::srp_offset, strerror(), ipxe_ib_sbft::table, and typeof().
struct acpi_model ib_sbft_model __acpi_model |
IB sBFT model.
aBFT model
|
static |
IB SRP CMRC interface operations.
|
static |
IB SRP CMRC interface descriptor.
Definition at line 117 of file ib_srp.c.
Referenced by ib_srp_open().
|
static |
IB SRP SRP interface operations.
|
static |
IB SRP SRP interface descriptor.
Definition at line 128 of file ib_srp.c.
Referenced by ib_srp_open().
|
static |
IB SRP root path components.
Definition at line 444 of file ib_srp.c.
Referenced by ib_srp_parse_root_path().
struct uri_opener ib_srp_uri_opener __uri_opener |
IB SRP URI opener.