mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-27 12:57:53 +00:00
ntb: Clean up tx tail index on link down
commitcc79bd2738
upstream. 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:2849b5d706
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
aa6d6ed213
commit
6ec95c4faa
1 changed files with 9 additions and 2 deletions
|
@ -741,7 +741,7 @@ static int ntb_set_mw(struct ntb_transport_ctx *nt, int num_mw,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp)
|
||||
static void ntb_qp_link_context_reset(struct ntb_transport_qp *qp)
|
||||
{
|
||||
qp->link_is_up = false;
|
||||
qp->active = false;
|
||||
|
@ -764,6 +764,13 @@ static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp)
|
|||
qp->tx_async = 0;
|
||||
}
|
||||
|
||||
static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp)
|
||||
{
|
||||
ntb_qp_link_context_reset(qp);
|
||||
if (qp->remote_rx_info)
|
||||
qp->remote_rx_info->entry = qp->rx_max_entry - 1;
|
||||
}
|
||||
|
||||
static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp)
|
||||
{
|
||||
struct ntb_transport_ctx *nt = qp->transport;
|
||||
|
@ -988,7 +995,7 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,
|
|||
qp->ndev = nt->ndev;
|
||||
qp->client_ready = false;
|
||||
qp->event_handler = NULL;
|
||||
ntb_qp_link_down_reset(qp);
|
||||
ntb_qp_link_context_reset(qp);
|
||||
|
||||
if (mw_num < qp_count % mw_count)
|
||||
num_qps_mw = qp_count / mw_count + 1;
|
||||
|
|
Loading…
Reference in a new issue