lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 05 Oct 2010 09:32:53 -0500
From:	Steve Wise <swise@...ngridcomputing.com>
To:	Bernard Metzler <BMT@...ich.ibm.com>
CC:	linux-rdma@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH] SIW: User interface

On 10/05/2010 09:29 AM, Bernard Metzler wrote:
> Steve Wise<swise@...ngridcomputing.com>  wrote on 10/05/2010 04:17:34 PM:
>
>    
>> Steve Wise<swise@...ngridcomputing.com>
>> 10/05/2010 04:17 PM
>>
>> To
>>
>> Bernard Metzler<bmt@...ich.ibm.com>
>>
>> cc
>>
>> netdev@...r.kernel.org, linux-rdma@...r.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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ