* [PATCH net-next 00/13] RDS bugfixes and cleanups
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
Hi Dave,
These patches are against net-next, please apply.
Thanks -- Andy
^ permalink raw reply
* [PATCH 09/13] RDS: Fix locking in rds_send_drop_to()
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel, Tina Yang
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
From: Tina Yang <tina.yang@oracle.com>
It seems rds_send_drop_to() called
__rds_rdma_send_complete(rs, rm, RDS_RDMA_CANCELED)
with only rds_sock lock, but not rds_message lock. It raced with
other threads that is attempting to modify the rds_message as well,
such as from within rds_rdma_send_complete().
Signed-off-by: Tina Yang <tina.yang@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/send.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index 1a2ef24..192a480 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -632,9 +632,6 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
list_move(&rm->m_sock_item, &list);
rds_send_sndbuf_remove(rs, rm);
clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags);
-
- /* If this is a RDMA operation, notify the app. */
- __rds_rdma_send_complete(rs, rm, RDS_RDMA_CANCELED);
}
/* order flag updates with the rs lock */
@@ -643,9 +640,6 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
spin_unlock_irqrestore(&rs->rs_lock, flags);
- if (wake)
- rds_wake_sk_sleep(rs);
-
conn = NULL;
/* now remove the messages from the conn list as needed */
@@ -653,6 +647,10 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
/* We do this here rather than in the loop above, so that
* we don't have to nest m_rs_lock under rs->rs_lock */
spin_lock_irqsave(&rm->m_rs_lock, flags2);
+ /* If this is a RDMA operation, notify the app. */
+ spin_lock(&rs->rs_lock);
+ __rds_rdma_send_complete(rs, rm, RDS_RDMA_CANCELED);
+ spin_unlock(&rs->rs_lock);
rm->m_rs = NULL;
spin_unlock_irqrestore(&rm->m_rs_lock, flags2);
@@ -681,6 +679,9 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest)
if (conn)
spin_unlock_irqrestore(&conn->c_lock, flags);
+ if (wake)
+ rds_wake_sk_sleep(rs);
+
while (!list_empty(&list)) {
rm = list_entry(list.next, struct rds_message, m_sock_item);
list_del_init(&rm->m_sock_item);
--
1.6.3.3
^ permalink raw reply related
* [PATCH 05/13] RDS: Fix congestion issues for loopback
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
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
^ permalink raw reply related
* [PATCH 02/13] RDS: sendmsg() should check sndtimeo, not rcvtimeo
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
Most likely cut n paste error - sendmsg() was checking sock_rcvtimeo.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/send.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index b2fccfc..ad2e469 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -815,7 +815,7 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
int ret = 0;
int queued = 0, allocated_mr = 0;
int nonblock = msg->msg_flags & MSG_DONTWAIT;
- long timeo = sock_rcvtimeo(sk, nonblock);
+ long timeo = sock_sndtimeo(sk, nonblock);
/* Mirror Linux UDP mirror of BSD error message compatibility */
/* XXX: Perhaps MSG_MORE someday */
--
1.6.3.3
^ permalink raw reply related
* [PATCH 04/13] RDS/TCP: Wait to wake thread when write space available
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
Instead of waking the send thread whenever any send space is available,
wait until it is at least half empty. This is modeled on how
sock_def_write_space() does it, and may help to minimize context
switches.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/tcp_send.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/net/rds/tcp_send.c b/net/rds/tcp_send.c
index 34fdcc0..a28b895 100644
--- a/net/rds/tcp_send.c
+++ b/net/rds/tcp_send.c
@@ -240,7 +240,9 @@ void rds_tcp_write_space(struct sock *sk)
tc->t_last_seen_una = rds_tcp_snd_una(tc);
rds_send_drop_acked(conn, rds_tcp_snd_una(tc), rds_tcp_is_acked);
- queue_delayed_work(rds_wq, &conn->c_send_w, 0);
+ if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf)
+ queue_delayed_work(rds_wq, &conn->c_send_w, 0);
+
out:
read_unlock(&sk->sk_callback_lock);
--
1.6.3.3
^ permalink raw reply related
* [PATCH 03/13] RDS: update copy_to_user state in tcp transport
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
Other transports use rds_page_copy_user, which updates our
s_copy_to_user counter. TCP doesn't, so it needs to explicity
call rds_stats_add().
Reported-by: Richard Frank <richard.frank@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/tcp_recv.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/rds/tcp_recv.c b/net/rds/tcp_recv.c
index c00daff..40bfcf8 100644
--- a/net/rds/tcp_recv.c
+++ b/net/rds/tcp_recv.c
@@ -97,6 +97,7 @@ int rds_tcp_inc_copy_to_user(struct rds_incoming *inc, struct iovec *first_iov,
goto out;
}
+ rds_stats_add(s_copy_to_user, to_copy);
size -= to_copy;
ret += to_copy;
skb_off += to_copy;
--
1.6.3.3
^ permalink raw reply related
* [PATCH 07/13] RDS: Workaround for in-use MRs on close causing crash
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
if a machine is shut down without closing sockets properly, and
freeing all MRs, then a BUG_ON will bring it down. This patch
changes these to WARN_ONs -- leaking MRs is not fatal (although
not ideal, and there is more work to do here for a proper fix.)
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/ib_rdma.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c
index 4b0da86..65e668d 100644
--- a/net/rds/ib_rdma.c
+++ b/net/rds/ib_rdma.c
@@ -234,8 +234,8 @@ void rds_ib_destroy_mr_pool(struct rds_ib_mr_pool *pool)
{
flush_workqueue(rds_wq);
rds_ib_flush_mr_pool(pool, 1);
- BUG_ON(atomic_read(&pool->item_count));
- BUG_ON(atomic_read(&pool->free_pinned));
+ WARN_ON(atomic_read(&pool->item_count));
+ WARN_ON(atomic_read(&pool->free_pinned));
kfree(pool);
}
--
1.6.3.3
^ permalink raw reply related
* [PATCH 08/13] RDS: Turn down alarming reconnect messages
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
RDS's error messages when a connection goes down are a little
extreme. A connection may go down, and it will be re-established,
and everything is fine. This patch links these messages through
rdsdebug(), instead of to printk directly.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/ib_cm.c | 3 ++-
net/rds/iw_cm.c | 4 +++-
net/rds/rdma_transport.c | 2 +-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c
index 647cb8f..e1f124b 100644
--- a/net/rds/ib_cm.c
+++ b/net/rds/ib_cm.c
@@ -203,9 +203,10 @@ static void rds_ib_qp_event_handler(struct ib_event *event, void *data)
rdma_notify(ic->i_cm_id, IB_EVENT_COMM_EST);
break;
default:
- rds_ib_conn_error(conn, "RDS/IB: Fatal QP Event %u "
+ rdsdebug("Fatal QP Event %u "
"- connection %pI4->%pI4, reconnecting\n",
event->event, &conn->c_laddr, &conn->c_faddr);
+ rds_conn_drop(conn);
break;
}
}
diff --git a/net/rds/iw_cm.c b/net/rds/iw_cm.c
index 394cf6b..6bc638f 100644
--- a/net/rds/iw_cm.c
+++ b/net/rds/iw_cm.c
@@ -156,9 +156,11 @@ static void rds_iw_qp_event_handler(struct ib_event *event, void *data)
case IB_EVENT_QP_REQ_ERR:
case IB_EVENT_QP_FATAL:
default:
- rds_iw_conn_error(conn, "RDS/IW: Fatal QP Event %u - connection %pI4->%pI4...reconnecting\n",
+ rdsdebug("Fatal QP Event %u "
+ "- connection %pI4->%pI4, reconnecting\n",
event->event, &conn->c_laddr,
&conn->c_faddr);
+ rds_conn_drop(conn);
break;
}
}
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 31f9c72..5ea82fc 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -101,7 +101,7 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
break;
case RDMA_CM_EVENT_DISCONNECTED:
- printk(KERN_WARNING "RDS/RDMA: DISCONNECT event - dropping connection "
+ rdsdebug("DISCONNECT event - dropping connection "
"%pI4->%pI4\n", &conn->c_laddr,
&conn->c_faddr);
rds_conn_drop(conn);
--
1.6.3.3
^ permalink raw reply related
* [PATCH 11/13] RDS: Properly unmap when getting a remote access error
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel, Sherman Pun
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
From: Sherman Pun <sherman.pun@sun.com>
If the RDMA op has aborted with a remote access error,
in addition to what we already do (tell userspace it has
completed with an error) also unmap it and put() the rm.
Otherwise, hangs may occur on arches that track maps and
will not exit without proper cleanup.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/ib_send.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index c18228a..17fa808 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -243,8 +243,12 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
struct rds_message *rm;
rm = rds_send_get_message(conn, send->s_op);
- if (rm)
+ if (rm) {
+ if (rm->m_rdma_op)
+ rds_ib_send_unmap_rdma(ic, rm->m_rdma_op);
rds_ib_send_rdma_complete(rm, wc.status);
+ rds_message_put(rm);
+ }
}
oldest = (oldest + 1) % ic->i_send_ring.w_nr;
--
1.6.3.3
^ permalink raw reply related
* [PATCH 01/13] RDS: Do not BUG() on error returned from ib_post_send
From: Andy Grover @ 2010-03-11 23:49 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
BUGging on a runtime error code should be avoided. This
patch also eliminates all other BUG()s that have no real
reason to exist.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/ib_recv.c | 4 ++--
net/rds/ib_send.c | 7 +++----
net/rds/iw_recv.c | 4 ++--
net/rds/iw_send.c | 3 +--
net/rds/rdma_transport.c | 3 +--
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 04dc0d3..c338881 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -468,8 +468,8 @@ static void rds_ib_send_ack(struct rds_ib_connection *ic, unsigned int adv_credi
set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
rds_ib_stats_inc(s_ib_ack_send_failure);
- /* Need to finesse this later. */
- BUG();
+
+ rds_ib_conn_error(ic->conn, "sending ack failed\n");
} else
rds_ib_stats_inc(s_ib_ack_sent);
}
diff --git a/net/rds/ib_send.c b/net/rds/ib_send.c
index a10fab6..f380c3f 100644
--- a/net/rds/ib_send.c
+++ b/net/rds/ib_send.c
@@ -574,8 +574,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
rds_ib_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
adv_credits += posted;
BUG_ON(adv_credits > 255);
- } else if (ic->i_rm != rm)
- BUG();
+ }
send = &ic->i_sends[pos];
first = send;
@@ -714,8 +713,8 @@ add_header:
ic->i_rm = prev->s_rm;
prev->s_rm = NULL;
}
- /* Finesse this later */
- BUG();
+
+ rds_ib_conn_error(ic->conn, "ib_post_send failed\n");
goto out;
}
diff --git a/net/rds/iw_recv.c b/net/rds/iw_recv.c
index 54af7d6..337e4e5 100644
--- a/net/rds/iw_recv.c
+++ b/net/rds/iw_recv.c
@@ -468,8 +468,8 @@ static void rds_iw_send_ack(struct rds_iw_connection *ic, unsigned int adv_credi
set_bit(IB_ACK_REQUESTED, &ic->i_ack_flags);
rds_iw_stats_inc(s_iw_ack_send_failure);
- /* Need to finesse this later. */
- BUG();
+
+ rds_iw_conn_error(ic->conn, "sending ack failed\n");
} else
rds_iw_stats_inc(s_iw_ack_sent);
}
diff --git a/net/rds/iw_send.c b/net/rds/iw_send.c
index 1379e9d..52182ff 100644
--- a/net/rds/iw_send.c
+++ b/net/rds/iw_send.c
@@ -616,8 +616,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
rds_iw_send_grab_credits(ic, 0, &posted, 1, RDS_MAX_ADV_CREDIT - adv_credits);
adv_credits += posted;
BUG_ON(adv_credits > 255);
- } else if (ic->i_rm != rm)
- BUG();
+ }
send = &ic->i_sends[pos];
first = send;
diff --git a/net/rds/rdma_transport.c b/net/rds/rdma_transport.c
index 9ece910..31f9c72 100644
--- a/net/rds/rdma_transport.c
+++ b/net/rds/rdma_transport.c
@@ -109,8 +109,7 @@ int rds_rdma_cm_event_handler(struct rdma_cm_id *cm_id,
default:
/* things like device disconnect? */
- printk(KERN_ERR "unknown event %u\n", event->event);
- BUG();
+ printk(KERN_ERR "RDS: unknown event %u!\n", event->event);
break;
}
--
1.6.3.3
^ permalink raw reply related
* [PATCH 06/13] RDS: Fix send locking issue
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel, Tina Yang
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
From: Tina Yang <Tina.Yang@oracle.com>
Fix a deadlock between rds_rdma_send_complete() and
rds_send_remove_from_sock() when rds socket lock and
rds message lock are acquired out-of-order.
Signed-off-by: Tina Yang <Tina.Yang@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/send.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/rds/send.c b/net/rds/send.c
index ad2e469..1a2ef24 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -533,14 +533,13 @@ void rds_send_remove_from_sock(struct list_head *messages, int status)
if (rs != rm->m_rs) {
if (rs) {
- spin_unlock(&rs->rs_lock);
rds_wake_sk_sleep(rs);
sock_put(rds_rs_to_sk(rs));
}
rs = rm->m_rs;
- spin_lock(&rs->rs_lock);
sock_hold(rds_rs_to_sk(rs));
}
+ spin_lock(&rs->rs_lock);
if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) {
struct rds_rdma_op *ro = rm->m_rdma_op;
@@ -560,6 +559,7 @@ void rds_send_remove_from_sock(struct list_head *messages, int status)
rds_message_put(rm);
rm->m_rs = NULL;
}
+ spin_unlock(&rs->rs_lock);
unlock_and_drop:
spin_unlock(&rm->m_rs_lock);
@@ -567,7 +567,6 @@ unlock_and_drop:
}
if (rs) {
- spin_unlock(&rs->rs_lock);
rds_wake_sk_sleep(rs);
sock_put(rds_rs_to_sk(rs));
}
--
1.6.3.3
^ permalink raw reply related
* [PATCH 10/13] RDS: only put sockets that have seen congestion on the poll_waitq
From: Andy Grover @ 2010-03-11 23:50 UTC (permalink / raw)
To: netdev; +Cc: rds-devel
In-Reply-To: <1268351407-7394-1-git-send-email-andy.grover@oracle.com>
rds_poll_waitq's listeners will be awoken if we receive a congestion
notification. Bad performance may result because *all* polled sockets
contend for this single lock. However, it should not be necessary to
wake pollers when a congestion update arrives if they have never
experienced congestion, and not putting these on the waitq will
hopefully greatly reduce contention.
Signed-off-by: Andy Grover <andy.grover@oracle.com>
---
net/rds/af_rds.c | 7 ++++++-
net/rds/rds.h | 2 ++
net/rds/send.c | 4 +++-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index 853c52b..937ecda 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -159,7 +159,8 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
poll_wait(file, sk->sk_sleep, wait);
- poll_wait(file, &rds_poll_waitq, wait);
+ if (rs->rs_seen_congestion)
+ poll_wait(file, &rds_poll_waitq, wait);
read_lock_irqsave(&rs->rs_recv_lock, flags);
if (!rs->rs_cong_monitor) {
@@ -181,6 +182,10 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
mask |= (POLLOUT | POLLWRNORM);
read_unlock_irqrestore(&rs->rs_recv_lock, flags);
+ /* clear state any time we wake a seen-congested socket */
+ if (mask)
+ rs->rs_seen_congestion = 0;
+
return mask;
}
diff --git a/net/rds/rds.h b/net/rds/rds.h
index 85d6f89..4bec6e2 100644
--- a/net/rds/rds.h
+++ b/net/rds/rds.h
@@ -388,6 +388,8 @@ struct rds_sock {
/* flag indicating we were congested or not */
int rs_congested;
+ /* seen congestion (ENOBUFS) when sending? */
+ int rs_seen_congestion;
/* rs_lock protects all these adjacent members before the newline */
spinlock_t rs_lock;
diff --git a/net/rds/send.c b/net/rds/send.c
index 192a480..51e2def 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -894,8 +894,10 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
queue_delayed_work(rds_wq, &conn->c_conn_w, 0);
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
- if (ret)
+ if (ret) {
+ rs->rs_seen_congestion = 1;
goto out;
+ }
while (!rds_send_queue_rm(rs, conn, rm, rs->rs_bound_port,
dport, &queued)) {
--
1.6.3.3
^ permalink raw reply related
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Stephen Hemminger @ 2010-03-11 23:44 UTC (permalink / raw)
To: David Miller; +Cc: jengelh, netdev
In-Reply-To: <20100311.151529.16498686.davem@davemloft.net>
On Thu, 11 Mar 2010 15:15:29 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Thu, 11 Mar 2010 15:10:50 -0800
>
> > But if non utilities will already adapt to new/old kernel, so
> > just don't put out 64 bit values if the platform is 32 bit.
> > When/if 32 bit platforms support it, great add the extra stats.
>
> How about we just make userland ready for it and:
>
> 1) Emitting it now will get it tested even on 32-bit
>
> 2) They'll be ready when the drivers can keep track of
> 64-bit stats too.
>
> Stephen I've heard your side of the story, I just don't
> agree with it :-)
I'm okay with it. just raising the issue.
--
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: David Miller @ 2010-03-11 23:15 UTC (permalink / raw)
To: shemminger; +Cc: jengelh, netdev
In-Reply-To: <20100311151050.31f8ad5d@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 11 Mar 2010 15:10:50 -0800
> But if non utilities will already adapt to new/old kernel, so
> just don't put out 64 bit values if the platform is 32 bit.
> When/if 32 bit platforms support it, great add the extra stats.
How about we just make userland ready for it and:
1) Emitting it now will get it tested even on 32-bit
2) They'll be ready when the drivers can keep track of
64-bit stats too.
Stephen I've heard your side of the story, I just don't
agree with it :-)
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Stephen Hemminger @ 2010-03-11 23:10 UTC (permalink / raw)
To: David Miller; +Cc: jengelh, netdev
In-Reply-To: <20100311.145412.118613343.davem@davemloft.net>
On Thu, 11 Mar 2010 14:54:12 -0800 (PST)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@vyatta.com>
> Date: Thu, 11 Mar 2010 14:50:59 -0800
>
> > But if you send 32bit truncated values when 64 bit is expected
> > then users are going to complain
>
> They already complain, a lot.
>
> This isn't going to change the situation at all, and
> I agree with Jan that consistency is the trumping factor
> here.
But if non utilities will already adapt to new/old kernel, so
just don't put out 64 bit values if the platform is 32 bit.
When/if 32 bit platforms support it, great add the extra stats.
--
^ permalink raw reply
* Re: [PATCH] net: davinci emac: use dma_{map, unmap}_single API for cache coherency
From: Kevin Hilman @ 2010-03-11 22:56 UTC (permalink / raw)
To: Sekhar Nori
Cc: srk-l0cyMroinI0, netdev-u79uwXL29TY76Z2rM5mHXA,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/
In-Reply-To: <1268133637-23399-1-git-send-email-nsekhar-l0cyMroinI0@public.gmane.org>
Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> writes:
> The davinci emac driver uses some ARM specific DMA APIs
> for cache coherency which have been removed from kernel
> with the 2.6.34 merge.
>
> Modify the driver to use the dma_{map, unmap}_single() APIs
> defined in dma-mapping.h
>
> Without this fix, the driver fails to compile on Linus's
> tree.
>
> Tested on DM365 and OMAP-L138 EVMs.
>
> Signed-off-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
Acked-by: Kevin Hilman <khilman-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org>
Verified that this is compiling/running again with v2.6.34-rc1.
Kevin
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: David Miller @ 2010-03-11 22:54 UTC (permalink / raw)
To: shemminger; +Cc: jengelh, netdev
In-Reply-To: <20100311145059.1a020e1c@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 11 Mar 2010 14:50:59 -0800
> But if you send 32bit truncated values when 64 bit is expected
> then users are going to complain
They already complain, a lot.
This isn't going to change the situation at all, and
I agree with Jan that consistency is the trumping factor
here.
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Stephen Hemminger @ 2010-03-11 22:50 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: David Miller, netdev
In-Reply-To: <alpine.LSU.2.01.1003112305060.11569@obet.zrqbmnf.qr>
On Thu, 11 Mar 2010 23:13:18 +0100 (CET)
Jan Engelhardt <jengelh@medozas.de> wrote:
> On Thursday 2010-03-11 23:04, Stephen Hemminger wrote:
> >> >> `ip -s link` shows interface counters truncated to 32 bit. This is
> >> >> because interface statistics are transported only in 32-bit quantity
> >> >> to userspace. This commit adds a new IFLA_STATS64 attribute that
> >> >> exports them in full 64 bit.
> >>
> >> On 64-bit it has 64-bit counters, yet we only report 32-bit
> >> counters to userspace via netlink even in that case.
> >
> >That make sense, but maybe we shouldn't send IFLA_STATS64 on
> >32bit platforms.
>
> Somehow I'd prefer to have consistency. Platform-specific
> actions and/or payload I think we already were plagued enough by
> syscalls and iptables. (Just to name two.)
But if you send 32bit truncated values when 64 bit is expected
then users are going to complain
--
^ permalink raw reply
* Re: Fw: [Bug 15517] New: big file transfers stall and break network
From: Matt Carlson @ 2010-03-11 22:31 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev@vger.kernel.org
In-Reply-To: <20100311084630.64b85696@nehalam>
On Thu, Mar 11, 2010 at 08:46:30AM -0800, Stephen Hemminger wrote:
>
>
> Begin forwarded message:
>
> Date: Thu, 11 Mar 2010 14:40:12 GMT
> From: bugzilla-daemon@bugzilla.kernel.org
> To: shemminger@linux-foundation.org
> Subject: [Bug 15517] New: big file transfers stall and break network
>
>
> http://bugzilla.kernel.org/show_bug.cgi?id=15517
>
> Summary: big file transfers stall and break network
> Product: Networking
> Version: 2.5
> Kernel Version: 2.6.32.9
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: high
> Priority: P1
> Component: IPV4
> AssignedTo: shemminger@linux-foundation.org
> ReportedBy: conrad_s@rocketmail.com
> Regression: Yes
>
>
> Created an attachment (id=25475)
> --> (http://bugzilla.kernel.org/attachment.cgi?id=25475)
> lspci output, from working 2.6.31
>
> Upgrading to kernel 2.6.32.9 on a 64-bit machine (Fedora 12,
> 2.6.32.9-67.fc12.x86_64) caused breakage in transfer of large files over SSH
> and SMB, followed by breaking network access.
>
> To reproduce, copy a large file (> 900 MB) using SSH or SMB (mounted either
> directly via "mount" or indirectly via "gfvs / nautilus"). Copy stalls and
> network becomes unusable (e.g. can't ssh to any other host).
>
> Previous kernel 2.6.31.12 (Fedora 12, 2.6.31.12-174.2.22.fc12.x86_64) works
> fine.
This is a 5906 chip bug that was exposed. Commit
92c6b8d16a36df3f28b2537bed2a56491fb08f11 fixes the problem. Mike Pagano
has already submitted this fix to stable.
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Jan Engelhardt @ 2010-03-11 22:15 UTC (permalink / raw)
To: David Miller; +Cc: shemminger, netdev
In-Reply-To: <20100311.141325.205780761.davem@davemloft.net>
On Thursday 2010-03-11 23:13, David Miller wrote:
>
>> That make sense, but maybe we shouldn't send IFLA_STATS64 on
>> 32bit platforms.
>
>Let's at least be optimistic that we'll be able to support 64-bit
>stats on 32-bit at some point :-)
I was about to say. There is hope: whenever you least expect it,
academia comes up with a perfectly foundated theory and plan to solve
the problem. (N.B.: But the initial implementation generally sucks ;-)
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: Jan Engelhardt @ 2010-03-11 22:13 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20100311140406.37ee0b83@nehalam>
On Thursday 2010-03-11 23:04, Stephen Hemminger wrote:
>> >> `ip -s link` shows interface counters truncated to 32 bit. This is
>> >> because interface statistics are transported only in 32-bit quantity
>> >> to userspace. This commit adds a new IFLA_STATS64 attribute that
>> >> exports them in full 64 bit.
>>
>> On 64-bit it has 64-bit counters, yet we only report 32-bit
>> counters to userspace via netlink even in that case.
>
>That make sense, but maybe we shouldn't send IFLA_STATS64 on
>32bit platforms.
Somehow I'd prefer to have consistency. Platform-specific
actions and/or payload I think we already were plagued enough by
syscalls and iptables. (Just to name two.)
^ permalink raw reply
* Re: [PATCH 3/3] net: core: add IFLA_STATS64 support
From: David Miller @ 2010-03-11 22:13 UTC (permalink / raw)
To: shemminger; +Cc: jengelh, netdev
In-Reply-To: <20100311140406.37ee0b83@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 11 Mar 2010 14:04:06 -0800
> That make sense, but maybe we shouldn't send IFLA_STATS64 on
> 32bit platforms.
Let's at least be optimistic that we'll be able to support 64-bit
stats on 32-bit at some point :-)
^ permalink raw reply
* Re: [patch 3/5] LL TEMAC driver: add non-Virtex 5 support
From: Grant Likely @ 2010-03-11 22:10 UTC (permalink / raw)
To: akpm; +Cc: davem, netdev, jtyner, afleming, John Linn
In-Reply-To: <201003112207.o2BM7qhv013492@imap1.linux-foundation.org>
On Thu, Mar 11, 2010 at 3:07 PM, <akpm@linux-foundation.org> wrote:
> From: John Tyner <jtyner@cs.ucr.edu>
>
> Add support for using the LL TEMAC Ethernet driver on non-Virtex 5
> platforms by adding support for accessing the Soft DMA registers as if
> they were memory mapped instead of solely through the DCR's (available on
> the Virtex 5).
Thanks Andrew. Changes were requested on this one, but IIRC John
Tyner doesn't have any bandwidth to work on it. John Linn from Xilinx
has adopted the patch and is fixing it up.
g.
>
> Signed-off-by: John Tyner <jtyner@cs.ucr.edu>
> Cc: Andy Fleming <afleming@freescale.com>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/net/ll_temac.h | 1 +
> drivers/net/ll_temac_main.c | 31 ++++++++++++++++++++-----------
> 2 files changed, 21 insertions(+), 11 deletions(-)
>
> diff -puN drivers/net/ll_temac.h~ll-temac-driver-add-non-virtex-5-support drivers/net/ll_temac.h
> --- a/drivers/net/ll_temac.h~ll-temac-driver-add-non-virtex-5-support
> +++ a/drivers/net/ll_temac.h
> @@ -338,6 +338,7 @@ struct temac_local {
> /* IO registers and IRQs */
> void __iomem *regs;
> dcr_host_t sdma_dcrs;
> + u32 __iomem *sdma_regs;
> int tx_irq;
> int rx_irq;
> int emac_num;
> diff -puN drivers/net/ll_temac_main.c~ll-temac-driver-add-non-virtex-5-support drivers/net/ll_temac_main.c
> --- a/drivers/net/ll_temac_main.c~ll-temac-driver-add-non-virtex-5-support
> +++ a/drivers/net/ll_temac_main.c
> @@ -20,9 +20,6 @@
> * or rx, so this should be okay.
> *
> * TODO:
> - * - Fix driver to work on more than just Virtex5. Right now the driver
> - * assumes that the locallink DMA registers are accessed via DCR
> - * instructions.
> * - Factor out locallink DMA code into separate driver
> * - Fix multicast assignment.
> * - Fix support for hardware checksumming.
> @@ -117,12 +114,20 @@ void temac_indirect_out32(struct temac_l
>
> static u32 temac_dma_in32(struct temac_local *lp, int reg)
> {
> - return dcr_read(lp->sdma_dcrs, reg);
> + if (lp->sdma_regs) {
> + return __raw_readl(lp->sdma_regs + reg);
> + } else {
> + return dcr_read(lp->sdma_dcrs, reg);
> + }
> }
>
> static void temac_dma_out32(struct temac_local *lp, int reg, u32 value)
> {
> - dcr_write(lp->sdma_dcrs, reg, value);
> + if (lp->sdma_regs) {
> + __raw_writel(value, lp->sdma_regs + reg);
> + } else {
> + dcr_write(lp->sdma_dcrs, reg, value);
> + }
> }
>
> /**
> @@ -870,13 +875,17 @@ temac_of_probe(struct of_device *op, con
> goto nodev;
> }
>
> - dcrs = dcr_resource_start(np, 0);
> - if (dcrs == 0) {
> - dev_err(&op->dev, "could not get DMA register address\n");
> + lp->sdma_regs = NULL;
> +
> + if ((dcrs = dcr_resource_start(np, 0)) != 0) {
> + lp->sdma_dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
> + dev_dbg(&op->dev, "DCR base: %x\n", dcrs);
> + } else if ((lp->sdma_regs = of_iomap(np, 0))) {
> + dev_dbg(&op->dev, "MEM base: %p\n", lp->sdma_regs);
> + } else {
> + dev_err(&op->dev, "unable to map DMA registers\n");
> goto nodev;
> }
> - lp->sdma_dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
> - dev_dbg(&op->dev, "DCR base: %x\n", dcrs);
>
> lp->rx_irq = irq_of_parse_and_map(np, 0);
> lp->tx_irq = irq_of_parse_and_map(np, 1);
> @@ -903,7 +912,7 @@ temac_of_probe(struct of_device *op, con
>
> lp->phy_node = of_parse_phandle(op->node, "phy-handle", 0);
> if (lp->phy_node)
> - dev_dbg(lp->dev, "using PHY node %s (%p)\n", np->full_name, np);
> + dev_dbg(lp->dev, "using PHY node %s (%p)\n", lp->phy_node->full_name, lp->phy_node);
>
> /* Add the device attributes */
> rc = sysfs_create_group(&lp->dev->kobj, &temac_attr_group);
> _
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [patch 2/5] atm: use for_each_set_bit()
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
To: davem; +Cc: netdev, akpm, akinobu.mita, chas
From: Akinobu Mita <akinobu.mita@gmail.com>
Replace open-coded loop with for_each_set_bit().
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/atm/lanai.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff -puN drivers/atm/lanai.c~atm-use-for_each_set_bit drivers/atm/lanai.c
--- a/drivers/atm/lanai.c~atm-use-for_each_set_bit
+++ a/drivers/atm/lanai.c
@@ -306,11 +306,10 @@ static void vci_bitfield_iterate(struct
const unsigned long *lp,
void (*func)(struct lanai_dev *,vci_t vci))
{
- vci_t vci = find_first_bit(lp, NUM_VCI);
- while (vci < NUM_VCI) {
+ vci_t vci;
+
+ for_each_set_bit(vci, lp, NUM_VCI)
func(lanai, vci);
- vci = find_next_bit(lp, NUM_VCI, vci + 1);
- }
}
/* -------------------- BUFFER UTILITIES: */
_
^ permalink raw reply
* [patch 5/5] obsolete config in kernel source: HSO_AUTOPM
From: akpm @ 2010-03-11 22:07 UTC (permalink / raw)
To: davem; +Cc: netdev, akpm, siccegge
From: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
CONFIG_HSO_AUTOPM is set by KConfig / set in the Kernel source, makefiles
and won't be ever set this way, therefor simply removing the protected
code.
Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/net/usb/hso.c | 3 ---
1 file changed, 3 deletions(-)
diff -puN drivers/net/usb/hso.c~obsolete-config-in-kernel-source-hso_autopm drivers/net/usb/hso.c
--- a/drivers/net/usb/hso.c~obsolete-config-in-kernel-source-hso_autopm
+++ a/drivers/net/usb/hso.c
@@ -1155,9 +1155,6 @@ static void _hso_serial_set_termios(stru
static void hso_resubmit_rx_bulk_urb(struct hso_serial *serial, struct urb *urb)
{
int result;
-#ifdef CONFIG_HSO_AUTOPM
- usb_mark_last_busy(urb->dev);
-#endif
/* We are done with this URB, resubmit it. Prep the USB to wait for
* another frame */
usb_fill_bulk_urb(urb, serial->parent->usb,
_
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox