From dd7c5b747462818ba54780ee4a6d17854e12d0cd Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Fri, 30 Sep 2016 16:57:49 -0700 Subject: [PATCH] usnic cagent: correctly compute the "large" ping message size The (effective) "+42" computation was, in fact, the incorrect answer in this case (gasp!). We should just take the max_msg_size from the command (which came from the libfabric endpoint max_msg_size attribute in the client) and subtract off the max header size: 68 (which is explained in the comment). This will result in a "large" message size which is likely slightly smaller than the MTU, but still right up near the MTU, and therefore good enough. Also remove an old/misleading comment. Signed-off-by: Jeff Squyres (cherry picked from commit dfc72e4e0b41c042b952f4ee7748c195cbdd62c7) --- opal/mca/btl/usnic/btl_usnic_cagent.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/opal/mca/btl/usnic/btl_usnic_cagent.c b/opal/mca/btl/usnic/btl_usnic_cagent.c index 18805814f38..386aec0a260 100644 --- a/opal/mca/btl/usnic/btl_usnic_cagent.c +++ b/opal/mca/btl/usnic/btl_usnic_cagent.c @@ -877,9 +877,8 @@ static void agent_thread_cmd_ping(agent_ipc_listener_t *ipc_listener) all IP options are enabled, which is 60 bytes), and then also subtract off the UDP header (which is 8 bytes). So we need to subtract off 68 bytes from the MTU, and that's the largest ping - payload we can send. - max_msg_size allows for minimal UDP header, be more conservative */ - ap->sizes[1] = cmd.max_msg_size - (68 - 42); + payload we can send. */ + ap->sizes[1] = cmd.max_msg_size - 68; /* Allocate a buffer for each size. Make sure the smallest size is at least sizeof(agent_udp_message_t). */