Lines Matching refs:rxe

9 #include "rxe.h"
16 /* free resources for a rxe device all objects created for this device must
21 struct rxe_dev *rxe = container_of(ib_dev, struct rxe_dev, ib_dev);
23 rxe_pool_cleanup(&rxe->uc_pool);
24 rxe_pool_cleanup(&rxe->pd_pool);
25 rxe_pool_cleanup(&rxe->ah_pool);
26 rxe_pool_cleanup(&rxe->srq_pool);
27 rxe_pool_cleanup(&rxe->qp_pool);
28 rxe_pool_cleanup(&rxe->cq_pool);
29 rxe_pool_cleanup(&rxe->mr_pool);
30 rxe_pool_cleanup(&rxe->mw_pool);
32 WARN_ON(!RB_EMPTY_ROOT(&rxe->mcg_tree));
34 mutex_destroy(&rxe->usdev_lock);
41 /* initialize rxe device parameters */
42 static void rxe_init_device_param(struct rxe_dev *rxe, struct net_device *ndev)
44 rxe->max_inline_data = RXE_MAX_INLINE_DATA;
46 rxe->attr.vendor_id = RXE_VENDOR_ID;
47 rxe->attr.max_mr_size = RXE_MAX_MR_SIZE;
48 rxe->attr.page_size_cap = RXE_PAGE_SIZE_CAP;
49 rxe->attr.max_qp = RXE_MAX_QP;
50 rxe->attr.max_qp_wr = RXE_MAX_QP_WR;
51 rxe->attr.device_cap_flags = RXE_DEVICE_CAP_FLAGS;
52 rxe->attr.kernel_cap_flags = IBK_ALLOW_USER_UNREG;
53 rxe->attr.max_send_sge = RXE_MAX_SGE;
54 rxe->attr.max_recv_sge = RXE_MAX_SGE;
55 rxe->attr.max_sge_rd = RXE_MAX_SGE_RD;
56 rxe->attr.max_cq = RXE_MAX_CQ;
57 rxe->attr.max_cqe = (1 << RXE_MAX_LOG_CQE) - 1;
58 rxe->attr.max_mr = RXE_MAX_MR;
59 rxe->attr.max_mw = RXE_MAX_MW;
60 rxe->attr.max_pd = RXE_MAX_PD;
61 rxe->attr.max_qp_rd_atom = RXE_MAX_QP_RD_ATOM;
62 rxe->attr.max_res_rd_atom = RXE_MAX_RES_RD_ATOM;
63 rxe->attr.max_qp_init_rd_atom = RXE_MAX_QP_INIT_RD_ATOM;
64 rxe->attr.atomic_cap = IB_ATOMIC_HCA;
65 rxe->attr.max_mcast_grp = RXE_MAX_MCAST_GRP;
66 rxe->attr.max_mcast_qp_attach = RXE_MAX_MCAST_QP_ATTACH;
67 rxe->attr.max_total_mcast_qp_attach = RXE_MAX_TOT_MCAST_QP_ATTACH;
68 rxe->attr.max_ah = RXE_MAX_AH;
69 rxe->attr.max_srq = RXE_MAX_SRQ;
70 rxe->attr.max_srq_wr = RXE_MAX_SRQ_WR;
71 rxe->attr.max_srq_sge = RXE_MAX_SRQ_SGE;
72 rxe->attr.max_fast_reg_page_list_len = RXE_MAX_FMR_PAGE_LIST_LEN;
73 rxe->attr.max_pkeys = RXE_MAX_PKEYS;
74 rxe->attr.local_ca_ack_delay = RXE_LOCAL_CA_ACK_DELAY;
77 memcpy(rxe->raw_gid, ndev->dev_addr,
84 eth_random_addr(rxe->raw_gid);
87 addrconf_addr_eui48((unsigned char *)&rxe->attr.sys_image_guid,
88 rxe->raw_gid);
90 rxe->max_ucontext = RXE_MAX_UCONTEXT;
93 rxe->attr.kernel_cap_flags |= IBK_ON_DEMAND_PAGING;
96 rxe->attr.odp_caps.general_caps |= IB_ODP_SUPPORT;
98 rxe->attr.odp_caps.per_transport_caps.ud_odp_caps |= IB_ODP_SUPPORT_SEND;
99 rxe->attr.odp_caps.per_transport_caps.ud_odp_caps |= IB_ODP_SUPPORT_RECV;
100 rxe->attr.odp_caps.per_transport_caps.ud_odp_caps |= IB_ODP_SUPPORT_SRQ_RECV;
102 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_SEND;
103 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_RECV;
104 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_WRITE;
105 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_READ;
106 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_ATOMIC;
107 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_SRQ_RECV;
108 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_FLUSH;
109 rxe->attr.odp_caps.per_transport_caps.rc_odp_caps |= IB_ODP_SUPPORT_ATOMIC_WRITE;
112 ib_set_device_ops(&rxe->ib_dev, &rxe_ib_dev_odp_ops);
145 static void rxe_init_ports(struct rxe_dev *rxe, struct net_device *ndev)
147 struct rxe_port *port = &rxe->port;
151 rxe->raw_gid);
156 static void rxe_init_pools(struct rxe_dev *rxe)
158 rxe_pool_init(rxe, &rxe->uc_pool, RXE_TYPE_UC);
159 rxe_pool_init(rxe, &rxe->pd_pool, RXE_TYPE_PD);
160 rxe_pool_init(rxe, &rxe->ah_pool, RXE_TYPE_AH);
161 rxe_pool_init(rxe, &rxe->srq_pool, RXE_TYPE_SRQ);
162 rxe_pool_init(rxe, &rxe->qp_pool, RXE_TYPE_QP);
163 rxe_pool_init(rxe, &rxe->cq_pool, RXE_TYPE_CQ);
164 rxe_pool_init(rxe, &rxe->mr_pool, RXE_TYPE_MR);
165 rxe_pool_init(rxe, &rxe->mw_pool, RXE_TYPE_MW);
168 /* initialize rxe device state */
169 static void rxe_init(struct rxe_dev *rxe, struct net_device *ndev)
172 rxe_init_device_param(rxe, ndev);
174 rxe_init_ports(rxe, ndev);
175 rxe_init_pools(rxe);
178 spin_lock_init(&rxe->mmap_offset_lock);
179 spin_lock_init(&rxe->pending_lock);
180 INIT_LIST_HEAD(&rxe->pending_mmaps);
183 spin_lock_init(&rxe->mcg_lock);
184 rxe->mcg_tree = RB_ROOT;
186 mutex_init(&rxe->usdev_lock);
189 void rxe_set_mtu(struct rxe_dev *rxe, unsigned int ndev_mtu)
191 struct rxe_port *port = &rxe->port;
203 /* called by ifc layer to create new rxe device.
204 * The caller should allocate memory for rxe by calling ib_alloc_device.
206 int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name,
209 rxe_init(rxe, ndev);
210 rxe_set_mtu(rxe, mtu);
212 return rxe_register_device(rxe, ibdev_name, ndev);
217 struct rxe_dev *rxe;
221 rxe_err("rxe creation allowed on top of a real device only\n");
226 rxe = rxe_get_dev_from_net(ndev);
227 if (rxe) {
228 ib_device_put(&rxe->ib_dev);
229 rxe_err_dev(rxe, "already configured on %s\n", ndev->name);
244 .type = "rxe",
280 MODULE_ALIAS_RDMA_LINK("rxe");