From: Dave Jiang Date: Tue, 22 Aug 2023 16:05:02 +0000 (-0700) Subject: ntb: Check tx descriptors outstanding instead of head/tail for tx queue X-Git-Tag: v6.6.17~3951^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=643982232860887fed493144957ea5794b6557d1;p=platform%2Fkernel%2Flinux-rpi.git ntb: Check tx descriptors outstanding instead of head/tail for tx queue Use existing function ntb_transport_tx_free_entry() instead of open coding the check to see if there are outstanding tx descriptors. Reviewed-by: Logan Gunthorpe Signed-off-by: Dave Jiang Signed-off-by: Jon Mason --- diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 9532108..f9e7847 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -1901,7 +1901,7 @@ err: static int ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) { - if (qp->tx_index == qp->remote_rx_info->entry) { + if (!ntb_transport_tx_free_entry(qp)) { qp->tx_ring_full++; return -EAGAIN; }