Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 May 2019 15:52:18 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r347725 - stable/12/sys/dev/mlx5/mlx5_en
Message-ID:  <201905161552.x4GFqI0i050986@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905161552.x4GFqI0i050986>