Lines Matching refs:priv
68 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_stats() local
70 stat->ps_recv = priv->packets_recv; in rdmasniff_stats()
80 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_cleanup() local
82 ibv_dereg_mr(priv->mr); in rdmasniff_cleanup()
83 ibv_destroy_flow(priv->flow); in rdmasniff_cleanup()
84 ibv_destroy_qp(priv->qp); in rdmasniff_cleanup()
85 ibv_destroy_cq(priv->cq); in rdmasniff_cleanup()
86 ibv_dealloc_pd(priv->pd); in rdmasniff_cleanup()
87 ibv_destroy_comp_channel(priv->channel); in rdmasniff_cleanup()
88 ibv_close_device(priv->context); in rdmasniff_cleanup()
89 free(priv->oneshot_buffer); in rdmasniff_cleanup()
97 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_post_recv() local
103 sg_entry.lkey = priv->mr->lkey; in rdmasniff_post_recv()
110 ibv_post_recv(priv->qp, &wr, &bad_wr); in rdmasniff_post_recv()
116 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_read() local
124 if (!priv->cq_event) { in rdmasniff_read()
125 while (ibv_get_cq_event(priv->channel, &ev_cq, &ev_ctx) < 0) { in rdmasniff_read()
134 ibv_ack_cq_events(priv->cq, 1); in rdmasniff_read()
135 ibv_req_notify_cq(priv->cq, 0); in rdmasniff_read()
136 priv->cq_event = 1; in rdmasniff_read()
140 if (ibv_poll_cq(priv->cq, 1, &wc) != 1) { in rdmasniff_read()
141 priv->cq_event = 0; in rdmasniff_read()
161 ++priv->packets_recv; in rdmasniff_read()
181 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_oneshot() local
184 memcpy(priv->oneshot_buffer, bytes, h->caplen); in rdmasniff_oneshot()
185 *sp->pkt = priv->oneshot_buffer; in rdmasniff_oneshot()
191 struct pcap_rdmasniff *priv = handle->priv; in rdmasniff_activate() local
198 priv->context = ibv_open_device(priv->rdma_device); in rdmasniff_activate()
199 if (!priv->context) { in rdmasniff_activate()
205 priv->pd = ibv_alloc_pd(priv->context); in rdmasniff_activate()
206 if (!priv->pd) { in rdmasniff_activate()
212 priv->channel = ibv_create_comp_channel(priv->context); in rdmasniff_activate()
213 if (!priv->channel) { in rdmasniff_activate()
219 priv->cq = ibv_create_cq(priv->context, RDMASNIFF_NUM_RECEIVES, in rdmasniff_activate()
220 NULL, priv->channel, 0); in rdmasniff_activate()
221 if (!priv->cq) { in rdmasniff_activate()
227 ibv_req_notify_cq(priv->cq, 0); in rdmasniff_activate()
230 qp_init_attr.send_cq = qp_init_attr.recv_cq = priv->cq; in rdmasniff_activate()
234 priv->qp = ibv_create_qp(priv->pd, &qp_init_attr); in rdmasniff_activate()
235 if (!priv->qp) { in rdmasniff_activate()
243 qp_attr.port_num = priv->port_num; in rdmasniff_activate()
244 if (ibv_modify_qp(priv->qp, &qp_attr, IBV_QP_STATE | IBV_QP_PORT)) { in rdmasniff_activate()
252 if (ibv_modify_qp(priv->qp, &qp_attr, IBV_QP_STATE)) { in rdmasniff_activate()
261 flow_attr.port = priv->port_num; in rdmasniff_activate()
262 priv->flow = ibv_create_flow(priv->qp, &flow_attr); in rdmasniff_activate()
263 if (!priv->flow) { in rdmasniff_activate()
277 priv->oneshot_buffer = malloc(RDMASNIFF_RECEIVE_SIZE); in rdmasniff_activate()
278 if (!priv->oneshot_buffer) { in rdmasniff_activate()
284 priv->mr = ibv_reg_mr(priv->pd, handle->buffer, handle->bufsize, IBV_ACCESS_LOCAL_WRITE); in rdmasniff_activate()
285 if (!priv->mr) { in rdmasniff_activate()
296 if (!ibv_query_port(priv->context, priv->port_num, &port_attr) && in rdmasniff_activate()
316 handle->selectable_fd = priv->channel->fd; in rdmasniff_activate()
321 if (priv->mr) { in rdmasniff_activate()
322 ibv_dereg_mr(priv->mr); in rdmasniff_activate()
325 if (priv->flow) { in rdmasniff_activate()
326 ibv_destroy_flow(priv->flow); in rdmasniff_activate()
329 if (priv->qp) { in rdmasniff_activate()
330 ibv_destroy_qp(priv->qp); in rdmasniff_activate()
333 if (priv->cq) { in rdmasniff_activate()
334 ibv_destroy_cq(priv->cq); in rdmasniff_activate()
337 if (priv->channel) { in rdmasniff_activate()
338 ibv_destroy_comp_channel(priv->channel); in rdmasniff_activate()
341 if (priv->pd) { in rdmasniff_activate()
342 ibv_dealloc_pd(priv->pd); in rdmasniff_activate()
345 if (priv->context) { in rdmasniff_activate()
346 ibv_close_device(priv->context); in rdmasniff_activate()
349 if (priv->oneshot_buffer) { in rdmasniff_activate()
350 free(priv->oneshot_buffer); in rdmasniff_activate()
359 struct pcap_rdmasniff *priv; in rdmasniff_create() local
401 priv = p->priv; in rdmasniff_create()
402 priv->rdma_device = dev_list[i]; in rdmasniff_create()
403 priv->port_num = port_num; in rdmasniff_create()