From: Ursula Braun <ubraun@linux.ibm.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
raspl@linux.ibm.com, hwippel@linux.ibm.com, sebott@linux.ibm.com,
ubraun@linux.ibm.com
Subject: [PATCH net-next 03/10] net/smc: optimize consumer cursor updates
Date: Thu, 28 Jun 2018 19:05:06 +0200 [thread overview]
Message-ID: <20180628170513.5089-4-ubraun@linux.ibm.com> (raw)
In-Reply-To: <20180628170513.5089-1-ubraun@linux.ibm.com>
From: Ursula Braun <ursula.braun@de.ibm.com>
The SMC protocol requires to send a separate consumer cursor update,
if it cannot be piggybacked to updates of the producer cursor.
Currently the decision to send a separate consumer cursor update
just considers the amount of data already received by the socket
program. It does not consider the amount of data already arrived, but
not yet consumed by the receiver. Basing the decision on the
difference between already confirmed and already arrived data
(instead of difference between already confirmed and already consumed
data), may lead to a somewhat earlier consumer cursor update send in
fast unidirectional traffic scenarios, and thus to better throughput.
Signed-off-by: Ursula Braun <ubraun@linux.ibm.com>
Suggested-by: Thomas Richter <tmricht@linux.ibm.com>
---
net/smc/smc_tx.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/net/smc/smc_tx.c b/net/smc/smc_tx.c
index cee666400752..f82886b7d1d8 100644
--- a/net/smc/smc_tx.c
+++ b/net/smc/smc_tx.c
@@ -495,7 +495,8 @@ void smc_tx_work(struct work_struct *work)
void smc_tx_consumer_update(struct smc_connection *conn, bool force)
{
- union smc_host_cursor cfed, cons;
+ union smc_host_cursor cfed, cons, prod;
+ int sender_free = conn->rmb_desc->len;
int to_confirm;
smc_curs_write(&cons,
@@ -505,11 +506,18 @@ void smc_tx_consumer_update(struct smc_connection *conn, bool force)
smc_curs_read(&conn->rx_curs_confirmed, conn),
conn);
to_confirm = smc_curs_diff(conn->rmb_desc->len, &cfed, &cons);
+ if (to_confirm > conn->rmbe_update_limit) {
+ smc_curs_write(&prod,
+ smc_curs_read(&conn->local_rx_ctrl.prod, conn),
+ conn);
+ sender_free = conn->rmb_desc->len -
+ smc_curs_diff(conn->rmb_desc->len, &prod, &cfed);
+ }
if (conn->local_rx_ctrl.prod_flags.cons_curs_upd_req ||
force ||
((to_confirm > conn->rmbe_update_limit) &&
- ((to_confirm > (conn->rmb_desc->len / 2)) ||
+ ((sender_free <= (conn->rmb_desc->len / 2)) ||
conn->local_rx_ctrl.prod_flags.write_blocked))) {
if ((smc_cdc_get_slot_and_msg_send(conn) < 0) &&
conn->alert_token_local) { /* connection healthy */
--
2.16.4
next prev parent reply other threads:[~2018-06-28 17:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 17:05 [PATCH net-next 00/10] pnetid and SMC-D support Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 01/10] net/smc: determine port attributes independent from pnet table Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 02/10] net/smc: add pnetid support Ursula Braun
2018-06-28 17:05 ` Ursula Braun [this message]
2018-06-28 17:05 ` [PATCH net-next 04/10] net/smc: add base infrastructure for SMC-D and ISM Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 05/10] net/smc: add pnetid support " Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 06/10] net/smc: add SMC-D support in CLC messages Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 07/10] net/smc: add SMC-D support in data transfer Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 08/10] net/smc: add SMC-D support in af_smc Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 09/10] net/smc: add SMC-D diag support Ursula Braun
2018-06-28 17:05 ` [PATCH net-next 10/10] s390/ism: add device driver for internal shared memory Ursula Braun
2018-06-30 11:46 ` [PATCH net-next 00/10] pnetid and SMC-D support David Miller
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=20180628170513.5089-4-ubraun@linux.ibm.com \
--to=ubraun@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=heiko.carstens@de.ibm.com \
--cc=hwippel@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raspl@linux.ibm.com \
--cc=schwidefsky@de.ibm.com \
--cc=sebott@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