[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240416110538.GK2320920@kernel.org>
Date: Tue, 16 Apr 2024 12:05:38 +0100
From: Simon Horman <horms@...nel.org>
To: Wen Gu <guwen@...ux.alibaba.com>
Cc: wintera@...ux.ibm.com, twinkler@...ux.ibm.com, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
wenjia@...ux.ibm.com, jaka@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, alibuda@...ux.alibaba.com,
tonylu@...ux.alibaba.com, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v6 10/11] net/smc: adapt cursor update when
sndbuf and peer DMB are merged
On Sun, Apr 14, 2024 at 12:03:03PM +0800, Wen Gu wrote:
> If the local sndbuf shares the same physical memory with peer DMB,
> the cursor update processing needs to be adapted to ensure that the
> data to be consumed won't be overwritten.
>
> So in this case, the fin_curs and sndbuf_space that were originally
> updated after sending the CDC message should be modified to not be
> update until the peer updates cons_curs.
>
> Signed-off-by: Wen Gu <guwen@...ux.alibaba.com>
...
> @@ -255,6 +256,14 @@ int smcd_cdc_msg_send(struct smc_connection *conn)
> return rc;
> smc_curs_copy(&conn->rx_curs_confirmed, &curs, conn);
> conn->local_rx_ctrl.prod_flags.cons_curs_upd_req = 0;
> +
> + if (smc_ism_support_dmb_nocopy(conn->lgr->smcd))
> + /* if local sndbuf shares the same memory region with
> + * peer DMB, then don't update the tx_curs_fin
> + * and sndbuf_space until peer has consumed the data.
> + */
> + return rc;
Hi Wen Gu,
A minor nit from my side:
To my mind "return rc" implies returning an error value.
But here rc is 0, which based on the comment seems correct.
So perhaps it would be clearer to simply return 0.
Flagged by Smatch.
> +
> /* Calculate transmitted data and increment free send buffer space */
> diff = smc_curs_diff(conn->sndbuf_desc->len, &conn->tx_curs_fin,
> &conn->tx_curs_sent);
...
Powered by blists - more mailing lists