[PVFS2-CVS] commit by pcarns in pvfs2/src/io/bmi/bmi_tcp: bmi-tcp-addressing.h bmi-tcp.c

CVS commit program cvs at parl.clemson.edu
Thu Feb 12 17:50:12 EST 2004


Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp
In directory parlweb:/tmp/cvs-serv11228/src/io/bmi/bmi_tcp

Modified Files:
	bmi-tcp-addressing.h bmi-tcp.c 
Log Message:
mark persistent errors on bmi_tcp addresses that have failed in the past


Index: bmi-tcp-addressing.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp-addressing.h,v
diff -p -u -r1.5 -r1.6
--- bmi-tcp-addressing.h	9 Dec 2003 16:05:27 -0000	1.5
+++ bmi-tcp-addressing.h	12 Feb 2004 22:50:12 -0000	1.6
@@ -25,6 +25,8 @@ typedef int32_t bmi_port_t;	/* tcp/ip po
 struct tcp_addr
 {
     method_addr_p map;		/* points back to generic address */
+    /* stores error code for addresses that are broken for some reason */
+    int error_code;		
     char *hostname;
     char *ipaddr;
     bmi_port_t port;

Index: bmi-tcp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c,v
diff -p -u -r1.59 -r1.60
--- bmi-tcp.c	12 Feb 2004 22:30:38 -0000	1.59
+++ bmi-tcp.c	12 Feb 2004 22:50:12 -0000	1.60
@@ -1319,12 +1319,15 @@ void tcp_forget_addr(method_addr_p map,
 		     int dealloc_flag,
 		     int error_code)
 {
+    struct tcp_addr* tcp_addr_data = map->method_data;
+
     tcp_shutdown_addr(map);
     if (tcp_socket_collection_p)
     {
 	BMI_socket_collection_remove(tcp_socket_collection_p, map);
     }
     tcp_cleanse_addr(map, error_code);
+    tcp_addr_data->error_code = error_code;
     if (dealloc_flag)
     {
 	dealloc_tcp_method_addr(map);
@@ -1515,6 +1518,12 @@ static int tcp_sock_init(method_addr_p m
     {
 	return (-EINVAL);
     }
+    if(tcp_addr_data->error_code)
+    {
+	/* this address is bad, don't try to do anything with it */
+	gossip_err("Warning: BMI communication attempted on an address in failure mode.\n");
+	return(tcp_addr_data->error_code);
+    }
 
     /* is there already a socket? */
     if (tcp_addr_data->socket > -1)
@@ -1758,6 +1767,14 @@ static int tcp_post_recv_generic(bmi_op_
     int copy_size = 0;
     bmi_size_t total_copied = 0;
     int i;
+
+    tcp_addr_data = src->method_data;
+    if(tcp_addr_data->error_code)
+    {
+	/* this address is bad, don't try to do anything with it */
+	gossip_err("Warning: BMI communication attempted on an address in failure mode.\n");
+	return(tcp_addr_data->error_code);
+    }
 
     /* lets make sure that the message hasn't already been fully
      * buffered in eager mode before doing anything else



More information about the PVFS2-CVS mailing list