本文整理汇总了C++中rxe_drop_ref函数的典型用法代码示例。如果您正苦于以下问题:C++ rxe_drop_ref函数的具体用法?C++ rxe_drop_ref怎么用?C++ rxe_drop_ref使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rxe_drop_ref函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rxe_qp_do_cleanup
/* called when the last reference to the qp is dropped */
static void rxe_qp_do_cleanup(struct work_struct *work)
{
struct rxe_qp *qp = container_of(work, typeof(*qp), cleanup_work.work);
rxe_drop_all_mcast_groups(qp);
if (qp->sq.queue)
rxe_queue_cleanup(qp->sq.queue);
if (qp->srq)
rxe_drop_ref(qp->srq);
if (qp->rq.queue)
rxe_queue_cleanup(qp->rq.queue);
if (qp->scq)
rxe_drop_ref(qp->scq);
if (qp->rcq)
rxe_drop_ref(qp->rcq);
if (qp->pd)
rxe_drop_ref(qp->pd);
if (qp->resp.mr) {
rxe_drop_ref(qp->resp.mr);
qp->resp.mr = NULL;
}
if (qp_type(qp) == IB_QPT_RC)
sk_dst_reset(qp->sk->sk);
free_rd_atomic_resources(qp);
kernel_sock_shutdown(qp->sk, SHUT_RDWR);
sock_release(qp->sk);
}
示例2: rxe_qp_cleanup
/* called when the last reference to the qp is dropped */
void rxe_qp_cleanup(void *arg)
{
struct rxe_qp *qp = arg;
rxe_drop_all_mcast_groups(qp);
if (qp->sq.queue)
rxe_queue_cleanup(qp->sq.queue);
if (qp->srq)
rxe_drop_ref(qp->srq);
if (qp->rq.queue)
rxe_queue_cleanup(qp->rq.queue);
if (qp->scq)
rxe_drop_ref(qp->scq);
if (qp->rcq)
rxe_drop_ref(qp->rcq);
if (qp->pd)
rxe_drop_ref(qp->pd);
if (qp->resp.mr) {
rxe_drop_ref(qp->resp.mr);
qp->resp.mr = NULL;
}
free_rd_atomic_resources(qp);
kernel_sock_shutdown(qp->sk, SHUT_RDWR);
}
示例3: to_rdev
static struct ib_mr *rxe_get_dma_mr(struct ib_pd *ibpd, int access)
{
struct rxe_dev *rxe = to_rdev(ibpd->device);
struct rxe_pd *pd = to_rpd(ibpd);
struct rxe_mem *mr;
int err;
mr = rxe_alloc(&rxe->mr_pool);
if (!mr) {
err = -ENOMEM;
goto err1;
}
rxe_add_index(mr);
rxe_add_ref(pd);
err = rxe_mem_init_dma(pd, access, mr);
if (err)
goto err2;
return &mr->ibmr;
err2:
rxe_drop_ref(pd);
rxe_drop_index(mr);
rxe_drop_ref(mr);
err1:
return ERR_PTR(err);
}
示例4: to_rdev
static struct ib_ah *rxe_create_ah(struct ib_pd *ibpd, struct ib_ah_attr *attr)
{
int err;
struct rxe_dev *rxe = to_rdev(ibpd->device);
struct rxe_pd *pd = to_rpd(ibpd);
struct rxe_ah *ah;
err = rxe_av_chk_attr(rxe, attr);
if (err)
goto err1;
ah = rxe_alloc(&rxe->ah_pool);
if (!ah) {
err = -ENOMEM;
goto err1;
}
rxe_add_ref(pd);
ah->pd = pd;
err = rxe_init_av(rxe, attr, &ah->av);
if (err)
goto err2;
return &ah->ibah;
err2:
rxe_drop_ref(pd);
rxe_drop_ref(ah);
err1:
return ERR_PTR(err);
}
示例5: rxe_destroy_ah
static int rxe_destroy_ah(struct ib_ah *ibah)
{
struct rxe_ah *ah = to_rah(ibah);
rxe_drop_ref(ah->pd);
rxe_drop_ref(ah);
return 0;
}
示例6: rxe_destroy_srq
static void rxe_destroy_srq(struct ib_srq *ibsrq, struct ib_udata *udata)
{
struct rxe_srq *srq = to_rsrq(ibsrq);
if (srq->rq.queue)
rxe_queue_cleanup(srq->rq.queue);
rxe_drop_ref(srq->pd);
rxe_drop_ref(srq);
}
示例7: rxe_dereg_mr
static int rxe_dereg_mr(struct ib_mr *ibmr, struct ib_udata *udata)
{
struct rxe_mem *mr = to_rmr(ibmr);
mr->state = RXE_MEM_STATE_ZOMBIE;
rxe_drop_ref(mr->pd);
rxe_drop_index(mr);
rxe_drop_ref(mr);
return 0;
}
示例8: free_rd_atomic_resource
void free_rd_atomic_resource(struct rxe_qp *qp, struct resp_res *res)
{
if (res->type == RXE_ATOMIC_MASK) {
rxe_drop_ref(qp);
kfree_skb(res->atomic.skb);
} else if (res->type == RXE_READ_MASK) {
if (res->read.mr)
rxe_drop_ref(res->read.mr);
}
res->type = 0;
}
示例9: rxe_destroy_srq
static int rxe_destroy_srq(struct ib_srq *ibsrq)
{
struct rxe_srq *srq = to_rsrq(ibsrq);
if (srq->rq.queue)
rxe_queue_cleanup(srq->rq.queue);
rxe_drop_ref(srq->pd);
rxe_drop_index(srq);
rxe_drop_ref(srq);
return 0;
}
示例10: free_rd_atomic_resource
void free_rd_atomic_resource(struct rxe_qp *qp, struct resp_res *res)
{
struct rxe_dev *rxe = to_rdev(qp->ibqp.device);
if (res->type == RXE_ATOMIC_MASK) {
rxe_drop_ref(qp);
kfree_skb(res->atomic.skb);
atomic_dec(&rxe->resp_skb_out);
} else if (res->type == RXE_READ_MASK) {
if (res->read.mr)
rxe_drop_ref(res->read.mr);
}
res->type = 0;
}
示例11: rxe_qp_from_init
/* called by the create qp verb */
int rxe_qp_from_init(struct rxe_dev *rxe, struct rxe_qp *qp, struct rxe_pd *pd,
struct ib_qp_init_attr *init, struct ib_udata *udata,
struct ib_pd *ibpd)
{
int err;
struct rxe_cq *rcq = to_rcq(init->recv_cq);
struct rxe_cq *scq = to_rcq(init->send_cq);
struct rxe_srq *srq = init->srq ? to_rsrq(init->srq) : NULL;
struct ib_ucontext *context = udata ? ibpd->uobject->context : NULL;
rxe_add_ref(pd);
rxe_add_ref(rcq);
rxe_add_ref(scq);
if (srq)
rxe_add_ref(srq);
qp->pd = pd;
qp->rcq = rcq;
qp->scq = scq;
qp->srq = srq;
qp->udata = udata;
rxe_qp_init_misc(rxe, qp, init);
err = rxe_qp_init_req(rxe, qp, init, context, udata);
if (err)
goto err1;
err = rxe_qp_init_resp(rxe, qp, init, context, udata);
if (err)
goto err2;
qp->attr.qp_state = IB_QPS_RESET;
qp->valid = 1;
return 0;
err2:
rxe_queue_cleanup(qp->sq.queue);
err1:
if (srq)
rxe_drop_ref(srq);
rxe_drop_ref(scq);
rxe_drop_ref(rcq);
rxe_drop_ref(pd);
return err;
}
示例12: rxe_dealloc_pd
static int rxe_dealloc_pd(struct ib_pd *ibpd)
{
struct rxe_pd *pd = to_rpd(ibpd);
rxe_drop_ref(pd);
return 0;
}
示例13: rxe_send
int rxe_send(struct rxe_pkt_info *pkt, struct sk_buff *skb)
{
int err;
skb->destructor = rxe_skb_tx_dtor;
skb->sk = pkt->qp->sk->sk;
rxe_add_ref(pkt->qp);
atomic_inc(&pkt->qp->skb_out);
if (skb->protocol == htons(ETH_P_IP)) {
err = ip_local_out(dev_net(skb_dst(skb)->dev), skb->sk, skb);
} else if (skb->protocol == htons(ETH_P_IPV6)) {
err = ip6_local_out(dev_net(skb_dst(skb)->dev), skb->sk, skb);
} else {
pr_err("Unknown layer 3 protocol: %d\n", skb->protocol);
atomic_dec(&pkt->qp->skb_out);
rxe_drop_ref(pkt->qp);
kfree_skb(skb);
return -EINVAL;
}
if (unlikely(net_xmit_eval(err))) {
pr_debug("error sending packet: %d\n", err);
return -EAGAIN;
}
return 0;
}
示例14: rxe_dealloc_ucontext
static int rxe_dealloc_ucontext(struct ib_ucontext *ibuc)
{
struct rxe_ucontext *uc = to_ruc(ibuc);
rxe_drop_ref(uc);
return 0;
}
示例15: rxe_destroy_cq
static int rxe_destroy_cq(struct ib_cq *ibcq)
{
struct rxe_cq *cq = to_rcq(ibcq);
rxe_drop_ref(cq);
return 0;
}