From nobody Tue Aug 20 12:43:46 2024 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 4Wp8KH3mWjz5T442; Tue, 20 Aug 2024 12:43:47 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wp8KG6b7Vz4THf; Tue, 20 Aug 2024 12:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724157826; 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=deR9Xp9+5XUUoHxLB+QvViwBPLuAyQVsoJKkN0n8xkc=; b=iFz4TpIp7RsvZ4m5hlQvdHWczg4VvsTjXtQTcJKHFtjHBz6/VhJjSJqX1KuD3Jkizclsgq lYczKd8Z48Zg58uJKELgbRgxLq39fZstuugybIhcn0u1D8YkkbQniJdA+DZYWpK2SupyhR bFAFSOGAdd5y/8S2l0JkEYhWpCnaAw5u6dY1xtcW/9GlJ8Ozo0L0aGBKYk7Ve55ducgSUZ jTHx7Ofwcy6uKwIURJeKoaEUqhypXkqkgK0+OJVvsnkdfE/icPNMweOZPQlTqpBaWzPTpj 4kxP6qhGbx8epaKeo3xru7i/2DSsbMbbWdRMxIUX0lC5DfIDB5oDBKdrP/7ktQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724157826; a=rsa-sha256; cv=none; b=s0xGWEDblmWJI7qOTErOKCEzNsZl1GUShB5u6hqSuvWKfnsNPY2wXk3xa/EGWH5Hmyi/Y9 g/6MQYu4mahLJ4/siof4u5EcbxLXWzMwj4QxXRT5MD0657KLCbFzY0aCq9GjsNdlwD8fgC d2SojaXmm+it7TXQUU3pLvM7YJwnIzT2BmRRNxopmZlPYdGHpu9EZuL/cK/3z1+a+RU/O7 YoWCe56V8UyGj/ZVvj+XPODLxjfXtqpqRjl0lIdH0xPqom6soEbNJmPr2UqQ4Ykbvf99tM Fu9GZgE2069CsFPwAwa/SzR/Cu5FDMKW9TXfWeTWW5yPAEfUWINCWjTfjH4nDg== 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=1724157826; 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=deR9Xp9+5XUUoHxLB+QvViwBPLuAyQVsoJKkN0n8xkc=; b=rRK9LSjAMpEvBW/F1UJB8mOZUvQRe0T7laHEwMQt5LvuBNeMQAYKVHraMy/P1HLW5X8tZL taSMZ5jrDKK2UejWlk+6FIQ/IufSJELkKsG7Od3BkzJDAdg+MZ7xpzIHZ38a0gEbngcCls Ie3J2MURGTKqcRYAk4CEWkr5v5CiA4tEXoJEeHmvUOKIOFn9nyFDC+tFulRH2alp+YyKEU Qn8xhJrd3fMYj9v9LBzly7IEu+I2juT8tONEFAFUXx0G5u35pgSperNDxWPaoeMIfHnFGT ZD9Z3xQ/qWgQx3qC+O38CYxglG7pQHAwiI2Sl8M1r9vQWYTt5NXC6t/rqI5hcA== 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 4Wp8KG6BlZz10wv; Tue, 20 Aug 2024 12:43:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47KChkIe054318; Tue, 20 Aug 2024 12:43:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47KChkY0054315; Tue, 20 Aug 2024 12:43:46 GMT (envelope-from git) Date: Tue, 20 Aug 2024 12:43:46 GMT Message-Id: <202408201243.47KChkY0054315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 828da10bb3c3 - main - mlx5en: fix destroying tx sa_entry when installing rx sa_entry failed 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 828da10bb3c338b5964e120dd970e649730b7f4f Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=828da10bb3c338b5964e120dd970e649730b7f4f commit 828da10bb3c338b5964e120dd970e649730b7f4f Author: Konstantin Belousov AuthorDate: 2024-08-13 08:38:01 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-20 12:42:12 +0000 mlx5en: fix destroying tx sa_entry when installing rx sa_entry failed In particular, do not cancel freed linux delayed work. Sponsored by: NVidia networking --- sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c index 555847717779..01d1cb28f86d 100644 --- a/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c +++ b/sys/dev/mlx5/mlx5_accel/mlx5_ipsec.c @@ -45,6 +45,8 @@ #define MLX5_IPSEC_RESCHED msecs_to_jiffies(1000) +static void mlx5e_if_sa_deinstall_onekey(struct ifnet *ifp, u_int dev_spi, + void *priv); static int mlx5e_if_sa_deinstall(struct ifnet *ifp, u_int dev_spi, void *priv); static struct mlx5e_ipsec_sa_entry *to_ipsec_sa_entry(void *x) @@ -378,6 +380,7 @@ err_fs: mlx5_ipsec_free_sa_ctx(sa_entry); err_sa_ctx: kfree(sa_entry->dwork); + sa_entry->dwork = NULL; err_xfrm: kfree(sa_entry); mlx5_en_err(ifp, "Device failed to offload this state"); @@ -403,7 +406,9 @@ mlx5e_if_sa_newkey(struct ifnet *ifp, void *sav, u_int dev_spi, void **privp) if (error == 0) { *privp = pb; } else { - mlx5e_if_sa_deinstall(ifp, dev_spi, pb->priv_in); + if (pb->priv_in->dwork != NULL) + cancel_delayed_work_sync(&pb->priv_in->dwork->dwork); + mlx5e_if_sa_deinstall_onekey(ifp, dev_spi, pb->priv_in); free(pb, M_DEVBUF); } return (error);