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] [thread-next>] [day] [month] [year] [list]
Message-ID: <a3a10e6e-c75e-853b-06d3-ce2f67424afc@fujitsu.com>
Date:   Fri, 25 Nov 2022 02:22:24 +0000
From:   "lizhijian@...itsu.com" <lizhijian@...itsu.com>
To:     Jason Gunthorpe <jgg@...dia.com>
CC:     "zyjzyj2000@...il.com" <zyjzyj2000@...il.com>,
        "leon@...nel.org" <leon@...nel.org>,
        Bob Pearson <rpearsonhpe@...il.com>,
        "linux-rdma@...r.kernel.org" <linux-rdma@...r.kernel.org>,
        Mark Bloch <mbloch@...dia.com>, Tom Talpey <tom@...pey.com>,
        "tomasz.gromadzki@...el.com" <tomasz.gromadzki@...el.com>,
        Dan Williams <dan.j.williams@...el.com>,
        "yangx.jy@...itsu.com" <yangx.jy@...itsu.com>,
        "Yasunori Gotou (Fujitsu)" <y-goto@...itsu.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [for-next PATCH v6 09/10] RDMA/cm: Make QP FLUSHABLE



On 25/11/2022 01:39, Jason Gunthorpe wrote:
> On Wed, Nov 23, 2022 at 06:07:37AM +0000, lizhijian@...itsu.com wrote:
>>
>>
>> On 22/11/2022 22:52, Jason Gunthorpe wrote:
>>> On Wed, Nov 16, 2022 at 04:19:50PM +0800, Li Zhijian wrote:
>>>> It enables flushable access flag for qp
>>>>
>>>> Reviewed-by: Zhu Yanjun <zyjzyj2000@...il.com>
>>>> Signed-off-by: Li Zhijian <lizhijian@...itsu.com>
>>>> ---
>>>> V5: new patch, inspired by Bob
>>>> ---
>>>>    drivers/infiniband/core/cm.c | 3 ++-
>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
>>>> index 1f9938a2c475..58837aac980b 100644
>>>> --- a/drivers/infiniband/core/cm.c
>>>> +++ b/drivers/infiniband/core/cm.c
>>>> @@ -4096,7 +4096,8 @@ static int cm_init_qp_init_attr(struct cm_id_private *cm_id_priv,
>>>>    		qp_attr->qp_access_flags = IB_ACCESS_REMOTE_WRITE;
>>>>    		if (cm_id_priv->responder_resources)
>>>>    			qp_attr->qp_access_flags |= IB_ACCESS_REMOTE_READ |
>>>> -						    IB_ACCESS_REMOTE_ATOMIC;
>>>> +						    IB_ACCESS_REMOTE_ATOMIC |
>>>> +						    IB_ACCESS_FLUSHABLE;
>>>
>>> What is the point of this? Nothing checks IB_ACCESS_FLUSHABLE ?
>>
>> Previous, responder of RXE will check qp_access_flags in check_op_valid():
>>    256 static enum resp_states check_op_valid(struct rxe_qp *qp,
>>
>>    257                                        struct rxe_pkt_info *pkt)
>>
>>    258 {
>>
>>    259         switch (qp_type(qp)) {
>>
>>    260         case IB_QPT_RC:
>>
>>    261                 if (((pkt->mask & RXE_READ_MASK) &&
>>
>>    262                      !(qp->attr.qp_access_flags &
>> IB_ACCESS_REMOTE_READ)) ||
>>   
>>
>>    263                     ((pkt->mask & RXE_WRITE_MASK) &&
>>
>>    264                      !(qp->attr.qp_access_flags &
>> IB_ACCESS_REMOTE_WRITE)) ||
>>    265                     ((pkt->mask & RXE_ATOMIC_MASK) &&
>>
>>    266                      !(qp->attr.qp_access_flags &
>> IB_ACCESS_REMOTE_ATOMIC))) {
>>    267                         return RESPST_ERR_UNSUPPORTED_OPCODE;
>>
>>    268                 }
>>
>> based on this, additional IB_FLUSH_PERSISTENT and IB_ACCESS_FLUSH_GLOBAL
>> were added in patch7 since V5 suggested by Bob.
>> Because of this change, QP should become FLUSHABLE correspondingly.
> 
> But nothing ever reads IB_ACCESS_FLUSHABLE, so why is it added?

include/rdma/ib_verbs.h:
+	IB_ACCESS_FLUSH_GLOBAL = IB_UVERBS_ACCESS_FLUSH_GLOBAL,
+	IB_ACCESS_FLUSH_PERSISTENT = IB_UVERBS_ACCESS_FLUSH_PERSISTENT,
+	IB_ACCESS_FLUSHABLE = IB_ACCESS_FLUSH_GLOBAL |
+			      IB_ACCESS_FLUSH_PERSISTENT,

IB_ACCESS_FLUSHABLE is a wrapper of IB_ACCESS_FLUSH_GLOBAL | 
IB_ACCESS_FLUSH_PERSISTENT. With this wrapper, i will write one less 
line of code :)

I'm fine to expand it in next version.


> 
> Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ