iPXE
infiniband.h
Go to the documentation of this file.
00001 #ifndef _IPXE_INFINIBAND_H
00002 #define _IPXE_INFINIBAND_H
00003 
00004 /** @file
00005  *
00006  * Infiniband protocol
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <stdint.h>
00013 #include <ipxe/refcnt.h>
00014 #include <ipxe/device.h>
00015 #include <ipxe/tables.h>
00016 #include <ipxe/ib_packet.h>
00017 #include <ipxe/ib_mad.h>
00018 #include <ipxe/if_ether.h>
00019 
00020 /** Subnet management interface QPN */
00021 #define IB_QPN_SMI 0
00022 
00023 /** Subnet management interface queue key */
00024 #define IB_QKEY_SMI 0
00025 
00026 /** General service interface QPN */
00027 #define IB_QPN_GSI 1
00028 
00029 /** General service interface queue key */
00030 #define IB_QKEY_GSI 0x80010000UL
00031 
00032 /** Broadcast QPN */
00033 #define IB_QPN_BROADCAST 0xffffffUL
00034 
00035 /** QPN mask */
00036 #define IB_QPN_MASK 0xffffffUL
00037 
00038 /** Default Infiniband partition key */
00039 #define IB_PKEY_DEFAULT 0xffff
00040 
00041 /** Infiniband partition key full membership flag */
00042 #define IB_PKEY_FULL 0x8000
00043 
00044 /**
00045  * Maximum payload size
00046  *
00047  * This is currently hard-coded in various places (drivers, subnet
00048  * management agent, etc.) to 2048.
00049  */
00050 #define IB_MAX_PAYLOAD_SIZE 2048
00051 
00052 struct ib_device;
00053 struct ib_queue_pair;
00054 struct ib_address_vector;
00055 struct ib_completion_queue;
00056 struct ib_mad_interface;
00057 
00058 /** Infiniband transmission rates */
00059 enum ib_rate {
00060         IB_RATE_2_5 = 2,
00061         IB_RATE_10 = 3,
00062         IB_RATE_30 = 4,
00063         IB_RATE_5 = 5,
00064         IB_RATE_20 = 6,
00065         IB_RATE_40 = 7,
00066         IB_RATE_60 = 8,
00067         IB_RATE_80 = 9,
00068         IB_RATE_120 = 10,
00069 };
00070 
00071 /** An Infiniband Address Vector */
00072 struct ib_address_vector {
00073         /** Queue Pair Number */
00074         unsigned long qpn;
00075         /** Queue key
00076          *
00077          * Not specified for received packets.
00078          */
00079         unsigned long qkey;
00080         /** Local ID */
00081         unsigned int lid;
00082         /** Rate
00083          *
00084          * Not specified for received packets.
00085          */
00086         enum ib_rate rate;
00087         /** Service level */
00088         unsigned int sl;
00089         /** GID is present */
00090         unsigned int gid_present;
00091         /** GID, if present */
00092         union ib_gid gid;
00093         /** VLAN is present */
00094         unsigned int vlan_present;
00095         /** VLAN, if present */
00096         unsigned int vlan;
00097 };
00098 
00099 /** An Infiniband Work Queue */
00100 struct ib_work_queue {
00101         /** Containing queue pair */
00102         struct ib_queue_pair *qp;
00103         /** "Is a send queue" flag */
00104         int is_send;
00105         /** Associated completion queue */
00106         struct ib_completion_queue *cq;
00107         /** List of work queues on this completion queue */
00108         struct list_head list;
00109         /** Packet sequence number */
00110         uint32_t psn;
00111         /** Number of work queue entries */
00112         unsigned int num_wqes;
00113         /** Number of occupied work queue entries */
00114         unsigned int fill;
00115         /** Next work queue entry index
00116          *
00117          * This is the index of the next entry to be filled (i.e. the
00118          * first empty entry).  This value is not bounded by num_wqes;
00119          * users must logical-AND with (num_wqes-1) to generate an
00120          * array index.
00121          */
00122         unsigned long next_idx;
00123         /** I/O buffers assigned to work queue */
00124         struct io_buffer **iobufs;
00125         /** Driver private data */
00126         void *drv_priv;
00127 };
00128 
00129 /** An Infiniband multicast GID */
00130 struct ib_multicast_gid {
00131         /** List of multicast GIDs on this QP */
00132         struct list_head list;
00133         /** Multicast GID */
00134         union ib_gid gid;
00135 };
00136 
00137 /** An Infiniband queue pair type */
00138 enum ib_queue_pair_type {
00139         IB_QPT_SMI,
00140         IB_QPT_GSI,
00141         IB_QPT_UD,
00142         IB_QPT_RC,
00143         IB_QPT_ETH,
00144 };
00145 
00146 /** Infiniband queue pair operations */
00147 struct ib_queue_pair_operations {
00148         /** Allocate receive I/O buffer
00149          *
00150          * @v len               Maximum receive length
00151          * @ret iobuf           I/O buffer (or NULL if out of memory)
00152          */
00153         struct io_buffer * ( * alloc_iob ) ( size_t len );
00154 };
00155 
00156 /** An Infiniband Queue Pair */
00157 struct ib_queue_pair {
00158         /** Containing Infiniband device */
00159         struct ib_device *ibdev;
00160         /** List of queue pairs on this Infiniband device */
00161         struct list_head list;
00162         /** Queue pair name */
00163         const char *name;
00164         /** Queue pair number */
00165         unsigned long qpn;
00166         /** Externally-visible queue pair number
00167          *
00168          * This may differ from the real queue pair number (e.g. when
00169          * the HCA cannot use the management QPNs 0 and 1 as hardware
00170          * QPNs and needs to remap them).
00171          */
00172         unsigned long ext_qpn;
00173         /** Queue pair type */
00174         enum ib_queue_pair_type type;
00175         /** Queue key */
00176         unsigned long qkey;
00177         /** Send queue */
00178         struct ib_work_queue send;
00179         /** Receive queue */
00180         struct ib_work_queue recv;
00181         /** List of multicast GIDs */
00182         struct list_head mgids;
00183         /** Address vector */
00184         struct ib_address_vector av;
00185         /** Queue pair operations */
00186         struct ib_queue_pair_operations *op;
00187         /** Driver private data */
00188         void *drv_priv;
00189         /** Queue owner private data */
00190         void *owner_priv;
00191 };
00192 
00193 /** Infiniband completion queue operations */
00194 struct ib_completion_queue_operations {
00195         /**
00196          * Complete Send WQE
00197          *
00198          * @v ibdev             Infiniband device
00199          * @v qp                Queue pair
00200          * @v iobuf             I/O buffer
00201          * @v rc                Completion status code
00202          */
00203         void ( * complete_send ) ( struct ib_device *ibdev,
00204                                    struct ib_queue_pair *qp,
00205                                    struct io_buffer *iobuf, int rc );
00206         /**
00207          * Complete Receive WQE
00208          *
00209          * @v ibdev             Infiniband device
00210          * @v qp                Queue pair
00211          * @v dest              Destination address vector, or NULL
00212          * @v source            Source address vector, or NULL
00213          * @v iobuf             I/O buffer
00214          * @v rc                Completion status code
00215          */
00216         void ( * complete_recv ) ( struct ib_device *ibdev,
00217                                    struct ib_queue_pair *qp,
00218                                    struct ib_address_vector *dest,
00219                                    struct ib_address_vector *source,
00220                                    struct io_buffer *iobuf, int rc );
00221 };
00222 
00223 /** An Infiniband Completion Queue */
00224 struct ib_completion_queue {
00225         /** Containing Infiniband device */
00226         struct ib_device *ibdev;
00227         /** List of completion queues on this Infiniband device */
00228         struct list_head list;
00229         /** Completion queue number */
00230         unsigned long cqn;
00231         /** Number of completion queue entries */
00232         unsigned int num_cqes;
00233         /** Next completion queue entry index
00234          *
00235          * This is the index of the next entry to be filled (i.e. the
00236          * first empty entry).  This value is not bounded by num_wqes;
00237          * users must logical-AND with (num_wqes-1) to generate an
00238          * array index.
00239          */
00240         unsigned long next_idx;
00241         /** List of work queues completing to this queue */
00242         struct list_head work_queues;
00243         /** Completion queue operations */
00244         struct ib_completion_queue_operations *op;
00245         /** Driver private data */
00246         void *drv_priv;
00247 };
00248 
00249 /**
00250  * Infiniband device operations
00251  *
00252  * These represent a subset of the Infiniband Verbs.
00253  */
00254 struct ib_device_operations {
00255         /** Create completion queue
00256          *
00257          * @v ibdev             Infiniband device
00258          * @v cq                Completion queue
00259          * @ret rc              Return status code
00260          */
00261         int ( * create_cq ) ( struct ib_device *ibdev,
00262                               struct ib_completion_queue *cq );
00263         /** Destroy completion queue
00264          *
00265          * @v ibdev             Infiniband device
00266          * @v cq                Completion queue
00267          */
00268         void ( * destroy_cq ) ( struct ib_device *ibdev,
00269                                 struct ib_completion_queue *cq );
00270         /** Create queue pair
00271          *
00272          * @v ibdev             Infiniband device
00273          * @v qp                Queue pair
00274          * @ret rc              Return status code
00275          */
00276         int ( * create_qp ) ( struct ib_device *ibdev,
00277                               struct ib_queue_pair *qp );
00278         /** Modify queue pair
00279          *
00280          * @v ibdev             Infiniband device
00281          * @v qp                Queue pair
00282          * @ret rc              Return status code
00283          */
00284         int ( * modify_qp ) ( struct ib_device *ibdev,
00285                               struct ib_queue_pair *qp );
00286         /** Destroy queue pair
00287          *
00288          * @v ibdev             Infiniband device
00289          * @v qp                Queue pair
00290          */
00291         void ( * destroy_qp ) ( struct ib_device *ibdev,
00292                                 struct ib_queue_pair *qp );
00293         /** Post send work queue entry
00294          *
00295          * @v ibdev             Infiniband device
00296          * @v qp                Queue pair
00297          * @v dest              Destination address vector
00298          * @v iobuf             I/O buffer
00299          * @ret rc              Return status code
00300          *
00301          * If this method returns success, the I/O buffer remains
00302          * owned by the queue pair.  If this method returns failure,
00303          * the I/O buffer is immediately released; the failure is
00304          * interpreted as "failure to enqueue buffer".
00305          */
00306         int ( * post_send ) ( struct ib_device *ibdev,
00307                               struct ib_queue_pair *qp,
00308                               struct ib_address_vector *dest,
00309                               struct io_buffer *iobuf );
00310         /** Post receive work queue entry
00311          *
00312          * @v ibdev             Infiniband device
00313          * @v qp                Queue pair
00314          * @v iobuf             I/O buffer
00315          * @ret rc              Return status code
00316          *
00317          * If this method returns success, the I/O buffer remains
00318          * owned by the queue pair.  If this method returns failure,
00319          * the I/O buffer is immediately released; the failure is
00320          * interpreted as "failure to enqueue buffer".
00321          */
00322         int ( * post_recv ) ( struct ib_device *ibdev,
00323                               struct ib_queue_pair *qp,
00324                               struct io_buffer *iobuf );
00325         /** Poll completion queue
00326          *
00327          * @v ibdev             Infiniband device
00328          * @v cq                Completion queue
00329          *
00330          * The relevant completion handler (specified at completion
00331          * queue creation time) takes ownership of the I/O buffer.
00332          */
00333         void ( * poll_cq ) ( struct ib_device *ibdev,
00334                              struct ib_completion_queue *cq );
00335         /**
00336          * Poll event queue
00337          *
00338          * @v ibdev             Infiniband device
00339          */
00340         void ( * poll_eq ) ( struct ib_device *ibdev );
00341         /**
00342          * Open port
00343          *
00344          * @v ibdev             Infiniband device
00345          * @ret rc              Return status code
00346          */
00347         int ( * open ) ( struct ib_device *ibdev );
00348         /**
00349          * Close port
00350          *
00351          * @v ibdev             Infiniband device
00352          */
00353         void ( * close ) ( struct ib_device *ibdev );
00354         /** Attach to multicast group
00355          *
00356          * @v ibdev             Infiniband device
00357          * @v qp                Queue pair
00358          * @v gid               Multicast GID
00359          * @ret rc              Return status code
00360          */
00361         int ( * mcast_attach ) ( struct ib_device *ibdev,
00362                                  struct ib_queue_pair *qp,
00363                                  union ib_gid *gid );
00364         /** Detach from multicast group
00365          *
00366          * @v ibdev             Infiniband device
00367          * @v qp                Queue pair
00368          * @v gid               Multicast GID
00369          */
00370         void ( * mcast_detach ) ( struct ib_device *ibdev,
00371                                   struct ib_queue_pair *qp,
00372                                   union ib_gid *gid );
00373         /** Set port information
00374          *
00375          * @v ibdev             Infiniband device
00376          * @v mad               Set port information MAD
00377          *
00378          * This method is required only by adapters that do not have
00379          * an embedded SMA.
00380          */
00381         int ( * set_port_info ) ( struct ib_device *ibdev, union ib_mad *mad );
00382         /** Set partition key table
00383          *
00384          * @v ibdev             Infiniband device
00385          * @v mad               Set partition key table MAD
00386          *
00387          * This method is required only by adapters that do not have
00388          * an embedded SMA.
00389          */
00390         int ( * set_pkey_table ) ( struct ib_device *ibdev,
00391                                    union ib_mad *mad );
00392 };
00393 
00394 /** Maximum length of an Infiniband device name */
00395 #define IBDEV_NAME_LEN 8
00396 
00397 /** An Infiniband device */
00398 struct ib_device {
00399         /** Reference counter */
00400         struct refcnt refcnt;
00401         /** List of Infiniband devices */
00402         struct list_head list;
00403         /** List of open Infiniband devices */
00404         struct list_head open_list;
00405         /** Index of this Infiniband device */
00406         unsigned int index;
00407         /** Name of this Infiniband device */
00408         char name[IBDEV_NAME_LEN];
00409         /** Underlying device */
00410         struct device *dev;
00411         /** List of completion queues */
00412         struct list_head cqs;
00413         /** List of queue pairs */
00414         struct list_head qps;
00415         /** Infiniband operations */
00416         struct ib_device_operations *op;
00417         /** Port number */
00418         unsigned int port;
00419         /** Port open request counter */
00420         unsigned int open_count;
00421 
00422         /** Port state */
00423         uint8_t port_state;
00424         /** Link width supported */
00425         uint8_t link_width_supported;
00426         /** Link width enabled */
00427         uint8_t link_width_enabled;
00428         /** Link width active */
00429         uint8_t link_width_active;
00430         /** Link speed supported */
00431         uint8_t link_speed_supported;
00432         /** Link speed enabled */
00433         uint8_t link_speed_enabled;
00434         /** Link speed active */
00435         uint8_t link_speed_active;
00436         /** Node GUID */
00437         union ib_guid node_guid;
00438         /** Port GID (comprising GID prefix and port GUID) */
00439         union ib_gid gid;
00440         /** Port LID */
00441         uint16_t lid;
00442         /** Subnet manager LID */
00443         uint16_t sm_lid;
00444         /** Subnet manager SL */
00445         uint8_t sm_sl;
00446         /** Partition key */
00447         uint16_t pkey;
00448 
00449         /** RDMA key
00450          *
00451          * This is a single key allowing unrestricted access to
00452          * memory.
00453          */
00454         uint32_t rdma_key;
00455 
00456         /** Subnet management interface */
00457         struct ib_mad_interface *smi;
00458         /** General services interface */
00459         struct ib_mad_interface *gsi;
00460 
00461         /** IPoIB LEMAC (if non-default) */
00462         uint8_t lemac[ETH_ALEN];
00463 
00464         /** Driver private data */
00465         void *drv_priv;
00466 };
00467 
00468 /** An Infiniband upper-layer driver */
00469 struct ib_driver {
00470         /** Name */
00471         const char *name;
00472         /** Probe device
00473          *
00474          * @v ibdev             Infiniband device
00475          * @ret rc              Return status code
00476          */
00477         int ( * probe ) ( struct ib_device *ibdev );
00478         /** Notify of device or link state change
00479          *
00480          * @v ibdev             Infiniband device
00481          */
00482         void ( * notify ) ( struct ib_device *ibdev );
00483         /** Remove device
00484          *
00485          * @v ibdev             Infiniband device
00486          */
00487         void ( * remove ) ( struct ib_device *ibdev );
00488 };
00489 
00490 /** Infiniband driver table */
00491 #define IB_DRIVERS __table ( struct ib_driver, "ib_drivers" )
00492 
00493 /** Declare an Infiniband driver */
00494 #define __ib_driver __table_entry ( IB_DRIVERS, 01 )
00495 
00496 extern int ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
00497                           struct ib_completion_queue_operations *op,
00498                           struct ib_completion_queue **new_cq );
00499 extern void ib_destroy_cq ( struct ib_device *ibdev,
00500                             struct ib_completion_queue *cq );
00501 extern void ib_poll_cq ( struct ib_device *ibdev,
00502                          struct ib_completion_queue *cq );
00503 extern int ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type,
00504                           unsigned int num_send_wqes,
00505                           struct ib_completion_queue *send_cq,
00506                           unsigned int num_recv_wqes,
00507                           struct ib_completion_queue *recv_cq,
00508                           struct ib_queue_pair_operations *op,
00509                           const char *name, struct ib_queue_pair **new_qp );
00510 extern int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp );
00511 extern void ib_destroy_qp ( struct ib_device *ibdev,
00512                             struct ib_queue_pair *qp );
00513 extern struct ib_queue_pair * ib_find_qp_qpn ( struct ib_device *ibdev,
00514                                                unsigned long qpn );
00515 extern struct ib_queue_pair * ib_find_qp_mgid ( struct ib_device *ibdev,
00516                                                 union ib_gid *gid );
00517 extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
00518                                            unsigned long qpn, int is_send );
00519 extern int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
00520                           struct ib_address_vector *dest,
00521                           struct io_buffer *iobuf );
00522 extern int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
00523                           struct io_buffer *iobuf );
00524 extern void ib_complete_send ( struct ib_device *ibdev,
00525                                struct ib_queue_pair *qp,
00526                                struct io_buffer *iobuf, int rc );
00527 extern void ib_complete_recv ( struct ib_device *ibdev,
00528                                struct ib_queue_pair *qp,
00529                                struct ib_address_vector *dest,
00530                                struct ib_address_vector *source,
00531                                struct io_buffer *iobuf, int rc );
00532 extern void ib_refill_recv ( struct ib_device *ibdev,
00533                              struct ib_queue_pair *qp );
00534 extern int ib_open ( struct ib_device *ibdev );
00535 extern void ib_close ( struct ib_device *ibdev );
00536 extern int ib_link_rc ( struct ib_device *ibdev );
00537 extern int ib_mcast_attach ( struct ib_device *ibdev, struct ib_queue_pair *qp,
00538                              union ib_gid *gid );
00539 extern void ib_mcast_detach ( struct ib_device *ibdev,
00540                               struct ib_queue_pair *qp, union ib_gid *gid );
00541 extern int ib_count_ports ( struct ib_device *ibdev );
00542 extern int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad );
00543 extern int ib_set_pkey_table ( struct ib_device *ibdev, union ib_mad *mad );
00544 extern struct ib_device * alloc_ibdev ( size_t priv_size );
00545 extern int register_ibdev ( struct ib_device *ibdev );
00546 extern void unregister_ibdev ( struct ib_device *ibdev );
00547 extern struct ib_device * find_ibdev ( union ib_gid *gid );
00548 extern struct ib_device * last_opened_ibdev ( void );
00549 extern void ib_link_state_changed ( struct ib_device *ibdev );
00550 extern void ib_poll_eq ( struct ib_device *ibdev );
00551 extern struct list_head ib_devices;
00552 
00553 /** Iterate over all network devices */
00554 #define for_each_ibdev( ibdev ) \
00555         list_for_each_entry ( (ibdev), &ib_devices, list )
00556 
00557 /**
00558  * Check link state of Infiniband device
00559  *
00560  * @v ibdev             Infiniband device
00561  * @ret link_up         Link is up
00562  */
00563 static inline __always_inline int
00564 ib_link_ok ( struct ib_device *ibdev ) {
00565         return ( ibdev->port_state == IB_PORT_STATE_ACTIVE );
00566 }
00567 
00568 /**
00569  * Check whether or not Infiniband device is open
00570  *
00571  * @v ibdev             Infiniband device
00572  * @v is_open           Infiniband device is open
00573  */
00574 static inline __attribute__ (( always_inline )) int
00575 ib_is_open ( struct ib_device *ibdev ) {
00576         return ( ibdev->open_count > 0 );
00577 }
00578 
00579 /**
00580  * Get reference to Infiniband device
00581  *
00582  * @v ibdev             Infiniband device
00583  * @ret ibdev           Infiniband device
00584  */
00585 static inline __always_inline struct ib_device *
00586 ibdev_get ( struct ib_device *ibdev ) {
00587         ref_get ( &ibdev->refcnt );
00588         return ibdev;
00589 }
00590 
00591 /**
00592  * Drop reference to Infiniband device
00593  *
00594  * @v ibdev             Infiniband device
00595  */
00596 static inline __always_inline void
00597 ibdev_put ( struct ib_device *ibdev ) {
00598         ref_put ( &ibdev->refcnt );
00599 }
00600 
00601 /**
00602  * Set Infiniband work queue driver-private data
00603  *
00604  * @v wq                Work queue
00605  * @v priv              Private data
00606  */
00607 static inline __always_inline void
00608 ib_wq_set_drvdata ( struct ib_work_queue *wq, void *priv ) {
00609         wq->drv_priv = priv;
00610 }
00611 
00612 /**
00613  * Get Infiniband work queue driver-private data
00614  *
00615  * @v wq                Work queue
00616  * @ret priv            Private data
00617  */
00618 static inline __always_inline void *
00619 ib_wq_get_drvdata ( struct ib_work_queue *wq ) {
00620         return wq->drv_priv;
00621 }
00622 
00623 /**
00624  * Set Infiniband queue pair driver-private data
00625  *
00626  * @v qp                Queue pair
00627  * @v priv              Private data
00628  */
00629 static inline __always_inline void
00630 ib_qp_set_drvdata ( struct ib_queue_pair *qp, void *priv ) {
00631         qp->drv_priv = priv;
00632 }
00633 
00634 /**
00635  * Get Infiniband queue pair driver-private data
00636  *
00637  * @v qp                Queue pair
00638  * @ret priv            Private data
00639  */
00640 static inline __always_inline void *
00641 ib_qp_get_drvdata ( struct ib_queue_pair *qp ) {
00642         return qp->drv_priv;
00643 }
00644 
00645 /**
00646  * Set Infiniband queue pair owner-private data
00647  *
00648  * @v qp                Queue pair
00649  * @v priv              Private data
00650  */
00651 static inline __always_inline void
00652 ib_qp_set_ownerdata ( struct ib_queue_pair *qp, void *priv ) {
00653         qp->owner_priv = priv;
00654 }
00655 
00656 /**
00657  * Get Infiniband queue pair owner-private data
00658  *
00659  * @v qp                Queue pair
00660  * @ret priv            Private data
00661  */
00662 static inline __always_inline void *
00663 ib_qp_get_ownerdata ( struct ib_queue_pair *qp ) {
00664         return qp->owner_priv;
00665 }
00666 
00667 /**
00668  * Set Infiniband completion queue driver-private data
00669  *
00670  * @v cq                Completion queue
00671  * @v priv              Private data
00672  */
00673 static inline __always_inline void
00674 ib_cq_set_drvdata ( struct ib_completion_queue *cq, void *priv ) {
00675         cq->drv_priv = priv;
00676 }
00677 
00678 /**
00679  * Get Infiniband completion queue driver-private data
00680  *
00681  * @v cq                Completion queue
00682  * @ret priv            Private data
00683  */
00684 static inline __always_inline void *
00685 ib_cq_get_drvdata ( struct ib_completion_queue *cq ) {
00686         return cq->drv_priv;
00687 }
00688 
00689 /**
00690  * Set Infiniband device driver-private data
00691  *
00692  * @v ibdev             Infiniband device
00693  * @v priv              Private data
00694  */
00695 static inline __always_inline void
00696 ib_set_drvdata ( struct ib_device *ibdev, void *priv ) {
00697         ibdev->drv_priv = priv;
00698 }
00699 
00700 /**
00701  * Get Infiniband device driver-private data
00702  *
00703  * @v ibdev             Infiniband device
00704  * @ret priv            Private data
00705  */
00706 static inline __always_inline void *
00707 ib_get_drvdata ( struct ib_device *ibdev ) {
00708         return ibdev->drv_priv;
00709 }
00710 
00711 #endif /* _IPXE_INFINIBAND_H */