As discussed earlier, when setting the TCP socket buffer sizes in
the config file, the client already has one connection open to a
server to get the config file. It's too late to change the buffer
size for this one connection. So we need to close it and reopen it
to fix things.
This little patch just adds the part where the client can get BMI to
close the socket. One issue not handled in this patch is: don't do
this unless the config file explicitly sets buffer sizes. The
bigger problem that sockbuf sizes should not be global settings, but
rather per-mountpoint, is also not dealt with here.
-- Pete
Index: src/client/sysint/fs-add.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/fs-add.sm,v
retrieving revision 1.4
diff -u -p -r1.4 fs-add.sm
--- src/client/sysint/fs-add.sm 26 May 2006 02:53:42 -0000 1.4
+++ src/client/sysint/fs-add.sm 13 Jul 2006 18:47:32 -0000
@@ -222,6 +222,7 @@ static int fs_add_parent_cleanup(
PINT_client_sm *sm_p, job_status_s *js_p)
{
int ret = -PVFS_EINVAL;
+ PVFS_BMI_addr_t addr;
if(js_p->error_code != 0)
{
@@ -243,6 +244,14 @@ static int fs_add_parent_cleanup(
(void *)&sm_p->u.get_config.config->tcp_buffer_size_send);
BMI_set_info(0, BMI_TCP_BUFFER_RECEIVE_SIZE,
(void *)&sm_p->u.get_config.config->tcp_buffer_size_receive);
+ /*
+ * Force the connection to the config server down so future transfers
+ * will get the new buffer size.
+ */
+ ret = BMI_addr_lookup(&addr,
+ sm_p->u.get_config.mntent->the_pvfs_config_server);
+ if (ret == 0)
+ BMI_set_info(addr, BMI_TCP_CLOSE_SOCKET, NULL);
/*
clear out all configuration information about file systems that
Index: src/io/bmi/bmi-types.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi-types.h,v
retrieving revision 1.26
diff -u -p -r1.26 bmi-types.h
--- src/io/bmi/bmi-types.h 25 May 2006 22:17:18 -0000 1.26
+++ src/io/bmi/bmi-types.h 13 Jul 2006 18:47:32 -0000
@@ -73,7 +73,8 @@ enum
#endif
BMI_GET_UNEXP_SIZE = 10, /**< get the maximum unexpected payload */
BMI_TCP_BUFFER_SEND_SIZE = 11,
- BMI_TCP_BUFFER_RECEIVE_SIZE = 12
+ BMI_TCP_BUFFER_RECEIVE_SIZE = 12,
+ BMI_TCP_CLOSE_SOCKET = 13,
};
/* mappings from PVFS errors to BMI errors */
Index: src/io/bmi/bmi.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi.c,v
retrieving revision 1.70
diff -u -p -r1.70 bmi.c
--- src/io/bmi/bmi.c 27 May 2006 23:48:32 -0000 1.70
+++ src/io/bmi/bmi.c 13 Jul 2006 18:47:32 -0000
@@ -1179,6 +1179,17 @@ int BMI_set_info(PVFS_BMI_addr_t addr,
return(0);
}
+ /*
+ * Pass the TCP address structure as the parameter for this operation,
+ * holding the lock.
+ */
+ if (option == BMI_TCP_CLOSE_SOCKET) {
+ inout_parameter = tmp_ref->method_addr;
+ ret = tmp_ref->interface->BMI_meth_set_info(option, inout_parameter);
+ gen_mutex_unlock(&ref_mutex);
+ return ret;
+ }
+
gen_mutex_unlock(&ref_mutex);
ret = tmp_ref->interface->BMI_meth_set_info(option, inout_parameter);
Index: src/io/bmi/bmi_tcp/bmi-tcp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c,v
retrieving revision 1.103
diff -u -p -r1.103 bmi-tcp.c
--- src/io/bmi/bmi_tcp/bmi-tcp.c 30 May 2006 04:53:26 -0000 1.103
+++ src/io/bmi/bmi_tcp/bmi-tcp.c 13 Jul 2006 18:47:32 -0000
@@ -677,6 +677,19 @@ int BMI_tcp_set_info(int option,
tcp_method_params.listen_addr->method_data)->socket);
#endif
break;
+ /*
+ * Used after changing buffer sizes to force the connection to
+ * the server used for the config to close so it can be reopened
+ * with the new buffer sizes as the rest of the future server
+ * connections will be.
+ */
+ case BMI_TCP_CLOSE_SOCKET: {
+ struct method_addr *map = inout_parameter;
+ if (tcp_socket_collection_p)
+ BMI_socket_collection_remove(tcp_socket_collection_p, map);
+ ret = tcp_shutdown_addr(map);
+ break;
+ }
case BMI_FORCEFUL_CANCEL_MODE:
forceful_cancel_mode = 1;
ret = 0;
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers