On 28.11.26 16:05, Bryam Vargas via B4 Relay wrote:
> From: Bryam Vargas <hexl…@proton.me>
>
> With DMB nocopy (the dibs loopback device) the peer writes into the RMB
> through its own attachment, and it can attach late. smc_buf_unuse() puts
> the DMB back in the link group's pool with its token still registered
> while the old peer can still write to it: the next connection that takes
> it gets the old peer's CDCs, and a peer that attaches after the other
> end gave up lands in another connection's DMB.
>
I think the same concept applies when the smcd device does not support
nocopy (ISM devices). When the dmb is in link group's unused pool, while
it is still registered with the dibs device, the peer can write into the
dmb.
> Unregister a nocopy DMB when the connection ends instead of pooling it:
> the next connection gets a new DMB and token, a peer still attached
> keeps the old one until it detaches, and a later attach fails. When the
> link group is off its list smc_conn_free() skips smc_buf_unuse() and the
> link group's free unregisters the DMB: clear conn->rmb_desc there, or a
> retried connect() that cannot allocate its RMB unlinks and frees the
> stale descriptor. Devices without nocopy keep their pool.
>
This idea seems to defeat the whole concept of a reuse pool. If that is
necessary, you may as well remove the whole pool concept for SMC-D (not
sure about SMC-R).
Isn't there some mechanism in SMC that makes sure old date can never be
read in a re-used dmb?
I don't understand all the observed issues in v3 0/2, but maybe some of
them can be solved in __smc_buf_create() instead of smc_buf_unuse() ?
Some of the issues (link group fee or link group terminate) may allpy to
loopback only.
Would it make sense to postpone 2/2 and proceed with 1/2?
smc maintainers please chime in, maybe I misunderstood something here.
> Fixes: ae2be35cbed2 ("net/smc: {at|de}tach sndbuf to peer DMB if supported")
> Cc: stab…@vger.kernel.org
> Signed-off-by: Bryam Vargas <hexl…@proton.me>
> ---