From nobody Tue May 12 13:02:01 2026 X-Original-To: dev-commits-src-all@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 4gFGvZ1XVQz6dd2Z for ; Tue, 12 May 2026 13:02:02 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gFGvY6d1rz4DkP for ; Tue, 12 May 2026 13:02:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778590921; 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=vwOG5znDhcMgDLPrYnImC2zyP2ngMbwPnEprCw0/JbM=; b=m8HgtoBbgQJmNDZXnrPxoF8H3aOa8yq9Qkfjjyh2sTr16Zvou8OSc5Q4pV0pBxbtoMzTG8 gFvRMOmwLw/c2piHcSvuDLNO6U96OZwKgzPuT+DJCcaWFk9Rq7wtSjZtxlS0Kr4iMtdstn ljFsfNkj+Bsm+oXdrnJiKm3Wvf2BVpjA18mHom5KM4oS3ESjgetUDAyEEgpBFraJRuhWRJ U6K7x+JpD9Q8yIu6Ez3XMS0nIxaL+AQj9z2IEVUlwYvpOG2ceZAGET1LtoLrdqLl4lzvdU aG+fQHMhAeWPezTL+260lN+GYlPki0S2OGowTes4FEyfB0A0aVsjJD5zoqd+9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778590921; a=rsa-sha256; cv=none; b=iLsr/wzDgR/L7mc48nrfLpwNoMWBQ1O6NPnJz8ZdHdho51JP7tQAxGQBPhxAkFos0MNIUA 5Lv35AF6+Ry+mV2t1+JdH1b8LTrGxzLHijxyepGSmVwZVkmZ0Q1DIK4F1dTcpUjZ0gSaP4 dJu218V8u/lTKy4AH7WFCjrhIqNmglKIFcZnqAXRlhr1LMfDWdZ7MKGxCuHwNS2x2IiXY4 OArQ45+W7oScLOW0ruBzkU1wUzD1Nd4GSISbxs7UpXmZTx+ct5+vuqhWilepz19dgY1c2G Pda0GgY3T5uUeN9bftbVViZLLHL70KwwiIUdEqcADV3QCA+UmmLEnz7vh77u+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778590921; 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=vwOG5znDhcMgDLPrYnImC2zyP2ngMbwPnEprCw0/JbM=; b=vqKmQeC+i+ADGhil6ooTlUvWsRzu8kdRwBE7IPWhdhVxOhjNPwyAa7kiRqEgatsPi/uWBO DIiiPjBbKE3Lp5z9baattQfN4NDC14WahAEOVTZ8XrwKzxnr1W8e1tU8Yut9nQlAXG/4Ow iElVOTiJxIMwIabduvq+RLm4D7NWDr/likr/mv3oaKdq7mLYi9EYqPBZDTpGR1ExlF0Kkp WejQalZj+4kCvsdIF25xKqKL1vRF1Pqz7XXb2eZ6IMrzk4wVXYGEs/iIJjkdL0Ugkrr5pq M6OcQDz7m2hcpfM9JqzLue7sZ6S7iWyx0RxtFYmPepYeC7Dg2PqCb9560VJTRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gFGvY6BxGz13kq for ; Tue, 12 May 2026 13:02:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c7de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 12 May 2026 13:02:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 23b263dfbf5e - main - Revert "mlx5e: Ensure rx timestamps are monotonically increasing" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 23b263dfbf5ec24de2f6e1abc2a4eb04869b3e07 Auto-Submitted: auto-generated Date: Tue, 12 May 2026 13:02:01 +0000 Message-Id: <6a0324c9.1c7de.6615b4a8@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=23b263dfbf5ec24de2f6e1abc2a4eb04869b3e07 commit 23b263dfbf5ec24de2f6e1abc2a4eb04869b3e07 Author: Andrew Gallatin AuthorDate: 2026-05-12 12:55:54 +0000 Commit: Andrew Gallatin CommitDate: 2026-05-12 12:55:54 +0000 Revert "mlx5e: Ensure rx timestamps are monotonically increasing" This reverts commit ce33f96fcf2f2d0d49c406274bcc64df72fe530e. It turns out that doing it this way did indeed prevent backwards movement of timestamps, however it also lead to an ever increasing error, eventually yielding timestamps hundreds or thousands of seconds in the future. Back this out until we can come up with a solution that prevents backards timestamps and also avoids accumulating error. Sponsored by: Netflix --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 50 ------------------------------------- 1 file changed, 50 deletions(-) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 9bcb0dcf8e16..fb8b79c8f787 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1134,25 +1134,6 @@ mlx5e_hw_clock(struct mlx5e_priv *priv) return (((uint64_t)hw_h << 32) | hw_l); } -/* - * Seed the first calibration point so that base_prev and clbr_hw_prev - * are always valid. Called once during attach before the first - * calibration callout fires. - */ -static void -mlx5e_seed_calibration(struct mlx5e_priv *priv) -{ - struct mlx5e_clbr_point *cp; - struct timespec ts; - - cp = &priv->clbr_points[0]; - cp->clbr_hw_curr = mlx5e_hw_clock(priv); - nanouptime(&ts); - cp->base_curr = mlx5e_timespec2usec(&ts); - cp->clbr_hw_prev = cp->clbr_hw_curr - 1; - cp->base_prev = cp->base_curr - 1; -} - /* * The calibration callout, it runs either in the context of the * thread which enables calibration, or in callout. It takes the @@ -1166,9 +1147,6 @@ mlx5e_calibration_callout(void *arg) struct mlx5e_priv *priv; struct mlx5e_clbr_point *next, *curr; struct timespec ts; - uint64_t hw_delta_new, hw_delta_old; - uint64_t old_nsec, old_projected, old_sec; - uint64_t res_n, res_s, res_s_mod, rt_delta_old; int clbr_curr_next; priv = arg; @@ -1197,33 +1175,6 @@ mlx5e_calibration_callout(void *arg) nanouptime(&ts); next->base_curr = mlx5e_timespec2usec(&ts); - /* - * Ensure monotonicity across calibration transitions. Compute - * what the old calibration would extrapolate to at the new - * hw_curr. If the new base_curr is less, clamp it so the new - * slope is at least as steep as the old one. This prevents - * packets from seeing time go backwards when the slope drops. - * - * Use the same split-seconds technique as mlx5e_mbuf_tstmp() - * to avoid overflowing uint64_t in the multiplication. - */ - hw_delta_new = next->clbr_hw_curr - curr->clbr_hw_curr; - rt_delta_old = curr->base_curr - curr->base_prev; - hw_delta_old = curr->clbr_hw_curr - curr->clbr_hw_prev; - old_sec = hw_delta_new / priv->cclk; - old_nsec = hw_delta_new % priv->cclk; - res_s = old_sec * rt_delta_old; - res_n = old_nsec * rt_delta_old; - res_s_mod = res_s % hw_delta_old; - res_s /= hw_delta_old; - res_s_mod *= priv->cclk; - res_n += res_s_mod; - res_n /= hw_delta_old; - res_s *= priv->cclk; - old_projected = curr->base_curr + res_s + res_n; - if (next->base_curr < old_projected) - next->base_curr = old_projected; - curr->clbr_gen = 0; atomic_thread_fence_rel(); priv->clbr_curr = clbr_curr_next; @@ -4936,7 +4887,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) callout_init(&priv->tstmp_clbr, 1); /* Pull out the frequency of the clock in hz */ priv->cclk = (uint64_t)MLX5_CAP_GEN(mdev, device_frequency_khz) * 1000ULL; - mlx5e_seed_calibration(priv); mlx5e_reset_calibration_callout(priv); pa.pa_version = PFIL_VERSION;