| 1 |
.\" -*- nroff -*- |
| 2 |
.\" Licensed under the OpenIB.org BSD license (FreeBSD Variant) - See COPYING.md |
| 3 |
.\" |
| 4 |
.TH IBV_CREATE_SRQ_EX 3 2013-06-26 libibverbs "Libibverbs Programmer's Manual" |
| 5 |
.SH "NAME" |
| 6 |
ibv_create_srq_ex, ibv_destroy_srq \- create or destroy a shared receive queue (SRQ) |
| 7 |
.SH "SYNOPSIS" |
| 8 |
.nf |
| 9 |
.B #include <infiniband/verbs.h> |
| 10 |
.sp |
| 11 |
.BI "struct ibv_srq *ibv_create_srq_ex(struct ibv_context " "*context" ", struct " |
| 12 |
.BI " ibv_srq_init_attr_ex " "*srq_init_attr_ex" ); |
| 13 |
.sp |
| 14 |
.BI "int ibv_destroy_srq(struct ibv_srq " "*srq" ); |
| 15 |
.fi |
| 16 |
.SH "DESCRIPTION" |
| 17 |
.B ibv_create_srq_ex() |
| 18 |
creates a shared receive queue (SRQ) supporting both basic and xrc modes. |
| 19 |
The argument |
| 20 |
.I srq_init_attr_ex |
| 21 |
is an ibv_srq_init_attr_ex struct, as defined in <infiniband/verbs.h>. |
| 22 |
.PP |
| 23 |
.nf |
| 24 |
struct ibv_srq_init_attr_ex { |
| 25 |
.in +8 |
| 26 |
void *srq_context; /* Associated context of the SRQ */ |
| 27 |
struct ibv_srq_attr attr; /* SRQ attributes */ |
| 28 |
uint32_t comp_mask; /* Identifies valid fields */ |
| 29 |
enum ibv_srq_type srq_type; /* Basic / XRC / tag matching */ |
| 30 |
struct ibv_pd *pd; /* PD associated with the SRQ */ |
| 31 |
struct ibv_xrcd *xrcd; /* XRC domain to associate with the SRQ */ |
| 32 |
struct ibv_cq *cq; /* CQ to associate with the SRQ for XRC mode */ |
| 33 |
struct ibv_tm_cap tm_cap; /* Tag matching attributes */ |
| 34 |
.in -8 |
| 35 |
}; |
| 36 |
.sp |
| 37 |
.nf |
| 38 |
struct ibv_srq_attr { |
| 39 |
.in +8 |
| 40 |
uint32_t max_wr; /* Requested max number of outstanding work requests (WRs) in the SRQ */ |
| 41 |
uint32_t max_sge; /* Requested max number of scatter elements per WR */ |
| 42 |
uint32_t srq_limit; /* The limit value of the SRQ */ |
| 43 |
.in -8 |
| 44 |
}; |
| 45 |
.sp |
| 46 |
.nf |
| 47 |
struct ibv_tm_cap { |
| 48 |
.in +8 |
| 49 |
uint32_t max_num_tags; /* Tag matching list size */ |
| 50 |
uint32_t max_ops; /* Number of outstanding tag list operations */ |
| 51 |
.in -8 |
| 52 |
}; |
| 53 |
.sp |
| 54 |
.nf |
| 55 |
.fi |
| 56 |
.PP |
| 57 |
The function |
| 58 |
.B ibv_create_srq_ex() |
| 59 |
will update the |
| 60 |
.I srq_init_attr_ex |
| 61 |
struct with the original values of the SRQ that was created; the |
| 62 |
values of max_wr and max_sge will be greater than or equal to the |
| 63 |
values requested. |
| 64 |
.PP |
| 65 |
.B ibv_destroy_srq() |
| 66 |
destroys the SRQ |
| 67 |
.I srq\fR. |
| 68 |
.SH "RETURN VALUE" |
| 69 |
.B ibv_create_srq_ex() |
| 70 |
returns a pointer to the created SRQ, or NULL if the request fails. |
| 71 |
.PP |
| 72 |
.B ibv_destroy_srq() |
| 73 |
returns 0 on success, or the value of errno on failure (which indicates the failure reason). |
| 74 |
.SH "NOTES" |
| 75 |
.B ibv_destroy_srq() |
| 76 |
fails if any queue pair is still associated with this SRQ. |
| 77 |
.SH "SEE ALSO" |
| 78 |
.BR ibv_alloc_pd (3), |
| 79 |
.BR ibv_modify_srq (3), |
| 80 |
.BR ibv_query_srq (3) |
| 81 |
.SH "AUTHORS" |
| 82 |
.TP |
| 83 |
Yishai Hadas <[email protected]> |