[ofa-general] spin_lock_irqsave in ib_send_mad

Sean Hefty sean.hefty at intel.com
Wed Jun 10 12:07:21 PDT 2009


>----------------------------------------------------
>if (qp_info->send_queue.count < qp_info->send_queue.max_active) {

This loses the locking around send_queue.count, which can allow trying to post
more sends than the QP supports.

>                ret = ib_post_send(mad_agent->qp, &mad_send_wr->send_wr,
>                                   &bad_send_wr);
>                spin_lock_irqsave(&qp_info->send_queue.lock, flags);
>                list = &qp_info->send_queue.list;
>} else {
>                ret = 0;
>                spin_lock_irqsave(&qp_info->send_queue.lock, flags);
>                list = &qp_info->overflow_list;
>}

I think the code will end up quite a bit more complex not locking around
ib_post_send, but maybe there's a clever way to handle this.

- Sean




More information about the general mailing list