iPXE
infiniband.h
Go to the documentation of this file.
1#ifndef _IPXE_INFINIBAND_H
2#define _IPXE_INFINIBAND_H
3
4/** @file
5 *
6 * Infiniband protocol
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/refcnt.h>
15#include <ipxe/device.h>
16#include <ipxe/tables.h>
17#include <ipxe/ib_packet.h>
18#include <ipxe/ib_mad.h>
19#include <ipxe/if_ether.h>
20
21/** Subnet management interface QPN */
22#define IB_QPN_SMI 0
23
24/** Subnet management interface queue key */
25#define IB_QKEY_SMI 0
26
27/** General service interface QPN */
28#define IB_QPN_GSI 1
29
30/** General service interface queue key */
31#define IB_QKEY_GSI 0x80010000UL
32
33/** Broadcast QPN */
34#define IB_QPN_BROADCAST 0xffffffUL
35
36/** QPN mask */
37#define IB_QPN_MASK 0xffffffUL
38
39/** Default Infiniband partition key */
40#define IB_PKEY_DEFAULT 0xffff
41
42/** Infiniband partition key full membership flag */
43#define IB_PKEY_FULL 0x8000
44
45/**
46 * Maximum payload size
47 *
48 * This is currently hard-coded in various places (drivers, subnet
49 * management agent, etc.) to 2048.
50 */
51#define IB_MAX_PAYLOAD_SIZE 2048
52
53struct ib_device;
54struct ib_queue_pair;
57struct ib_mad_interface;
58
59/** Infiniband transmission rates */
71
72/** An Infiniband Address Vector */
74 /** Queue Pair Number */
75 unsigned long qpn;
76 /** Queue key
77 *
78 * Not specified for received packets.
79 */
80 unsigned long qkey;
81 /** Local ID */
82 unsigned int lid;
83 /** Rate
84 *
85 * Not specified for received packets.
86 */
88 /** Service level */
89 unsigned int sl;
90 /** GID is present */
91 unsigned int gid_present;
92 /** GID, if present */
93 union ib_gid gid;
94 /** VLAN is present */
95 unsigned int vlan_present;
96 /** VLAN, if present */
97 unsigned int vlan;
98};
99
100/** An Infiniband Work Queue */
102 /** Containing queue pair */
104 /** "Is a send queue" flag */
106 /** Associated completion queue */
108 /** List of work queues on this completion queue */
110 /** Packet sequence number */
112 /** Number of work queue entries */
113 unsigned int num_wqes;
114 /** Number of occupied work queue entries */
115 unsigned int fill;
116 /** Next work queue entry index
117 *
118 * This is the index of the next entry to be filled (i.e. the
119 * first empty entry). This value is not bounded by num_wqes;
120 * users must logical-AND with (num_wqes-1) to generate an
121 * array index.
122 */
123 unsigned long next_idx;
124 /** I/O buffers assigned to work queue */
126 /** Driver private data */
127 void *drv_priv;
128};
129
130/** An Infiniband multicast GID */
132 /** List of multicast GIDs on this QP */
134 /** Multicast GID */
135 union ib_gid gid;
136};
137
138/** An Infiniband queue pair type */
146
147/** Infiniband queue pair operations */
149 /** Allocate receive I/O buffer
150 *
151 * @v len Maximum receive length
152 * @ret iobuf I/O buffer (or NULL if out of memory)
153 */
154 struct io_buffer * ( * alloc_iob ) ( size_t len );
155};
156
157/** An Infiniband Queue Pair */
159 /** Containing Infiniband device */
161 /** List of queue pairs on this Infiniband device */
163 /** Queue pair name */
164 const char *name;
165 /** Queue pair number */
166 unsigned long qpn;
167 /** Externally-visible queue pair number
168 *
169 * This may differ from the real queue pair number (e.g. when
170 * the HCA cannot use the management QPNs 0 and 1 as hardware
171 * QPNs and needs to remap them).
172 */
173 unsigned long ext_qpn;
174 /** Queue pair type */
176 /** Queue key */
177 unsigned long qkey;
178 /** Send queue */
180 /** Receive queue */
182 /** List of multicast GIDs */
184 /** Address vector */
186 /** Queue pair operations */
188 /** Driver private data */
189 void *drv_priv;
190 /** Queue owner private data */
192};
193
194/** Infiniband completion queue operations */
196 /**
197 * Complete Send WQE
198 *
199 * @v ibdev Infiniband device
200 * @v qp Queue pair
201 * @v iobuf I/O buffer
202 * @v rc Completion status code
203 */
204 void ( * complete_send ) ( struct ib_device *ibdev,
205 struct ib_queue_pair *qp,
206 struct io_buffer *iobuf, int rc );
207 /**
208 * Complete Receive WQE
209 *
210 * @v ibdev Infiniband device
211 * @v qp Queue pair
212 * @v dest Destination address vector, or NULL
213 * @v source Source address vector, or NULL
214 * @v iobuf I/O buffer
215 * @v rc Completion status code
216 */
217 void ( * complete_recv ) ( struct ib_device *ibdev,
218 struct ib_queue_pair *qp,
219 struct ib_address_vector *dest,
220 struct ib_address_vector *source,
221 struct io_buffer *iobuf, int rc );
222};
223
224/** An Infiniband Completion Queue */
226 /** Containing Infiniband device */
228 /** List of completion queues on this Infiniband device */
230 /** Completion queue number */
231 unsigned long cqn;
232 /** Number of completion queue entries */
233 unsigned int num_cqes;
234 /** Next completion queue entry index
235 *
236 * This is the index of the next entry to be filled (i.e. the
237 * first empty entry). This value is not bounded by num_wqes;
238 * users must logical-AND with (num_wqes-1) to generate an
239 * array index.
240 */
241 unsigned long next_idx;
242 /** List of work queues completing to this queue */
244 /** Completion queue operations */
246 /** Driver private data */
247 void *drv_priv;
248};
249
250/**
251 * Infiniband device operations
252 *
253 * These represent a subset of the Infiniband Verbs.
254 */
256 /** Create completion queue
257 *
258 * @v ibdev Infiniband device
259 * @v cq Completion queue
260 * @ret rc Return status code
261 */
262 int ( * create_cq ) ( struct ib_device *ibdev,
263 struct ib_completion_queue *cq );
264 /** Destroy completion queue
265 *
266 * @v ibdev Infiniband device
267 * @v cq Completion queue
268 */
269 void ( * destroy_cq ) ( struct ib_device *ibdev,
270 struct ib_completion_queue *cq );
271 /** Create queue pair
272 *
273 * @v ibdev Infiniband device
274 * @v qp Queue pair
275 * @ret rc Return status code
276 */
277 int ( * create_qp ) ( struct ib_device *ibdev,
278 struct ib_queue_pair *qp );
279 /** Modify queue pair
280 *
281 * @v ibdev Infiniband device
282 * @v qp Queue pair
283 * @ret rc Return status code
284 */
285 int ( * modify_qp ) ( struct ib_device *ibdev,
286 struct ib_queue_pair *qp );
287 /** Destroy queue pair
288 *
289 * @v ibdev Infiniband device
290 * @v qp Queue pair
291 */
292 void ( * destroy_qp ) ( struct ib_device *ibdev,
293 struct ib_queue_pair *qp );
294 /** Post send work queue entry
295 *
296 * @v ibdev Infiniband device
297 * @v qp Queue pair
298 * @v dest Destination address vector
299 * @v iobuf I/O buffer
300 * @ret rc Return status code
301 *
302 * If this method returns success, the I/O buffer remains
303 * owned by the queue pair. If this method returns failure,
304 * the I/O buffer is immediately released; the failure is
305 * interpreted as "failure to enqueue buffer".
306 */
307 int ( * post_send ) ( struct ib_device *ibdev,
308 struct ib_queue_pair *qp,
309 struct ib_address_vector *dest,
310 struct io_buffer *iobuf );
311 /** Post receive work queue entry
312 *
313 * @v ibdev Infiniband device
314 * @v qp Queue pair
315 * @v iobuf I/O buffer
316 * @ret rc Return status code
317 *
318 * If this method returns success, the I/O buffer remains
319 * owned by the queue pair. If this method returns failure,
320 * the I/O buffer is immediately released; the failure is
321 * interpreted as "failure to enqueue buffer".
322 */
323 int ( * post_recv ) ( struct ib_device *ibdev,
324 struct ib_queue_pair *qp,
325 struct io_buffer *iobuf );
326 /** Poll completion queue
327 *
328 * @v ibdev Infiniband device
329 * @v cq Completion queue
330 *
331 * The relevant completion handler (specified at completion
332 * queue creation time) takes ownership of the I/O buffer.
333 */
334 void ( * poll_cq ) ( struct ib_device *ibdev,
335 struct ib_completion_queue *cq );
336 /**
337 * Poll event queue
338 *
339 * @v ibdev Infiniband device
340 */
341 void ( * poll_eq ) ( struct ib_device *ibdev );
342 /**
343 * Open port
344 *
345 * @v ibdev Infiniband device
346 * @ret rc Return status code
347 */
348 int ( * open ) ( struct ib_device *ibdev );
349 /**
350 * Close port
351 *
352 * @v ibdev Infiniband device
353 */
354 void ( * close ) ( struct ib_device *ibdev );
355 /** Attach to multicast group
356 *
357 * @v ibdev Infiniband device
358 * @v qp Queue pair
359 * @v gid Multicast GID
360 * @ret rc Return status code
361 */
362 int ( * mcast_attach ) ( struct ib_device *ibdev,
363 struct ib_queue_pair *qp,
364 union ib_gid *gid );
365 /** Detach from multicast group
366 *
367 * @v ibdev Infiniband device
368 * @v qp Queue pair
369 * @v gid Multicast GID
370 */
371 void ( * mcast_detach ) ( struct ib_device *ibdev,
372 struct ib_queue_pair *qp,
373 union ib_gid *gid );
374 /** Set port information
375 *
376 * @v ibdev Infiniband device
377 * @v mad Set port information MAD
378 *
379 * This method is required only by adapters that do not have
380 * an embedded SMA.
381 */
382 int ( * set_port_info ) ( struct ib_device *ibdev, union ib_mad *mad );
383 /** Set partition key table
384 *
385 * @v ibdev Infiniband device
386 * @v mad Set partition key table MAD
387 *
388 * This method is required only by adapters that do not have
389 * an embedded SMA.
390 */
391 int ( * set_pkey_table ) ( struct ib_device *ibdev,
392 union ib_mad *mad );
393};
394
395/** Maximum length of an Infiniband device name */
396#define IBDEV_NAME_LEN 8
397
398/** An Infiniband device */
399struct ib_device {
400 /** Reference counter */
402 /** List of Infiniband devices */
404 /** List of open Infiniband devices */
406 /** Index of this Infiniband device */
407 unsigned int index;
408 /** Name of this Infiniband device */
410 /** Underlying device */
411 struct device *dev;
412 /** List of completion queues */
414 /** List of queue pairs */
416 /** Infiniband operations */
418 /** Port number */
419 unsigned int port;
420 /** Total ports on device */
421 unsigned int ports;
422 /** Port open request counter */
423 unsigned int open_count;
424
425 /** Port state */
427 /** Link width supported */
429 /** Link width enabled */
431 /** Link width active */
433 /** Link speed supported */
435 /** Link speed enabled */
437 /** Link speed active */
439 /** Node GUID */
441 /** Port GID (comprising GID prefix and port GUID) */
442 union ib_gid gid;
443 /** Port LID */
445 /** Subnet manager LID */
447 /** Subnet manager SL */
449 /** Partition key */
451
452 /** RDMA key
453 *
454 * This is a single key allowing unrestricted access to
455 * memory.
456 */
458
459 /** Subnet management interface */
461 /** General services interface */
463
464 /** IPoIB LEMAC (if non-default) */
466
467 /** Driver private data */
468 void *drv_priv;
469};
470
471/** An Infiniband upper-layer driver */
472struct ib_driver {
473 /** Name */
474 const char *name;
475 /** Probe device
476 *
477 * @v ibdev Infiniband device
478 * @ret rc Return status code
479 */
480 int ( * probe ) ( struct ib_device *ibdev );
481 /** Notify of device or link state change
482 *
483 * @v ibdev Infiniband device
484 */
485 void ( * notify ) ( struct ib_device *ibdev );
486 /** Remove device
487 *
488 * @v ibdev Infiniband device
489 */
490 void ( * remove ) ( struct ib_device *ibdev );
491};
492
493/** Infiniband driver table */
494#define IB_DRIVERS __table ( struct ib_driver, "ib_drivers" )
495
496/** Declare an Infiniband driver */
497#define __ib_driver __table_entry ( IB_DRIVERS, 01 )
498
499extern int ib_create_cq ( struct ib_device *ibdev, unsigned int num_cqes,
501 struct ib_completion_queue **new_cq );
502extern void ib_destroy_cq ( struct ib_device *ibdev,
503 struct ib_completion_queue *cq );
504extern void ib_poll_cq ( struct ib_device *ibdev,
505 struct ib_completion_queue *cq );
506extern int ib_create_qp ( struct ib_device *ibdev, enum ib_queue_pair_type type,
507 unsigned int num_send_wqes,
508 struct ib_completion_queue *send_cq,
509 unsigned int num_recv_wqes,
510 struct ib_completion_queue *recv_cq,
512 const char *name, struct ib_queue_pair **new_qp );
513extern int ib_modify_qp ( struct ib_device *ibdev, struct ib_queue_pair *qp );
514extern void ib_destroy_qp ( struct ib_device *ibdev,
515 struct ib_queue_pair *qp );
516extern struct ib_queue_pair * ib_find_qp_qpn ( struct ib_device *ibdev,
517 unsigned long qpn );
518extern struct ib_queue_pair * ib_find_qp_mgid ( struct ib_device *ibdev,
519 union ib_gid *gid );
520extern struct ib_work_queue * ib_find_wq ( struct ib_completion_queue *cq,
521 unsigned long qpn, int is_send );
522extern int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp,
523 struct ib_address_vector *dest,
524 struct io_buffer *iobuf );
525extern int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
526 struct io_buffer *iobuf );
527extern void ib_complete_send ( struct ib_device *ibdev,
528 struct ib_queue_pair *qp,
529 struct io_buffer *iobuf, int rc );
530extern void ib_complete_recv ( struct ib_device *ibdev,
531 struct ib_queue_pair *qp,
532 struct ib_address_vector *dest,
533 struct ib_address_vector *source,
534 struct io_buffer *iobuf, int rc );
535extern void ib_refill_recv ( struct ib_device *ibdev,
536 struct ib_queue_pair *qp );
537extern int ib_open ( struct ib_device *ibdev );
538extern void ib_close ( struct ib_device *ibdev );
539extern int ib_link_rc ( struct ib_device *ibdev );
540extern int ib_mcast_attach ( struct ib_device *ibdev, struct ib_queue_pair *qp,
541 union ib_gid *gid );
542extern void ib_mcast_detach ( struct ib_device *ibdev,
543 struct ib_queue_pair *qp, union ib_gid *gid );
544extern int ib_set_port_info ( struct ib_device *ibdev, union ib_mad *mad );
545extern int ib_set_pkey_table ( struct ib_device *ibdev, union ib_mad *mad );
546extern struct ib_device * alloc_ibdev ( size_t priv_size );
547extern int register_ibdev ( struct ib_device *ibdev );
548extern void unregister_ibdev ( struct ib_device *ibdev );
549extern struct ib_device * find_ibdev ( union ib_gid *gid );
550extern struct ib_device * last_opened_ibdev ( void );
551extern void ib_link_state_changed ( struct ib_device *ibdev );
552extern void ib_poll_eq ( struct ib_device *ibdev );
553extern struct list_head ib_devices;
554
555/** Iterate over all network devices */
556#define for_each_ibdev( ibdev ) \
557 list_for_each_entry ( (ibdev), &ib_devices, list )
558
559/**
560 * Check link state of Infiniband device
561 *
562 * @v ibdev Infiniband device
563 * @ret link_up Link is up
564 */
565static inline __always_inline int
566ib_link_ok ( struct ib_device *ibdev ) {
567 return ( ibdev->port_state == IB_PORT_STATE_ACTIVE );
568}
569
570/**
571 * Check whether or not Infiniband device is open
572 *
573 * @v ibdev Infiniband device
574 * @v is_open Infiniband device is open
575 */
576static inline __attribute__ (( always_inline )) int
577ib_is_open ( struct ib_device *ibdev ) {
578 return ( ibdev->open_count > 0 );
579}
580
581/**
582 * Get reference to Infiniband device
583 *
584 * @v ibdev Infiniband device
585 * @ret ibdev Infiniband device
586 */
587static inline __always_inline struct ib_device *
588ibdev_get ( struct ib_device *ibdev ) {
589 ref_get ( &ibdev->refcnt );
590 return ibdev;
591}
592
593/**
594 * Drop reference to Infiniband device
595 *
596 * @v ibdev Infiniband device
597 */
598static inline __always_inline void
599ibdev_put ( struct ib_device *ibdev ) {
600 ref_put ( &ibdev->refcnt );
601}
602
603/**
604 * Set Infiniband work queue driver-private data
605 *
606 * @v wq Work queue
607 * @v priv Private data
608 */
609static inline __always_inline void
610ib_wq_set_drvdata ( struct ib_work_queue *wq, void *priv ) {
611 wq->drv_priv = priv;
612}
613
614/**
615 * Get Infiniband work queue driver-private data
616 *
617 * @v wq Work queue
618 * @ret priv Private data
619 */
620static inline __always_inline void *
622 return wq->drv_priv;
623}
624
625/**
626 * Set Infiniband queue pair driver-private data
627 *
628 * @v qp Queue pair
629 * @v priv Private data
630 */
631static inline __always_inline void
633 qp->drv_priv = priv;
634}
635
636/**
637 * Get Infiniband queue pair driver-private data
638 *
639 * @v qp Queue pair
640 * @ret priv Private data
641 */
642static inline __always_inline void *
644 return qp->drv_priv;
645}
646
647/**
648 * Set Infiniband queue pair owner-private data
649 *
650 * @v qp Queue pair
651 * @v priv Private data
652 */
653static inline __always_inline void
655 qp->owner_priv = priv;
656}
657
658/**
659 * Get Infiniband queue pair owner-private data
660 *
661 * @v qp Queue pair
662 * @ret priv Private data
663 */
664static inline __always_inline void *
666 return qp->owner_priv;
667}
668
669/**
670 * Set Infiniband completion queue driver-private data
671 *
672 * @v cq Completion queue
673 * @v priv Private data
674 */
675static inline __always_inline void
677 cq->drv_priv = priv;
678}
679
680/**
681 * Get Infiniband completion queue driver-private data
682 *
683 * @v cq Completion queue
684 * @ret priv Private data
685 */
686static inline __always_inline void *
688 return cq->drv_priv;
689}
690
691/**
692 * Set Infiniband device driver-private data
693 *
694 * @v ibdev Infiniband device
695 * @v priv Private data
696 */
697static inline __always_inline void
698ib_set_drvdata ( struct ib_device *ibdev, void *priv ) {
699 ibdev->drv_priv = priv;
700}
701
702/**
703 * Get Infiniband device driver-private data
704 *
705 * @v ibdev Infiniband device
706 * @ret priv Private data
707 */
708static inline __always_inline void *
709ib_get_drvdata ( struct ib_device *ibdev ) {
710 return ibdev->drv_priv;
711}
712
713#endif /* _IPXE_INFINIBAND_H */
u8 gid[16]
Definition CIB_PRM.h:3
__be32 qpn
Definition CIB_PRM.h:1
struct arbelprm_rc_send_wqe rc
Definition arbel.h:3
union ib_mad mad
Definition arbel.h:1
struct arbelprm_qp_db_record qp
Definition arbel.h:2
unsigned short uint16_t
Definition stdint.h:11
unsigned int uint32_t
Definition stdint.h:12
unsigned char uint8_t
Definition stdint.h:10
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" retur dest)
Definition string.h:151
const char * name
Definition ath9k_hw.c:1986
Device model.
ring len
Length.
Definition dwmac.h:226
uint32_t type
Operating system type.
Definition ena.h:1
#define __always_inline
Declare a function to be always inline.
Definition compiler.h:611
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
Infiniband management datagrams.
#define IB_PORT_STATE_ACTIVE
Definition ib_mad.h:155
Infiniband packet format.
#define ETH_ALEN
Definition if_ether.h:9
#define __attribute__(x)
Definition compiler.h:10
struct list_head ib_devices
List of Infiniband devices.
Definition infiniband.c:52
void ib_refill_recv(struct ib_device *ibdev, struct ib_queue_pair *qp)
Refill receive work queue.
Definition infiniband.c:556
static __always_inline int ib_link_ok(struct ib_device *ibdev)
Check link state of Infiniband device.
Definition infiniband.h:566
int ib_mcast_attach(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Attach to multicast group.
Definition infiniband.c:752
static __always_inline void * ib_get_drvdata(struct ib_device *ibdev)
Get Infiniband device driver-private data.
Definition infiniband.h:709
void ib_link_state_changed(struct ib_device *ibdev)
Notify of Infiniband link state change.
Definition infiniband.c:637
void ib_destroy_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
Definition infiniband.c:145
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.
Definition infiniband.c:98
static __always_inline void * ib_cq_get_drvdata(struct ib_completion_queue *cq)
Get Infiniband completion queue driver-private data.
Definition infiniband.h:687
int ib_set_port_info(struct ib_device *ibdev, union ib_mad *mad)
Set port information.
Definition infiniband.c:822
int ib_open(struct ib_device *ibdev)
Open port.
Definition infiniband.c:652
int ib_modify_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
Definition infiniband.c:294
static __always_inline void * ib_qp_get_ownerdata(struct ib_queue_pair *qp)
Get Infiniband queue pair owner-private data.
Definition infiniband.h:665
static __always_inline struct ib_device * ibdev_get(struct ib_device *ibdev)
Get reference to Infiniband device.
Definition infiniband.h:588
static __always_inline void ib_qp_set_ownerdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair owner-private data.
Definition infiniband.h:654
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.
Definition infiniband.c:536
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.
Definition infiniband.c:396
ib_queue_pair_type
An Infiniband queue pair type.
Definition infiniband.h:139
@ IB_QPT_ETH
Definition infiniband.h:144
@ IB_QPT_UD
Definition infiniband.h:142
@ IB_QPT_GSI
Definition infiniband.h:141
@ IB_QPT_RC
Definition infiniband.h:143
@ IB_QPT_SMI
Definition infiniband.h:140
int register_ibdev(struct ib_device *ibdev)
Register Infiniband device.
Definition infiniband.c:944
struct ib_queue_pair * ib_find_qp_mgid(struct ib_device *ibdev, union ib_gid *gid)
Find queue pair by multicast GID.
Definition infiniband.c:372
static __always_inline void * ib_qp_get_drvdata(struct ib_queue_pair *qp)
Get Infiniband queue pair driver-private data.
Definition infiniband.h:643
void unregister_ibdev(struct ib_device *ibdev)
Unregister Infiniband device.
Definition infiniband.c:985
int ib_post_recv(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf)
Post receive work queue entry.
Definition infiniband.c:470
int ib_link_rc(struct ib_device *ibdev)
Get link state.
Definition infiniband.c:594
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.
Definition infiniband.c:416
void ib_poll_eq(struct ib_device *ibdev)
Poll event queue.
Definition infiniband.c:878
static __always_inline void ib_cq_set_drvdata(struct ib_completion_queue *cq, void *priv)
Set Infiniband completion queue driver-private data.
Definition infiniband.h:676
void ib_mcast_detach(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Detach from multicast group.
Definition infiniband.c:789
static __always_inline void ib_qp_set_drvdata(struct ib_queue_pair *qp, void *priv)
Set Infiniband queue pair driver-private data.
Definition infiniband.h:632
void ib_close(struct ib_device *ibdev)
Close port.
Definition infiniband.c:716
void ib_poll_cq(struct ib_device *ibdev, struct ib_completion_queue *cq)
Poll completion queue.
Definition infiniband.c:161
void ib_destroy_qp(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
Definition infiniband.c:314
struct ib_queue_pair * ib_find_qp_qpn(struct ib_device *ibdev, unsigned long qpn)
Find queue pair by QPN.
Definition infiniband.c:354
struct ib_device * find_ibdev(union ib_gid *gid)
Find Infiniband device by GID.
#define IBDEV_NAME_LEN
Maximum length of an Infiniband device name.
Definition infiniband.h:396
static int ib_is_open(struct ib_device *ibdev)
Check whether or not Infiniband device is open.
Definition infiniband.h:577
static __always_inline void ib_set_drvdata(struct ib_device *ibdev, void *priv)
Set Infiniband device driver-private data.
Definition infiniband.h:698
static __always_inline void * ib_wq_get_drvdata(struct ib_work_queue *wq)
Get Infiniband work queue driver-private data.
Definition infiniband.h:621
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.
Definition infiniband.c:199
static __always_inline void ib_wq_set_drvdata(struct ib_work_queue *wq, void *priv)
Set Infiniband work queue driver-private data.
Definition infiniband.h:610
ib_rate
Infiniband transmission rates.
Definition infiniband.h:60
@ IB_RATE_30
Definition infiniband.h:63
@ IB_RATE_40
Definition infiniband.h:66
@ IB_RATE_5
Definition infiniband.h:64
@ IB_RATE_20
Definition infiniband.h:65
@ IB_RATE_10
Definition infiniband.h:62
@ IB_RATE_2_5
Definition infiniband.h:61
@ IB_RATE_60
Definition infiniband.h:67
@ IB_RATE_120
Definition infiniband.h:69
@ IB_RATE_80
Definition infiniband.h:68
void ib_complete_send(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc)
Complete send work queue entry.
Definition infiniband.c:515
struct ib_device * alloc_ibdev(size_t priv_size)
Allocate Infiniband device.
Definition infiniband.c:917
static __always_inline void ibdev_put(struct ib_device *ibdev)
Drop reference to Infiniband device.
Definition infiniband.h:599
struct ib_device * last_opened_ibdev(void)
Get most recently opened Infiniband device.
int ib_set_pkey_table(struct ib_device *ibdev, union ib_mad *mad)
Set partition key table.
Definition infiniband.c:847
static uint16_t struct vmbus_xfer_pages_operations * op
Definition netvsc.h:327
Reference counting.
#define ref_get(refcnt)
Get additional reference to object.
Definition refcnt.h:93
#define ref_put(refcnt)
Drop reference to object.
Definition refcnt.h:107
A hardware device.
Definition device.h:77
An Infiniband Address Vector.
Definition infiniband.h:73
unsigned int sl
Service level.
Definition infiniband.h:89
unsigned int vlan
VLAN, if present.
Definition infiniband.h:97
unsigned long qkey
Queue key.
Definition infiniband.h:80
unsigned int gid_present
GID is present.
Definition infiniband.h:91
unsigned int lid
Local ID.
Definition infiniband.h:82
enum ib_rate rate
Rate.
Definition infiniband.h:87
union ib_gid gid
GID, if present.
Definition infiniband.h:93
unsigned int vlan_present
VLAN is present.
Definition infiniband.h:95
unsigned long qpn
Queue Pair Number.
Definition infiniband.h:75
Infiniband completion queue operations.
Definition infiniband.h:195
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.
Definition infiniband.h:217
void(* complete_send)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf, int rc)
Complete Send WQE.
Definition infiniband.h:204
An Infiniband Completion Queue.
Definition infiniband.h:225
struct ib_device * ibdev
Containing Infiniband device.
Definition infiniband.h:227
void * drv_priv
Driver private data.
Definition infiniband.h:247
unsigned long cqn
Completion queue number.
Definition infiniband.h:231
struct list_head list
List of completion queues on this Infiniband device.
Definition infiniband.h:229
unsigned long next_idx
Next completion queue entry index.
Definition infiniband.h:241
struct list_head work_queues
List of work queues completing to this queue.
Definition infiniband.h:243
struct ib_completion_queue_operations * op
Completion queue operations.
Definition infiniband.h:245
unsigned int num_cqes
Number of completion queue entries.
Definition infiniband.h:233
Infiniband device operations.
Definition infiniband.h:255
int(* create_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Create queue pair.
Definition infiniband.h:277
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.
Definition infiniband.h:307
void(* destroy_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Destroy queue pair.
Definition infiniband.h:292
int(* set_port_info)(struct ib_device *ibdev, union ib_mad *mad)
Set port information.
Definition infiniband.h:382
int(* set_pkey_table)(struct ib_device *ibdev, union ib_mad *mad)
Set partition key table.
Definition infiniband.h:391
int(* mcast_attach)(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Attach to multicast group.
Definition infiniband.h:362
int(* post_recv)(struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf)
Post receive work queue entry.
Definition infiniband.h:323
void(* close)(struct ib_device *ibdev)
Close port.
Definition infiniband.h:354
void(* poll_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Poll completion queue.
Definition infiniband.h:334
void(* mcast_detach)(struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid)
Detach from multicast group.
Definition infiniband.h:371
int(* create_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Create completion queue.
Definition infiniband.h:262
void(* destroy_cq)(struct ib_device *ibdev, struct ib_completion_queue *cq)
Destroy completion queue.
Definition infiniband.h:269
void(* poll_eq)(struct ib_device *ibdev)
Poll event queue.
Definition infiniband.h:341
int(* modify_qp)(struct ib_device *ibdev, struct ib_queue_pair *qp)
Modify queue pair.
Definition infiniband.h:285
int(* open)(struct ib_device *ibdev)
Open port.
Definition infiniband.h:348
An Infiniband device.
Definition infiniband.h:399
uint8_t sm_sl
Subnet manager SL.
Definition infiniband.h:448
struct ib_mad_interface * gsi
General services interface.
Definition infiniband.h:462
uint8_t link_width_enabled
Link width enabled.
Definition infiniband.h:430
char name[IBDEV_NAME_LEN]
Name of this Infiniband device.
Definition infiniband.h:409
uint8_t link_speed_active
Link speed active.
Definition infiniband.h:438
unsigned int ports
Total ports on device.
Definition infiniband.h:421
struct list_head list
List of Infiniband devices.
Definition infiniband.h:403
uint8_t link_speed_supported
Link speed supported.
Definition infiniband.h:434
uint16_t sm_lid
Subnet manager LID.
Definition infiniband.h:446
struct ib_device_operations * op
Infiniband operations.
Definition infiniband.h:417
unsigned int index
Index of this Infiniband device.
Definition infiniband.h:407
union ib_guid node_guid
Node GUID.
Definition infiniband.h:440
uint16_t pkey
Partition key.
Definition infiniband.h:450
void * drv_priv
Driver private data.
Definition infiniband.h:468
struct refcnt refcnt
Reference counter.
Definition infiniband.h:401
struct ib_mad_interface * smi
Subnet management interface.
Definition infiniband.h:460
struct device * dev
Underlying device.
Definition infiniband.h:411
uint8_t lemac[ETH_ALEN]
IPoIB LEMAC (if non-default)
Definition infiniband.h:465
uint8_t link_width_active
Link width active.
Definition infiniband.h:432
uint8_t link_speed_enabled
Link speed enabled.
Definition infiniband.h:436
uint8_t link_width_supported
Link width supported.
Definition infiniband.h:428
struct list_head qps
List of queue pairs.
Definition infiniband.h:415
uint16_t lid
Port LID.
Definition infiniband.h:444
uint8_t port_state
Port state.
Definition infiniband.h:426
union ib_gid gid
Port GID (comprising GID prefix and port GUID)
Definition infiniband.h:442
struct list_head cqs
List of completion queues.
Definition infiniband.h:413
unsigned int open_count
Port open request counter.
Definition infiniband.h:423
unsigned int port
Port number.
Definition infiniband.h:419
uint32_t rdma_key
RDMA key.
Definition infiniband.h:457
struct list_head open_list
List of open Infiniband devices.
Definition infiniband.h:405
An Infiniband upper-layer driver.
Definition infiniband.h:472
const char * name
Name.
Definition infiniband.h:474
int(* probe)(struct ib_device *ibdev)
Probe device.
Definition infiniband.h:480
void(* remove)(struct ib_device *ibdev)
Remove device.
Definition infiniband.h:490
void(* notify)(struct ib_device *ibdev)
Notify of device or link state change.
Definition infiniband.h:485
An Infiniband management interface.
Definition ib_mi.h:88
An Infiniband multicast GID.
Definition infiniband.h:131
struct list_head list
List of multicast GIDs on this QP.
Definition infiniband.h:133
Infiniband queue pair operations.
Definition infiniband.h:148
An Infiniband Queue Pair.
Definition infiniband.h:158
enum ib_queue_pair_type type
Queue pair type.
Definition infiniband.h:175
struct ib_address_vector av
Address vector.
Definition infiniband.h:185
struct ib_work_queue recv
Receive queue.
Definition infiniband.h:181
struct list_head list
List of queue pairs on this Infiniband device.
Definition infiniband.h:162
unsigned long qpn
Queue pair number.
Definition infiniband.h:166
const char * name
Queue pair name.
Definition infiniband.h:164
struct ib_queue_pair_operations * op
Queue pair operations.
Definition infiniband.h:187
void * drv_priv
Driver private data.
Definition infiniband.h:189
unsigned long ext_qpn
Externally-visible queue pair number.
Definition infiniband.h:173
struct ib_device * ibdev
Containing Infiniband device.
Definition infiniband.h:160
unsigned long qkey
Queue key.
Definition infiniband.h:177
struct list_head mgids
List of multicast GIDs.
Definition infiniband.h:183
void * owner_priv
Queue owner private data.
Definition infiniband.h:191
struct ib_work_queue send
Send queue.
Definition infiniband.h:179
An Infiniband Work Queue.
Definition infiniband.h:101
unsigned int fill
Number of occupied work queue entries.
Definition infiniband.h:115
struct io_buffer ** iobufs
I/O buffers assigned to work queue.
Definition infiniband.h:125
void * drv_priv
Driver private data.
Definition infiniband.h:127
struct ib_completion_queue * cq
Associated completion queue.
Definition infiniband.h:107
struct list_head list
List of work queues on this completion queue.
Definition infiniband.h:109
struct ib_queue_pair * qp
Containing queue pair.
Definition infiniband.h:103
uint32_t psn
Packet sequence number.
Definition infiniband.h:111
int is_send
"Is a send queue" flag
Definition infiniband.h:105
unsigned long next_idx
Next work queue entry index.
Definition infiniband.h:123
unsigned int num_wqes
Number of work queue entries.
Definition infiniband.h:113
A persistent I/O buffer.
Definition iobuf.h:38
A doubly-linked list entry (or list head)
Definition list.h:19
Linker tables.
static struct tlan_private * priv
Definition tlan.c:225
An Infiniband Global Identifier.
Definition ib_packet.h:34
An Infiniband Globally Unique Identifier.
Definition ib_packet.h:19
A management datagram.
Definition ib_mad.h:611