netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] RDS: TCP: bug fixes
@ 2016-11-04 17:04 Sowmini Varadhan
  2016-11-04 17:04 ` [PATCH net-next 1/2] RDS: TCP: report addr/port info based on TCP socket in rds-info Sowmini Varadhan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2016-11-04 17:04 UTC (permalink / raw)
  To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar

A couple of bug fixes identified during testing. 

Sowmini Varadhan (2):
  RDS: TCP: report addr/port info based on TCP socket in rds-info
  RDS: TCP: start multipath acceptor loop at 0

 net/rds/tcp.c        |   20 +++++++++++++-------
 net/rds/tcp_listen.c |    2 +-
 2 files changed, 14 insertions(+), 8 deletions(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] RDS: TCP: report addr/port info based on TCP socket in rds-info
  2016-11-04 17:04 [PATCH net-next 0/2] RDS: TCP: bug fixes Sowmini Varadhan
@ 2016-11-04 17:04 ` Sowmini Varadhan
  2016-11-04 17:04 ` [PATCH net-next 2/2] RDS: TCP: start multipath acceptor loop at 0 Sowmini Varadhan
  2016-11-09 17:48 ` [PATCH net-next 0/2] RDS: TCP: bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2016-11-04 17:04 UTC (permalink / raw)
  To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar

The socket argument passed to rds_tcp_tc_info() is a PF_RDS socket,
so it is incorrect to report the address port info based on
rds_getname() as part of TCP state report.

Invoke inet_getname() for the t_sock associated with the
rds_tcp_connection instead.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/tcp.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index fcddacc..3296a6a 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -220,7 +220,7 @@ void rds_tcp_set_callbacks(struct socket *sock, struct rds_conn_path *cp)
 	write_unlock_bh(&sock->sk->sk_callback_lock);
 }
 
-static void rds_tcp_tc_info(struct socket *sock, unsigned int len,
+static void rds_tcp_tc_info(struct socket *rds_sock, unsigned int len,
 			    struct rds_info_iterator *iter,
 			    struct rds_info_lengths *lens)
 {
@@ -229,6 +229,7 @@ static void rds_tcp_tc_info(struct socket *sock, unsigned int len,
 	unsigned long flags;
 	struct sockaddr_in sin;
 	int sinlen;
+	struct socket *sock;
 
 	spin_lock_irqsave(&rds_tcp_tc_list_lock, flags);
 
@@ -237,12 +238,17 @@ static void rds_tcp_tc_info(struct socket *sock, unsigned int len,
 
 	list_for_each_entry(tc, &rds_tcp_tc_list, t_list_item) {
 
-		sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 0);
-		tsinfo.local_addr = sin.sin_addr.s_addr;
-		tsinfo.local_port = sin.sin_port;
-		sock->ops->getname(sock, (struct sockaddr *)&sin, &sinlen, 1);
-		tsinfo.peer_addr = sin.sin_addr.s_addr;
-		tsinfo.peer_port = sin.sin_port;
+		sock = tc->t_sock;
+		if (sock) {
+			sock->ops->getname(sock, (struct sockaddr *)&sin,
+					   &sinlen, 0);
+			tsinfo.local_addr = sin.sin_addr.s_addr;
+			tsinfo.local_port = sin.sin_port;
+			sock->ops->getname(sock, (struct sockaddr *)&sin,
+					   &sinlen, 1);
+			tsinfo.peer_addr = sin.sin_addr.s_addr;
+			tsinfo.peer_port = sin.sin_port;
+		}
 
 		tsinfo.hdr_rem = tc->t_tinc_hdr_rem;
 		tsinfo.data_rem = tc->t_tinc_data_rem;
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] RDS: TCP: start multipath acceptor loop at 0
  2016-11-04 17:04 [PATCH net-next 0/2] RDS: TCP: bug fixes Sowmini Varadhan
  2016-11-04 17:04 ` [PATCH net-next 1/2] RDS: TCP: report addr/port info based on TCP socket in rds-info Sowmini Varadhan
@ 2016-11-04 17:04 ` Sowmini Varadhan
  2016-11-09 17:48 ` [PATCH net-next 0/2] RDS: TCP: bug fixes David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Sowmini Varadhan @ 2016-11-04 17:04 UTC (permalink / raw)
  To: netdev; +Cc: davem, rds-devel, sowmini.varadhan, santosh.shilimkar

The for() loop in rds_tcp_accept_one() assumes that the 0'th
rds_tcp_conn_path is UP and starts multipath accepts at index 1.
But this assumption may not always be true: if the 0'th path
has failed (ERROR or DOWN state) an incoming connection request
should be used to resurrect this path.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
---
 net/rds/tcp_listen.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/rds/tcp_listen.c b/net/rds/tcp_listen.c
index e0b23fb..c9c4968 100644
--- a/net/rds/tcp_listen.c
+++ b/net/rds/tcp_listen.c
@@ -103,7 +103,7 @@ struct rds_tcp_connection *rds_tcp_accept_one_path(struct rds_connection *conn)
 	if (!peer_is_smaller)
 		return NULL;
 
-	for (i = 1; i < npaths; i++) {
+	for (i = 0; i < npaths; i++) {
 		struct rds_conn_path *cp = &conn->c_path[i];
 
 		if (rds_conn_path_transition(cp, RDS_CONN_DOWN,
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] RDS: TCP: bug fixes
  2016-11-04 17:04 [PATCH net-next 0/2] RDS: TCP: bug fixes Sowmini Varadhan
  2016-11-04 17:04 ` [PATCH net-next 1/2] RDS: TCP: report addr/port info based on TCP socket in rds-info Sowmini Varadhan
  2016-11-04 17:04 ` [PATCH net-next 2/2] RDS: TCP: start multipath acceptor loop at 0 Sowmini Varadhan
@ 2016-11-09 17:48 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-11-09 17:48 UTC (permalink / raw)
  To: sowmini.varadhan; +Cc: netdev, rds-devel, santosh.shilimkar

From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Date: Fri,  4 Nov 2016 10:04:10 -0700

> A couple of bug fixes identified during testing. 

Series applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-09 17:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-04 17:04 [PATCH net-next 0/2] RDS: TCP: bug fixes Sowmini Varadhan
2016-11-04 17:04 ` [PATCH net-next 1/2] RDS: TCP: report addr/port info based on TCP socket in rds-info Sowmini Varadhan
2016-11-04 17:04 ` [PATCH net-next 2/2] RDS: TCP: start multipath acceptor loop at 0 Sowmini Varadhan
2016-11-09 17:48 ` [PATCH net-next 0/2] RDS: TCP: bug fixes David Miller

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).