[openib-general] [CM] question about the code that handle the attribute: packet_life_time
Sean Hefty
mshefty at ichips.intel.com
Wed Nov 22 10:30:02 PST 2006
Dotan Barak wrote:
> I noticed the following code lines in the cm.c (this code handles
> packet_life_time):
>
> in function: cm_format_req
> cm_req_set_primary_local_ack_timeout(req_msg,
> min(31, param->primary_path->packet_life_time + 1));
>
> in function: cm_format_paths_from_req
> primary_path->packet_life_time_selector = IB_SA_EQ;
> primary_path->packet_life_time =
> cm_req_get_primary_local_ack_timeout(req_msg);
> primary_path->packet_life_time -=
> (primary_path->packet_life_time > 0);
>
> Why do you check the minimum between 31 and packet_life_time + 1?
> I understand where the value 31 is coming from, but why do you add 1 to
> the original packet_life_time value?
Packet life time is the time that it takes a packet to traverse the path, and is
a 6-bit value.
Primary local ack timeout is a 5-bit value calculated as: 2 x packet life time +
local CA ack delay. Adding 1 to the packet life time doubles it because of how
it's represented.
I subtract one on the remote side to get back to the original packet life time.
This is off if the true packet life time is really 31 (about 2.75 hours), but
more accurate for practical values. The check for 31 is a result of trying to
cram the 6-bit value into a 5-bit field.
- Sean
More information about the general
mailing list