From: Andy Grover <andy.grover@oracle.com>
To: netdev@vger.kernel.org
Cc: rds-devel@oss.oracle.com
Subject: [PATCH 05/13] RDS: Fix congestion issues for loopback
Date: Thu, 11 Mar 2010 15:49:59 -0800 [thread overview]
Message-ID: <1268351407-7394-6-git-send-email-andy.grover@oracle.com> (raw)
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
We have two kinds of loopback: software (via loop transport)
and hardware (via IB). sw is used for 127.0.0.1, and doesn't
support rdma ops. hw is used for sends to local device IPs,
and supports rdma. Both are used in different cases.
For both of these, when there is a congestion map update, we
want to call rds_cong_map_updated() but not actually send
anything -- since loopback local and foreign congestion maps
point to the same spot, they're already in sync.
The old code never called sw loop's xmit_cong_map(),so
rds_cong_map_updated() wasn't being called for it. sw loop
ports would not work right with the congestion monitor.
Fixing that meant that hw loopback now would send congestion maps
to itself. This is also undesirable (racy), so we check for this
case in the ib-specific xmit code.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/cong.c | 2 --
net/rds/ib_send.c | 7 +++++++
net/rds/loop.c | 7 -------
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/net/rds/cong.c b/net/rds/cong.c
index 6d06cac..dd2711d 100644
--- a/net/rds/cong.c
+++ b/net/rds/cong.c
@@ -218,8 +218,6 @@ void rds_cong_queue_updates(struct rds_cong_map *map)
spin_lock_irqsave(&rds_cong_lock, flags);
list_for_each_entry(conn, &map->m_conn_list, c_map_item) {
- if (conn->c_loopback)
- continue;
if (!test_and_set_bit(0, &conn->c_map_queued)) {
rds_stats_inc(s_cong_update_queued);
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index f380c3f..c18228a 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -482,6 +482,13 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
BUG_ON(off % RDS_FRAG_SIZE);
BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));
+ /* Do not send cong updates to IB loopback */
+ if (conn->c_loopback
+ && rm->m_inc.i_hdr.h_flags & RDS_FLAG_CONG_BITMAP) {
+ rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
+ return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
+ }
+
/* FIXME we may overallocate here */
if (be32_to_cpu(rm->m_inc.i_hdr.h_len) == 0)
i = 1;
diff --git a/net/rds/loop.c b/net/rds/loop.c
index 4a61997..93a45f1 100644
--- a/net/rds/loop.c
+++ b/net/rds/loop.c
@@ -80,16 +80,9 @@ static int rds_loop_xmit_cong_map(struct rds_connection *conn,
struct rds_cong_map *map,
unsigned long offset)
{
- unsigned long i;
-
BUG_ON(offset);
BUG_ON(map != conn->c_lcong);
- for (i = 0; i < RDS_CONG_MAP_PAGES; i++) {
- memcpy((void *)conn->c_fcong->m_page_addrs[i],
- (void *)map->m_page_addrs[i], PAGE_SIZE);
- }
-
rds_cong_map_updated(conn->c_fcong, ~(u64) 0);
return sizeof(struct rds_header) + RDS_CONG_MAP_BYTES;
--
1.6.3.3
next prev parent reply other threads:[~2010-03-11 23:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-11 23:49 [PATCH net-next 00/13] RDS bugfixes and cleanups Andy Grover
2010-03-11 23:49 ` [PATCH 01/13] RDS: Do not BUG() on error returned from ib_post_send Andy Grover
2010-03-11 23:49 ` [PATCH 02/13] RDS: sendmsg() should check sndtimeo, not rcvtimeo Andy Grover
2010-03-11 23:49 ` [PATCH 03/13] RDS: update copy_to_user state in tcp transport Andy Grover
2010-03-11 23:49 ` [PATCH 04/13] RDS/TCP: Wait to wake thread when write space available Andy Grover
2010-03-11 23:49 ` Andy Grover [this message]
2010-03-11 23:50 ` [PATCH 06/13] RDS: Fix send locking issue Andy Grover
2010-03-11 23:50 ` [PATCH 07/13] RDS: Workaround for in-use MRs on close causing crash Andy Grover
2010-03-11 23:50 ` [PATCH 08/13] RDS: Turn down alarming reconnect messages Andy Grover
2010-03-11 23:50 ` [PATCH 09/13] RDS: Fix locking in rds_send_drop_to() Andy Grover
2010-03-11 23:50 ` [PATCH 10/13] RDS: only put sockets that have seen congestion on the poll_waitq Andy Grover
2010-03-11 23:50 ` [PATCH 11/13] RDS: Properly unmap when getting a remote access error Andy Grover
2010-03-11 23:50 ` [PATCH 12/13] RDS: Do not call set_page_dirty() with irqs off Andy Grover
2010-03-11 23:50 ` [PATCH 13/13] RDS: Enable per-cpu workqueue threads Andy Grover
2010-03-17 4:18 ` [PATCH net-next 00/13] RDS bugfixes and cleanups 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=1268351407-7394-6-git-send-email-andy.grover@oracle.com \
--to=andy.grover@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=rds-devel@oss.oracle.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).