On Tue, Jun 22, 2021 at 04:13:27PM +0200, Håkon Bugge wrote: > An approximation for the PacketLifeTime is half the local ACK timeout. > The encoding for both timers are logarithmic. > > If the local ACK timeout is set, but zero, it means the timer is > disabled. In this case, we choose the CMA_IBOE_PACKET_LIFETIME value, > since 50% of infinite makes no sense. > > Before this commit, the PacketLifeTime became 255 if local ACK > timeout was zero (not running). > > Fixed by explicitly testing for timeout being zero. > > Fixes: e1ee1e62bec4 ("RDMA/cma: Use ACK timeout for RoCE packetLifeTime") > Signed-off-by: Håkon Bugge <haakon.bugge@xxxxxxxxxx> > Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx> > --- > > v1 -> v2: > * Rebased on tip of for-next with ("RDMA/cma: Protect RMW > with qp_mutex") included > * A local ACK timeout of zero now sets PacketLifeTime to > CMA_IBOE_PACKET_LIFETIME > * Added Leon's r-b > --- > drivers/infiniband/core/cma.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) Applied to for-next, thanks Jason