1 #ifndef _IPXE_INFINIBAND_H 2 #define _IPXE_INFINIBAND_H 30 #define IB_QKEY_GSI 0x80010000UL 33 #define IB_QPN_BROADCAST 0xffffffUL 36 #define IB_QPN_MASK 0xffffffUL 39 #define IB_PKEY_DEFAULT 0xffff 42 #define IB_PKEY_FULL 0x8000 50 #define IB_MAX_PAYLOAD_SIZE 2048 395 #define IBDEV_NAME_LEN 8 493 #define IB_DRIVERS __table ( struct ib_driver, "ib_drivers" ) 496 #define __ib_driver __table_entry ( IB_DRIVERS, 01 ) 506 unsigned int num_send_wqes,
508 unsigned int num_recv_wqes,
555 #define for_each_ibdev( ibdev ) \ 556 list_for_each_entry ( (ibdev), &ib_devices, list ) 665 return qp->owner_priv;
struct ib_mad_interface * smi
Subnet management interface.
static __always_inline void ib_set_drvdata(struct ib_device *ibdev, void *priv)
Set Infiniband device driver-private data.
void ib_close(struct ib_device *ibdev)
Close port.
int(* set_port_info)(struct ib_device *ibdev, union ib_mad *mad)
Set port information.
struct arbelprm_rc_send_wqe rc
int(* set_pkey_table)(struct ib_device *ibdev, union ib_mad *mad)
Set partition key table.
void(* complete_recv)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct ib_address_vector *source, struct io_buffer *iobuf, int rc)
Complete Receive WQE.
static __always_inline int ib_link_ok(struct ib_device *ibdev)
Check link state of Infiniband device.
void ib_refill_recv(struct ib_device *ibdev, struct ib_queue_pair *qp)
Refill receive work queue.
int(* probe)(struct ib_device *ibdev)
Probe device.
char name[IBDEV_NAME_LEN]
Name of this Infiniband device.
union ib_gid gid
Port GID (comprising GID prefix and port GUID)
static int ib_is_open(struct ib_device *ibdev)
Check whether or not Infiniband device is open.
Infiniband device operations.
struct list_head mgids
List of multicast GIDs.
void(* poll_eq)(struct ib_device *ibdev)
Poll event queue.
int(* open)(struct ib_device *ibdev)
Open port.
unsigned int open_count
Port open request counter.
int ib_create_cq(struct ib_device *ibdev, unsigned int num_cqes, struct ib_completion_queue_operations *op, struct ib_completion_queue **new_cq)
Create completion queue.
int(* post_recv)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf)
Post receive work queue entry.
void(* mcast_detach)(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Detach from multicast group.
uint32_t type
Operating system type.
void ib_poll_eq(struct ib_device *ibdev)
Poll event queue.
void ib_mcast_detach(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Detach from multicast group.
void ib_link_state_changed(struct ib_device *ibdev)
Notify of Infiniband link state change.
struct device * dev
Underlying device.
void(* notify)(struct ib_device *ibdev)
Notify of device or link state change.
static __always_inline void * ib_qp_get_drvdata(struct ib_queue_pair *qp)
Get Infiniband queue pair driver-private data.
void * owner_priv
Queue owner private data.
struct ib_mad_interface * gsi
General services interface.
void * drv_priv
Driver private data.
An Infiniband upper-layer driver.
int ib_set_pkey_table(struct ib_device *ibdev, union ib_mad *mad)
Set partition key table.
void ib_complete_recv(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct ib_address_vector *source, struct io_buffer *iobuf, int rc)
Complete receive work queue entry.
uint32_t psn
Packet sequence number.
An Infiniband management interface.
unsigned int gid_present
GID is present.
struct ib_work_queue recv
Receive queue.
int ib_set_port_info(struct ib_device *ibdev, union ib_mad *mad)
Set port information.
unsigned int vlan
VLAN, if present.
uint8_t link_speed_enabled
Link speed enabled.
static __always_inline struct ib_device * ibdev_get(struct ib_device *ibdev)
Get reference to Infiniband device.
An Infiniband Global Identifier.
#define IBDEV_NAME_LEN
Maximum length of an Infiniband device name.
struct list_head list
List of multicast GIDs on this QP.
unsigned long qkey
Queue key.
uint8_t link_width_enabled
Link width enabled.
uint8_t link_width_supported
Link width supported.
A doubly-linked list entry (or list head)
unsigned int index
Index of this Infiniband device.
int(* mcast_attach)(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Attach to multicast group.
struct ib_completion_queue * cq
Associated completion queue.
struct ib_work_queue * ib_find_wq(struct ib_completion_queue *cq, unsigned long qpn, int is_send)
Find work queue belonging to completion queue.
Infiniband completion queue operations.
enum ib_queue_pair_type type
Queue pair type.
Infiniband queue pair operations.
static __always_inline void * ib_get_drvdata(struct ib_device *ibdev)
Get Infiniband device driver-private data.
unsigned long qkey
Queue key.
struct ib_device_operations * op
Infiniband operations.
struct list_head ib_devices
List of Infiniband devices.
An Infiniband Work Queue.
struct ib_queue_pair_operations * op
Queue pair operations.
const char * name
Queue pair name.
unsigned long ext_qpn
Externally-visible queue pair number.
int ib_post_recv(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf)
Post receive work queue entry.
unsigned long qpn
Queue pair number.
int(* modify_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
uint16_t sm_lid
Subnet manager LID.
struct refcnt refcnt
Reference counter.
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
void * drv_priv
Driver private data.
struct list_head list
List of queue pairs on this Infiniband device.
unsigned int num_wqes
Number of work queue entries.
uint8_t sm_sl
Subnet manager SL.
struct list_head work_queues
List of work queues completing to this queue.
uint32_t rdma_key
RDMA key.
struct list_head list
List of Infiniband devices.
struct ib_completion_queue_operations * op
Completion queue operations.
unsigned int port
Port number.
static __always_inline void ibdev_put(struct ib_device *ibdev)
Drop reference to Infiniband device.
static __always_inline void ib_cq_set_drvdata(struct ib_completion_queue *cq, void *priv)
Set Infiniband completion queue driver-private data.
ib_queue_pair_type
An Infiniband queue pair type.
static __always_inline void * ib_qp_get_ownerdata(struct ib_queue_pair *qp)
Get Infiniband queue pair owner-private data.
#define ref_get(refcnt)
Get additional reference to object.
static __always_inline void * ib_wq_get_drvdata(struct ib_work_queue *wq)
Get Infiniband work queue driver-private data.
#define __always_inline
Declare a function to be always inline.
An Infiniband Globally Unique Identifier.
union ib_guid node_guid
Node GUID.
unsigned int fill
Number of occupied work queue entries.
An Infiniband Completion Queue.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint8_t link_width_active
Link width active.
unsigned long qpn
Queue Pair Number.
struct ib_address_vector av
Address vector.
struct ib_queue_pair * qp
Containing queue pair.
unsigned int ports
Total ports on device.
int(* create_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Create queue pair.
struct ib_device * ibdev
Containing Infiniband device.
unsigned long next_idx
Next work queue entry index.
void(* destroy_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
unsigned long next_idx
Next completion queue entry index.
struct list_head list
List of work queues on this completion queue.
An Infiniband Queue Pair.
struct list_head cqs
List of completion queues.
ib_rate
Infiniband transmission rates.
unsigned int sl
Service level.
struct ib_queue_pair * ib_find_qp_mgid(struct ib_device *ibdev, union ib_gid *gid)
Find queue pair by multicast GID.
struct arbelprm_qp_db_record qp
struct ib_device * alloc_ibdev(size_t priv_size)
Allocate Infiniband device.
static uint16_t struct vmbus_xfer_pages_operations * op
union ib_gid gid
Multicast GID.
void * drv_priv
Driver private data.
void(* destroy_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
struct list_head list
List of completion queues on this Infiniband device.
static struct tlan_private * priv
uint8_t link_speed_active
Link speed active.
int ib_modify_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
#define IB_PORT_STATE_ACTIVE
Infiniband packet format.
void(* remove)(struct ib_device *ibdev)
Remove device.
union ib_gid gid
GID, if present.
int ib_open(struct ib_device *ibdev)
Open port.
int ib_link_rc(struct ib_device *ibdev)
Get link state.
uint8_t port_state
Port state.
void(* close)(struct ib_device *ibdev)
Close port.
void(* complete_send)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc)
Complete Send WQE.
int ib_create_qp(struct ib_device *ibdev, enum ib_queue_pair_type type, unsigned int num_send_wqes, struct ib_completion_queue *send_cq, unsigned int num_recv_wqes, struct ib_completion_queue *recv_cq, struct ib_queue_pair_operations *op, const char *name, struct ib_queue_pair **new_qp)
Create queue pair.
unsigned long cqn
Completion queue number.
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
unsigned int num_cqes
Number of completion queue entries.
int(* post_send)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct io_buffer *iobuf)
Post send work queue entry.
uint8_t link_speed_supported
Link speed supported.
struct list_head qps
List of queue pairs.
void ib_poll_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Poll completion queue.
Infiniband management datagrams.
struct list_head open_list
List of open Infiniband devices.
uint16_t pkey
Partition key.
An Infiniband Address Vector.
void ib_complete_send(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc)
Complete send work queue entry.
An Infiniband multicast GID.
int register_ibdev(struct ib_device *ibdev)
Register Infiniband device.
void unregister_ibdev(struct ib_device *ibdev)
Unregister Infiniband device.
unsigned int lid
Local ID.
void * drv_priv
Driver private data.
unsigned int vlan_present
VLAN is present.
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
int is_send
"Is a send queue" flag
uint8_t lemac[ETH_ALEN]
IPoIB LEMAC (if non-default)
static __always_inline void * ib_cq_get_drvdata(struct ib_completion_queue *cq)
Get Infiniband completion queue driver-private data.
struct ib_device * ibdev
Containing Infiniband device.
int ib_post_send(struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct io_buffer *iobuf)
Post send work queue entry.
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
void(* poll_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Poll completion queue.
static __always_inline void ib_wq_set_drvdata(struct ib_work_queue *wq, void *priv)
Set Infiniband work queue driver-private data.
struct ib_device * last_opened_ibdev(void)
Get most recently opened Infiniband device.
static __always_inline void ib_qp_set_drvdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair driver-private data.
struct ib_queue_pair * ib_find_qp_qpn(struct ib_device *ibdev, unsigned long qpn)
Find queue pair by QPN.
int(* create_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Create completion queue.
struct ib_device * find_ibdev(union ib_gid *gid)
Find Infiniband device by GID.
#define ref_put(refcnt)
Drop reference to object.
int ib_mcast_attach(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Attach to multicast group.
struct ib_work_queue send
Send queue.
struct io_buffer ** iobufs
I/O buffers assigned to work queue.