ntb: Clean up tx tail index on link down
authorDave Jiang <dave.jiang@intel.com>
Tue, 22 Aug 2023 16:04:45 +0000 (09:04 -0700)
committerJon Mason <jdmason@kudzu.us>
Tue, 22 Aug 2023 16:38:19 +0000 (12:38 -0400)
commitcc79bd2738c2d40aba58b2be6ce47dc0e471df0e
treea9966e1ecfd14a131fd11d8a7e62d573cdd1afe0
parent28e70ed9d0fab935f78b565d9c026585559b86a4
ntb: Clean up tx tail index on link down

The tx tail index is not reset when the link goes down. This causes the
tail index to go out of sync when the link goes down and comes back up.
Refactor the ntb_qp_link_down_reset() and reset the tail index as well.

Fixes: 2849b5d70641 ("NTB: Reset transport QP link stats on down")
Reported-by: Yuan Y Lu <yuan.y.lu@intel.com>
Tested-by: Yuan Y Lu <yuan.y.lu@intel.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
drivers/ntb/ntb_transport.c