All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dust Li <dust.li@linux.alibaba.com>
To: "D. Wythe" <alibuda@linux.alibaba.com>,
	kgraul@linux.ibm.com, wenjia@linux.ibm.com, jaka@linux.ibm.com,
	wintera@linux.ibm.com
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net 2/3] net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc
Date: Wed, 1 Nov 2023 16:19:16 +0800	[thread overview]
Message-ID: <20231101081916.GG92403@linux.alibaba.com> (raw)
In-Reply-To: <1698810177-69740-3-git-send-email-alibuda@linux.alibaba.com>

On Wed, Nov 01, 2023 at 11:42:56AM +0800, D. Wythe wrote:
>From: "D. Wythe" <alibuda@linux.alibaba.com>
>
>This patch re-fix the issues memtianed by commit 22a825c541d7

memtianed -> mentioned ?

>("net/smc: fix NULL sndbuf_desc in smc_cdc_tx_handler()").
>
>Blocking sending message do solve the issues though, but it also
>prevents the peer to receive the final message. Besides, in logic,
>whether the sndbuf_desc is NULL or not have no impact on the processing
>of cdc message sending.
>
>Hence that, this patch allow the cdc message sending but to check the
allows

>sndbuf_desc with care in smc_cdc_tx_handler().
>
>Fixes: 22a825c541d7 ("net/smc: fix NULL sndbuf_desc in smc_cdc_tx_handler()")
>Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
>Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>

Reviewed-by: Dust Li <dust.li@linux.alibaba.com>

>---
> net/smc/smc_cdc.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
>diff --git a/net/smc/smc_cdc.c b/net/smc/smc_cdc.c
>index 01bdb79..3c06625 100644
>--- a/net/smc/smc_cdc.c
>+++ b/net/smc/smc_cdc.c
>@@ -28,13 +28,15 @@ static void smc_cdc_tx_handler(struct smc_wr_tx_pend_priv *pnd_snd,
> {
> 	struct smc_cdc_tx_pend *cdcpend = (struct smc_cdc_tx_pend *)pnd_snd;
> 	struct smc_connection *conn = cdcpend->conn;
>+	struct smc_buf_desc *sndbuf_desc;
> 	struct smc_sock *smc;
> 	int diff;
> 
>+	sndbuf_desc = conn->sndbuf_desc;
> 	smc = container_of(conn, struct smc_sock, conn);
> 	bh_lock_sock(&smc->sk);
>-	if (!wc_status) {
>-		diff = smc_curs_diff(cdcpend->conn->sndbuf_desc->len,
>+	if (!wc_status && sndbuf_desc) {
>+		diff = smc_curs_diff(sndbuf_desc->len,
> 				     &cdcpend->conn->tx_curs_fin,
> 				     &cdcpend->cursor);
> 		/* sndbuf_space is decreased in smc_sendmsg */
>@@ -114,9 +116,6 @@ int smc_cdc_msg_send(struct smc_connection *conn,
> 	union smc_host_cursor cfed;
> 	int rc;
> 
>-	if (unlikely(!READ_ONCE(conn->sndbuf_desc)))
>-		return -ENOBUFS;
>-
> 	smc_cdc_add_pending_send(conn, pend);
> 
> 	conn->tx_cdc_seq++;
>-- 
>1.8.3.1

  reply	other threads:[~2023-11-01  8:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01  3:42 [PATCH net 0/3] bugfixs for smc D. Wythe
2023-11-01  3:42 ` [PATCH net 1/3] net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT D. Wythe
2023-11-01  8:13   ` Dust Li
2023-11-01  8:14   ` Dust Li
2023-11-01  3:42 ` [PATCH net 2/3] net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc D. Wythe
2023-11-01  8:19   ` Dust Li [this message]
2023-11-01  8:36     ` D. Wythe
2023-11-01  3:42 ` [PATCH net 3/3] net/smc: put sk reference if close work was canceled D. Wythe

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=20231101081916.GG92403@linux.alibaba.com \
    --to=dust.li@linux.alibaba.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=davem@davemloft.net \
    --cc=jaka@linux.ibm.com \
    --cc=kgraul@linux.ibm.com \
    --cc=kuba@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wenjia@linux.ibm.com \
    --cc=wintera@linux.ibm.com \
    /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.