netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Wise <swise@opengridcomputing.com>
To: Bernard Metzler <BMT@zurich.ibm.com>
Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] SIW: User interface
Date: Tue, 05 Oct 2010 09:32:53 -0500	[thread overview]
Message-ID: <4CAB3715.60906@opengridcomputing.com> (raw)
In-Reply-To: <OF07B553EF.B746D69E-ONC12577B3.004EAD6A-C12577B3.004F92B0@ch.ibm.com>

On 10/05/2010 09:29 AM, Bernard Metzler wrote:
> Steve Wise<swise@opengridcomputing.com>  wrote on 10/05/2010 04:17:34 PM:
>
>    
>> Steve Wise<swise@opengridcomputing.com>
>> 10/05/2010 04:17 PM
>>
>> To
>>
>> Bernard Metzler<bmt@zurich.ibm.com>
>>
>> cc
>>
>> netdev@vger.kernel.org, linux-rdma@vger.kernel.org
>>
>> Subject
>>
>> Re: [PATCH] SIW: User interface
>>
>> On 10/05/2010 01:54 AM, Bernard Metzler wrote:
>>
>>
>> <snip>
>>
>>      
>>> +
>>> +/*
>>> + * siw_post_send()
>>> + *
>>> + * Post a list of S-WR's to a SQ.
>>> + *
>>> + * @ofa_qp:   OFA QP contained in siw QP
>>> + * @wr:      Null terminated list of user WR's
>>> + * @bad_wr:   Points to failing WR in case of synchronous failure.
>>> + */
>>> +int siw_post_send(struct ib_qp *ofa_qp, struct ib_send_wr *wr,
>>> +        struct ib_send_wr **bad_wr)
>>> +{
>>> +   struct siw_wqe   *wqe = NULL;
>>> +   struct siw_qp   *qp = siw_qp_ofa2siw(ofa_qp);
>>> +
>>> +   unsigned long flags;
>>> +   int rv = 0;
>>> +
>>> +   dprint(DBG_WR|DBG_TX, "(QP%d): state=%d\n",
>>> +      QP_ID(qp), qp->attrs.state);
>>> +
>>> +   /*
>>> +    * Acquire QP state lock for reading. The idea is that a
>>> +    * user cannot move the QP out of RTS during TX/RX processing.
>>> +    */
>>> +   down_read(&qp->state_lock);
>>> +
>>>
>>>        
>> I don't think you can use a rw_semaphore here because it potentially can
>>      
>    
>> block.  You cannot block/sleep in the post_send/post_recv (and some
>> other) RDMA provider functions.  See
>> Documentation/infiniband/core_locking.txt.
>>
>>
>>      
> ah, ok.
> with that, a down_read_trylock() would solve the issue...?
> given the limited set of errno values - what would you suggest
> as a meaningful return value? EBUSY, EINVAL, ...?
>
>    

I think it is expected that you should implement this without requiring 
the blocking semaphore.  Returning an error will cause the application 
to bail.


Steve.

      reply	other threads:[~2010-10-05 14:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05  6:54 [PATCH] SIW: User interface Bernard Metzler
     [not found] ` <1286261647-5139-1-git-send-email-bmt-OA+xvbQnYDHMbYB6QlFGEg@public.gmane.org>
2010-10-05 14:17   ` Steve Wise
2010-10-05 14:29     ` Bernard Metzler
2010-10-05 14:32       ` Steve Wise [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CAB3715.60906@opengridcomputing.com \
    --to=swise@opengridcomputing.com \
    --cc=BMT@zurich.ibm.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).