Date: Wed, 8 May 2019 10:34:42 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r347261 - head/sys/dev/mlx5/mlx5_en Message-ID: <201905081034.x48AYgb0044875@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed May 8 10:34:42 2019 New Revision: 347261 URL: https://svnweb.freebsd.org/changeset/base/347261 Log: 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. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:14 2019 (r347260) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed May 8 10:34:42 2019 (r347261) @@ -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?201905081034.x48AYgb0044875>