Skip to content

Commit f195a1a

Browse files
davejiangjonmason
authored andcommitted
ntb: Drop packets when qp link is down
Currently when the transport receive packets after netdev has closed the transport returns error and triggers tx errors to be incremented and carrier to be stopped. There is no reason to return error if the device is already closed. Drop the packet and return 0. Fixes: e26a584 ("NTB: Split ntb_hw_intel and ntb_transport drivers") 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>
1 parent cc79bd2 commit f195a1a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/ntb/ntb_transport.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2283,9 +2283,13 @@ int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data,
22832283
struct ntb_queue_entry *entry;
22842284
int rc;
22852285

2286-
if (!qp || !qp->link_is_up || !len)
2286+
if (!qp || !len)
22872287
return -EINVAL;
22882288

2289+
/* If the qp link is down already, just ignore. */
2290+
if (!qp->link_is_up)
2291+
return 0;
2292+
22892293
entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q);
22902294
if (!entry) {
22912295
qp->tx_err_no_buf++;

0 commit comments

Comments
 (0)