All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bernard Metzler" <BMT@zurich.ibm.com>
To: "Stefan Metzmacher" <metze@samba.org>
Cc: "linux-rdma" <linux-rdma@vger.kernel.org>
Subject: Re: Re: [PATCH 00/31] rdma/siw: fix a lot of deadlocks and use after free bugs
Date: Fri, 28 May 2021 14:35:07 +0000	[thread overview]
Message-ID: <OF3E623A7B.5CEABB75-ON002586E3.004D659D-002586E3.00501E8D@notes.na.collabserv.com> (raw)
In-Reply-To: <731bc8e0-4bbc-7006-23ef-2e0008f5e415@samba.org>

-----"Stefan Metzmacher" <metze@samba.org> wrote: -----

>To: "Bernard Metzler" <BMT@zurich.ibm.com>
>From: "Stefan Metzmacher" <metze@samba.org>
>Date: 05/26/2021 05:44PM
>Cc: "linux-rdma" <linux-rdma@vger.kernel.org>
>Subject: [EXTERNAL] Re: [PATCH 00/31] rdma/siw: fix a lot of
>deadlocks and use after free bugs
>
>Hi Bernard,
>
>> Much appreciated!
>> These are quite some patches, and I will need some time
>> to go through. Would bee nice if those would be broken
>> down into smaller bundles (introduce non-blocking connect,
>> _siw_cep_close() subroutine, fixing cep reference counting,
>> smp_mb() after STag invalidation, ..). 
>
>They mostly fall out naturally getting one step further
>with each commit. So most of them depend on each other.
>I'll see if I can reorder some of them, but I'm not sure it's really
>worth the effort.

Why not having just a few patches - one fixing the obvious
object management bug(s), one on a more concise error handling,
one on using exported kernel functions instead of calling
socket method directly, one introducing asynchronous connect..?

I understand you collected problems over time and fixed those,
but it would be much easier to digest if separated logically.

>
>> Anyway, many thanks for the effort,
>
>Thanks a lot for the review.
>
>> it will improve the driver!
>
>Yes!
>
>On top I have some code to support MPA rev1 in peer_to_peer mode
>in order to interoperate with a Chelcio T404-BT card running
>under Windows.
>
>In preparation I've code that moves the currently hardcoded values
>(which where module params before) into a per device structure,
>some like 'sdev->options.crc_strict'. With that we only need to
>find a good way to pass these parameters from userspace to the
>device. I guess that should be done somehow via the 'rdma link add'
>command, or via files similar to /proc/sys/net/ipv4/conf/*.
>
yes with dropping the module parameters we lost that flexibility...

I'd prefer protocol specific extensions to the rdma tools.

In fact, we could allow different CRC and MPA settings per
QP (which would make sense if we have connections from a
local siw device to multiple remote devices with different
capabilities etc.). But we do not have endpoint/QP object
specific settings in rdma netlink currently. 
Having link specific settings might be sufficient though.


>Here's my branch with all (partly incomplete) siw changes:
>INVALID URI REMOVED
>Fp-3Dmetze_linux_wip.git-3Ba-3Dshortlog-3Bh-3Drefs_heads_rdma-2Dnext-
>2Dsiw&d=DwIDaQ&c=jf_iaSHvJObTbx-siA1ZOg&r=2TaYXQ0T-r8ZO1PP1alNwU_QJcR
>RLfmYTAgd3QCvqSc&m=bcCk65hNAmUVFgsBxIE9Y6S1cnxdE1otmHllxAlO-Ko&s=Rgu7
>GuEAeI9MyUx7m03KEMLH2qA7Y3065X8LCBo3EBY&e= 
>

Thanks, I'll have a look.

>> First comments:
>> 
>> A non blocking connect does really makes sense as you
>> are pointing out. I hope it doesn't complicate the CM
>> code even further.
>> 
>> I think we agreed upon not using BUG() and BUG_ON(),
>> so please don't introduce it.
>
>Ok.
>
>> 'I hit a lot of bugs' is not very helpful, but just
>> a statement.
>
>More details are in the individual commit messages,
>should I double them in the cover letter next time?
>
>Currently I'm quite busy with other stuff...
>I hope to find some time in the next weeks to
>comment more detailed and post a new revision.
>
>metze
>
Thanks again!
Bernard.


  parent reply	other threads:[~2021-05-28 14:35 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 23:36 [PATCH 00/31] rdma/siw: fix a lot of deadlocks and use after free bugs Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 01/31] rdma/siw: fix warning in siw_proc_send() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 02/31] rdma/siw: call smp_mb() after mem->stag_valid = 0 in siw_invalidate_stag() too Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 03/31] rdma/siw: remove superfluous siw_cep_put() from siw_connect() error path Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 04/31] rdma/siw: let siw_accept() deferr RDMA_MODE until EVENT_ESTABLISHED Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 05/31] rdma/siw: make use of kernel_{bind,connect,listen}() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 06/31] rdma/siw: make siw_cm_upcall() a noop without valid 'id' Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 07/31] rdma/siw: split out a __siw_cep_terminate_upcall() function Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 08/31] rdma/siw: use __siw_cep_terminate_upcall() for indirect SIW_CM_WORK_CLOSE_LLP Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 09/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 10/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 11/31] rdma/siw: introduce SIW_EPSTATE_ACCEPTING/REJECTING for rdma_accept/rdma_reject Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 12/31] rdma/siw: add some debugging of state and sk_state to the teardown process Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 13/31] rdma/siw: handle SIW_EPSTATE_CONNECTING in __siw_cep_terminate_upcall() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 14/31] rdma/siw: let siw_connect() set AWAIT_MPAREP before siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 15/31] rdma/siw: create a temporary copy of private data Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 16/31] rdma/siw: use error and out logic at the end of siw_connect() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 17/31] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 18/31] rdma/siw: call the blocking kernel_bindconnect() just before siw_send_mpareqrep() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 19/31] rdma/siw: split out a __siw_cep_close() function Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 20/31] rdma/siw: implement non-blocking connect Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 21/31] rdma/siw: let siw_listen_address() call siw_cep_alloc() first Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 22/31] rdma/siw: let siw_listen_address() call siw_cep_set_inuse() early Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 23/31] rdma/siw: make use of __siw_cep_close() in siw_accept() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 24/31] rdma/siw: do the full disassociation of cep and qp in siw_qp_llp_close() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 25/31] rdma/siw: fix double siw_cep_put() in siw_cm_work_handler() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 26/31] rdma/siw: make use of __siw_cep_close() " Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 27/31] rdma/siw: fix the "close" logic in siw_qp_cm_drop() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 28/31] rdma/siw: make use of __siw_cep_close() " Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 29/31] rdma/siw: make use of __siw_cep_close() in siw_reject() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 30/31] rdma/siw: make use of __siw_cep_close() in siw_listen_address() Stefan Metzmacher
2021-05-06 23:36 ` [PATCH 31/31] rdma/siw: make use of __siw_cep_close() in siw_drop_listeners() Stefan Metzmacher
2021-05-07 12:08 ` [PATCH 00/31] rdma/siw: fix a lot of deadlocks and use after free bugs Bernard Metzler
2021-05-26 15:43   ` Stefan Metzmacher
2021-05-28 14:35   ` Bernard Metzler [this message]
2021-05-07 12:15 ` [PATCH 01/31] rdma/siw: fix warning in siw_proc_send() Bernard Metzler
2021-05-07 13:52 ` [PATCH 03/31] rdma/siw: remove superfluous siw_cep_put() from siw_connect() error path Bernard Metzler
2021-05-11 11:31 ` [PATCH 02/31] rdma/siw: call smp_mb() after mem->stag_valid = 0 in siw_invalidate_stag() too Bernard Metzler
2021-05-11 11:36 ` [PATCH 05/31] rdma/siw: make use of kernel_{bind,connect,listen}() Bernard Metzler
2021-05-11 11:38 ` [PATCH 04/31] rdma/siw: let siw_accept() deferr RDMA_MODE until EVENT_ESTABLISHED Bernard Metzler
2021-05-11 11:42 ` [PATCH 06/31] rdma/siw: make siw_cm_upcall() a noop without valid 'id' Bernard Metzler
2021-05-11 11:55 ` [PATCH 07/31] rdma/siw: split out a __siw_cep_terminate_upcall() function Bernard Metzler
2021-05-11 11:56 ` [PATCH 08/31] rdma/siw: use __siw_cep_terminate_upcall() for indirect SIW_CM_WORK_CLOSE_LLP Bernard Metzler
2021-05-11 12:00 ` [PATCH 09/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_PEER_CLOSE Bernard Metzler
2021-05-11 12:01 ` [PATCH 10/31] rdma/siw: use __siw_cep_terminate_upcall() for SIW_CM_WORK_MPATIMEOUT Bernard Metzler
2021-05-11 12:03 ` [PATCH 11/31] rdma/siw: introduce SIW_EPSTATE_ACCEPTING/REJECTING for rdma_accept/rdma_reject Bernard Metzler
2021-05-11 12:07 ` [PATCH 12/31] rdma/siw: add some debugging of state and sk_state to the teardown process Bernard Metzler
2021-05-11 12:15 ` [PATCH 15/31] rdma/siw: create a temporary copy of private data Bernard Metzler
2021-05-11 12:18 ` [PATCH 16/31] rdma/siw: use error and out logic at the end of siw_connect() Bernard Metzler
2021-05-11 12:20 ` [PATCH 17/31] rdma/siw: start mpa timer before calling siw_send_mpareqrep() Bernard Metzler
2021-05-11 12:25 ` [PATCH 19/31] rdma/siw: split out a __siw_cep_close() function Bernard Metzler
2021-05-11 12:31 ` [PATCH 20/31] rdma/siw: implement non-blocking connect Bernard Metzler
2021-05-11 12:42 ` [PATCH 22/31] rdma/siw: let siw_listen_address() call siw_cep_set_inuse() early Bernard Metzler
2021-05-11 12:43 ` [PATCH 23/31] rdma/siw: make use of __siw_cep_close() in siw_accept() Bernard Metzler
2021-05-11 12:47 ` [PATCH 24/31] rdma/siw: do the full disassociation of cep and qp in siw_qp_llp_close() Bernard Metzler
2021-05-11 12:58 ` [PATCH 25/31] rdma/siw: fix double siw_cep_put() in siw_cm_work_handler() Bernard Metzler
2021-05-11 13:02 ` [PATCH 27/31] rdma/siw: fix the "close" logic in siw_qp_cm_drop() Bernard Metzler

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=OF3E623A7B.5CEABB75-ON002586E3.004D659D-002586E3.00501E8D@notes.na.collabserv.com \
    --to=bmt@zurich.ibm.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=metze@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.