The branch main has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=828da10bb3c338b5964e120dd970e649730b7f4f

commit 828da10bb3c338b5964e120dd970e649730b7f4f
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2024-08-13 08:38:01 +0000
Commit:     Konstantin Belousov <[email protected]>
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);

Reply via email to