ntb: Check tx descriptors outstanding instead of head/tail for tx queue
authorDave Jiang <dave.jiang@intel.com>
Tue, 22 Aug 2023 16:05:02 +0000 (09:05 -0700)
committerJon Mason <jdmason@kudzu.us>
Tue, 22 Aug 2023 16:38:19 +0000 (12:38 -0400)
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 <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

index 9532108..f9e7847 100644 (file)
@@ -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;
        }