Skip to content

Commit 22ca0b5

Browse files
committed
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 <[email protected]> (cherry picked from commit dfc72e4)
1 parent ee139f5 commit 22ca0b5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

opal/mca/btl/usnic/btl_usnic_cagent.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,9 +877,8 @@ static void agent_thread_cmd_ping(agent_ipc_listener_t *ipc_listener)
877877
all IP options are enabled, which is 60 bytes), and then also
878878
subtract off the UDP header (which is 8 bytes). So we need to
879879
subtract off 68 bytes from the MTU, and that's the largest ping
880-
payload we can send.
881-
max_msg_size allows for minimal UDP header, be more conservative */
882-
ap->sizes[1] = cmd.max_msg_size - (68 - 42);
880+
payload we can send. */
881+
ap->sizes[1] = cmd.max_msg_size - 68;
883882

884883
/* Allocate a buffer for each size. Make sure the smallest size
885884
is at least sizeof(agent_udp_message_t). */

0 commit comments

Comments
 (0)