linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mahanta Jambigi <mjambigi@linux.ibm.com>
To: Halil Pasic <pasic@linux.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	"D. Wythe" <alibuda@linux.alibaba.com>,
	Dust Li <dust.li@linux.alibaba.com>,
	Sidraya Jayagond <sidraya@linux.ibm.com>,
	Wenjia Zhang <wenjia@linux.ibm.com>,
	Tony Lu <tonylu@linux.alibaba.com>,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-s390@vger.kernel.org
Cc: Wen Gu <guwen@linux.alibaba.com>,
	Guangguan Wang <guangguan.wang@linux.alibaba.com>,
	Bagas Sanjaya <bagasdotme@gmail.com>
Subject: Re: [PATCH net-next v6 2/2] net/smc: handle -ENOMEM from smc_wr_alloc_link_mem gracefully
Date: Tue, 28 Oct 2025 15:04:04 +0530	[thread overview]
Message-ID: <c1c8f18f-a74e-40c1-8090-985d31cabd1b@linux.ibm.com> (raw)
In-Reply-To: <20251027224856.2970019-3-pasic@linux.ibm.com>



On 28/10/25 4:18 am, Halil Pasic wrote:
> Currently if a -ENOMEM from smc_wr_alloc_link_mem() is handled by
> giving up and going the way of a TCP fallback. This was reasonable
> before the sizes of the allocations there were compile time constants
> and reasonably small. But now those are actually configurable.
> 
> So instead of giving up, keep retrying with half of the requested size
> unless we dip below the old static sizes -- then give up! In terms of
> numbers that means we give up when it is certain that we at best would
> end up allocating less than 16 send WR buffers or less than 48 recv WR
> buffers. This is to avoid regressions due to having fewer buffers
> compared the static values of the past.
> 
> Please note that SMC-R is supposed to be an optimisation over TCP, and
> falling back to TCP is superior to establishing an SMC connection that
> is going to perform worse. If the memory allocation fails (and we
> propagate -ENOMEM), we fall back to TCP.
> 
> Preserve (modulo truncation) the ratio of send/recv WR buffer counts.
> 
> Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
> Reviewed-by: Wenjia Zhang <wenjia@linux.ibm.com>
> Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
> Reviewed-by: Sidraya Jayagond <sidraya@linux.ibm.com>
> Reviewed-by: Dust Li <dust.li@linux.alibaba.com>


Tested-by: Mahanta Jambigi <mjambigi@linux.ibm.com>


  reply	other threads:[~2025-10-28  9:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 22:48 [PATCH net-next v6 0/2] net/smc: make wr buffer count configurable Halil Pasic
2025-10-27 22:48 ` [PATCH net-next v6 1/2] " Halil Pasic
2025-10-28  9:33   ` Mahanta Jambigi
2025-10-27 22:48 ` [PATCH net-next v6 2/2] net/smc: handle -ENOMEM from smc_wr_alloc_link_mem gracefully Halil Pasic
2025-10-28  9:34   ` Mahanta Jambigi [this message]
2025-10-30 12:40 ` [PATCH net-next v6 0/2] net/smc: make wr buffer count configurable patchwork-bot+netdevbpf

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=c1c8f18f-a74e-40c1-8090-985d31cabd1b@linux.ibm.com \
    --to=mjambigi@linux.ibm.com \
    --cc=alibuda@linux.alibaba.com \
    --cc=bagasdotme@gmail.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dust.li@linux.alibaba.com \
    --cc=edumazet@google.com \
    --cc=guangguan.wang@linux.alibaba.com \
    --cc=guwen@linux.alibaba.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pasic@linux.ibm.com \
    --cc=sidraya@linux.ibm.com \
    --cc=tonylu@linux.alibaba.com \
    --cc=wenjia@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).