From nobody Tue Apr 18 13:02:11 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q13wh5Sk4z454gn; Tue, 18 Apr 2023 13:02:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q13wg49R2z4Ktm; Tue, 18 Apr 2023 13:02:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681822931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dd0CfujlWhX8doKrM2+4mLGXzVnaY805Tb/Q9yCV6EI=; b=UNGR3o7qWyH+35Uds2WA1B8BjQNTTfaqSsge5pKaucoWLvtZ2KIIDBbn4gU/TYtY+cJrtR OU7xM/e0gXOOTJaKWaY/WFVGhWZ+88vYdvdXYO3lsdb0Gj1o9UF+sPHnrIF6MEFDoSwyLb +YAx9ZGbswJixSDUnuqDs9IyIpq1Plcxso5G5kt/HdtLdMeBqkMUa+ooEnXS7r73wUfxhl ++QIOCcBzUqicpzAVo9tN/h+KrzMEED3Egyei6GYmWfy/CquagNSgnXvAJF05awUWda9u1 AHB1TOk7rmYjpac84FHXGzo0h/sjlEhICILQLpGslKBghZ9IDYCKeWQ0Mc5ToA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681822931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Dd0CfujlWhX8doKrM2+4mLGXzVnaY805Tb/Q9yCV6EI=; b=p/lJet3edmrDn9klCARKw//XcBDfshRqwkt6E0MwwVfKfColaUsIxzSrUrLlcrIGScNX2b mP2+yG5m0vYPfY+BUFMLBV5xDlZ8F1YmsviiBWAPw4smA0tN3YZRFwGmAPsCPQgh7lGf/v xrIyxI1+5M0uOpPJE2U1bdUfjHmvOSaPcyRvzrGBrrLIm/PUH+447K3P8ONVbHoEK2GelH VjDrBgqKRMu72+pQ9kNaUOU5xyXILbKF4yPHTyhureMyHZ3SOhcOKLIeI3BFn9JoyYv7JJ 22fuJdKhSas5jiAUCAh/2rTs2VbO9dYxmPymy5PcWwE2NnQkG1J4NWUSyzw+/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681822931; a=rsa-sha256; cv=none; b=B8yKSEgmaTtK5d1Mr7UDynsFMiGCORm2t8YLz+9JluVNgF+R6kYQ57mO2YCi7VHQ4nQcST gRyysQuNYBzOawufAKY6w1J7kWYAbR4qYF45/rARiG43ihEBv24EECHh34W74ndVhO0sJB UPDvXUmHyNPL/2R70q6TRyRfgMzqBPPSLF4j7xSSLrsEGUoTBSgroZUhQM9vbajwvbwujS K80Qa1zwy8WQtvBuiOlE7fWifl6aeamdoSjEk6aiz8TlwlASwWIV02tXwpVcFpbj18BXaC NiHDp7Zsvqo3OegLPRDFZ8uP/K+PcY1FCnGYHxmWCzzQ4Gnm/EbPkMW1aV/J+Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Q13wg34Gyz1C3k; Tue, 18 Apr 2023 13:02:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33ID2BD7079149; Tue, 18 Apr 2023 13:02:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33ID2BmE079148; Tue, 18 Apr 2023 13:02:11 GMT (envelope-from git) Date: Tue, 18 Apr 2023 13:02:11 GMT Message-Id: <202304181302.33ID2BmE079148@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 1943c40cd655 - main - mlx5en(4): Don't wait for receive queue to fill up with mbufs during open channels. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1943c40cd655b7259b9b21849f328362c97a2657 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=1943c40cd655b7259b9b21849f328362c97a2657 commit 1943c40cd655b7259b9b21849f328362c97a2657 Author: Hans Petter Selasky AuthorDate: 2023-04-18 11:42:17 +0000 Commit: Hans Petter Selasky CommitDate: 2023-04-18 13:01:07 +0000 mlx5en(4): Don't wait for receive queue to fill up with mbufs during open channels. Failure to get mbufs may be transient. Don't permanently fail to open the channels due to lack of mbufs. This also makes modifying channel parameters faster. MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/dev/mlx5/mlx5_en/en.h | 2 -- sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c | 5 ----- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 26 -------------------------- 3 files changed, 33 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index e942b3a13462..e33ccce5abb1 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -107,7 +107,6 @@ #define MLX5E_PARAMS_DEFAULT_RX_CQ_MODERATION_PKTS 0x20 #define MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_USEC 0x10 #define MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS 0x20 -#define MLX5E_PARAMS_DEFAULT_MIN_RX_WQES 0x80 #define MLX5E_PARAMS_DEFAULT_RX_HASH_LOG_TBL_SZ 0x7 #define MLX5E_CACHELINE_SIZE CACHE_LINE_SIZE #define MLX5E_HW2SW_MTU(hwmtu) \ @@ -676,7 +675,6 @@ struct mlx5e_params { u16 rx_cq_moderation_pkts; u16 tx_cq_moderation_usec; u16 tx_cq_moderation_pkts; - u16 min_rx_wqes; bool hw_lro_en; bool cqe_zipping_en; u32 lro_wqe_sz; diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c index 59a8cbc56bbb..9b857f26f6f8 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c @@ -1035,11 +1035,6 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARGS) priv->params_ethtool.rx_queue_size = 1 << priv->params.log_rq_size; - /* update least number of RX WQEs */ - priv->params.min_rx_wqes = min( - priv->params_ethtool.rx_queue_size - 1, - MLX5E_PARAMS_DEFAULT_MIN_RX_WQES); - /* restart network interface, if any */ if (was_opened) mlx5e_open_locked(priv->ifp); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 7a11bedffb10..34546174af65 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1416,23 +1416,6 @@ mlx5e_disable_rq(struct mlx5e_rq *rq) mlx5_core_destroy_rq(mdev, rq->rqn); } -static int -mlx5e_wait_for_min_rx_wqes(struct mlx5e_rq *rq) -{ - struct mlx5e_channel *c = rq->channel; - struct mlx5e_priv *priv = c->priv; - struct mlx5_wq_ll *wq = &rq->wq; - int i; - - for (i = 0; i < 1000; i++) { - if (wq->cur_sz >= priv->params.min_rx_wqes) - return (0); - - msleep(4); - } - return (-ETIMEDOUT); -} - static int mlx5e_open_rq(struct mlx5e_channel *c, struct mlx5e_rq_param *param, @@ -2518,7 +2501,6 @@ mlx5e_open_channels(struct mlx5e_priv *priv) struct mlx5e_channel_param *cparam; int err; int i; - int j; cparam = malloc(sizeof(*cparam), M_MLX5EN, M_WAITOK); @@ -2552,12 +2534,6 @@ mlx5e_open_channels(struct mlx5e_priv *priv) intr_setaffinity(irq, CPU_WHICH_INTRHANDLER, &cpuset); } } - - for (j = 0; j < priv->params.num_channels; j++) { - err = mlx5e_wait_for_min_rx_wqes(&priv->channel[j].rq); - if (err) - goto err_close_channels; - } free(cparam, M_MLX5EN); return (0); @@ -3849,8 +3825,6 @@ mlx5e_build_ifp_priv(struct mlx5_core_dev *mdev, MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_USEC; priv->params.tx_cq_moderation_pkts = MLX5E_PARAMS_DEFAULT_TX_CQ_MODERATION_PKTS; - priv->params.min_rx_wqes = - MLX5E_PARAMS_DEFAULT_MIN_RX_WQES; priv->params.rx_hash_log_tbl_sz = (order_base_2(num_comp_vectors) > MLX5E_PARAMS_DEFAULT_RX_HASH_LOG_TBL_SZ) ?