Author: hselasky
Date: Thu May 16 15:52:18 2019
New Revision: 347725
URL: https://svnweb.freebsd.org/changeset/base/347725

Log:
  MFC r347261:
  Implement fast close of RX channel in mlx5en(4).
  
  Instead of waiting for all jobs to be cancelled, simply close the completion
  queue to prevent more completion events and let mlx5e_destroy_rq() cleanup
  the remaining mbufs.
  
  Sponsored by: Mellanox Technologies

Modified:
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Thu May 16 15:51:28 
2019        (r347724)
+++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c       Thu May 16 15:52:18 
2019        (r347725)
@@ -1136,17 +1136,10 @@ mlx5e_close_rq(struct mlx5e_rq *rq)
 static void
 mlx5e_close_rq_wait(struct mlx5e_rq *rq)
 {
-       struct mlx5_core_dev *mdev = rq->channel->priv->mdev;
 
-       /* wait till RQ is empty */
-       while (!mlx5_wq_ll_is_empty(&rq->wq) &&
-              (mdev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR)) {
-               msleep(4);
-               rq->cq.mcq.comp(&rq->cq.mcq);
-       }
-
-       cancel_work_sync(&rq->dim.work);
        mlx5e_disable_rq(rq);
+       mlx5e_close_cq(&rq->cq);
+       cancel_work_sync(&rq->dim.work);
        mlx5e_destroy_rq(rq);
 }
 
@@ -1861,7 +1854,6 @@ mlx5e_close_channel_wait(struct mlx5e_channel *c)
 {
        mlx5e_close_rq_wait(&c->rq);
        mlx5e_close_sqs_wait(c);
-       mlx5e_close_cq(&c->rq.cq);
        mlx5e_close_tx_cqs(c);
        /* destroy mutexes */
        mlx5e_chan_mtx_destroy(c);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to