Lines Matching full:ipsec
36 #include <dev/mlx5/mlx5_fpga/ipsec.h>
104 mlx5_fpga_warn(fdev, "IPSec command send failed with status %u\n", in mlx5_fpga_ipsec_send_complete()
135 mlx5_fpga_warn(fdev, "Short receive from FPGA IPSec: %u < %zu bytes\n", in mlx5_fpga_ipsec_recv()
143 spin_lock_irqsave(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_recv()
144 context = list_first_entry_or_null(&fdev->ipsec->pending_cmds, in mlx5_fpga_ipsec_recv()
149 spin_unlock_irqrestore(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_recv()
152 mlx5_fpga_warn(fdev, "Received IPSec offload response without pending command request\n"); in mlx5_fpga_ipsec_recv()
169 mlx5_fpga_warn(fdev, "IPSec SADB command failed with syndrome %08x\n", in mlx5_fpga_ipsec_recv()
183 if (!fdev || !fdev->ipsec) in mlx5_fpga_ipsec_sa_cmd_exec()
196 spin_lock_irqsave(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_sa_cmd_exec()
197 list_add_tail(&context->list, &fdev->ipsec->pending_cmds); in mlx5_fpga_ipsec_sa_cmd_exec()
198 spin_unlock_irqrestore(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_sa_cmd_exec()
202 res = mlx5_fpga_sbu_conn_sendmsg(fdev->ipsec->conn, &context->buf); in mlx5_fpga_ipsec_sa_cmd_exec()
204 mlx5_fpga_warn(fdev, "Failure sending IPSec command: %d\n", in mlx5_fpga_ipsec_sa_cmd_exec()
206 spin_lock_irqsave(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_sa_cmd_exec()
208 spin_unlock_irqrestore(&fdev->ipsec->pending_cmds_lock, flags); in mlx5_fpga_ipsec_sa_cmd_exec()
223 mlx5_fpga_warn(context->dev, "Failure waiting for IPSec command response\n"); in mlx5_fpga_ipsec_sa_cmd_wait()
246 if (!fdev->ipsec) in mlx5_fpga_ipsec_device_caps()
249 if (MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, esp)) in mlx5_fpga_ipsec_device_caps()
252 if (MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, ipv6)) in mlx5_fpga_ipsec_device_caps()
255 if (MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, lso)) in mlx5_fpga_ipsec_device_caps()
265 if (!fdev || !fdev->ipsec) in mlx5_fpga_ipsec_counters_count()
268 return MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, in mlx5_fpga_ipsec_counters_count()
282 if (!fdev || !fdev->ipsec) in mlx5_fpga_ipsec_counters_read()
285 addr = (u64)MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, in mlx5_fpga_ipsec_counters_read()
287 ((u64)MLX5_GET(ipsec_extended_cap, fdev->ipsec->caps, in mlx5_fpga_ipsec_counters_read()
301 mlx5_fpga_err(fdev, "Failed to read IPSec counters from HW: %d\n", in mlx5_fpga_ipsec_counters_read()
330 fdev->ipsec = kzalloc(sizeof(*fdev->ipsec), GFP_KERNEL); in mlx5_fpga_ipsec_init()
331 if (!fdev->ipsec) in mlx5_fpga_ipsec_init()
334 err = mlx5_fpga_get_sbu_caps(fdev, sizeof(fdev->ipsec->caps), in mlx5_fpga_ipsec_init()
335 fdev->ipsec->caps); in mlx5_fpga_ipsec_init()
337 mlx5_fpga_err(fdev, "Failed to retrieve IPSec extended capabilities: %d\n", in mlx5_fpga_ipsec_init()
342 INIT_LIST_HEAD(&fdev->ipsec->pending_cmds); in mlx5_fpga_ipsec_init()
343 spin_lock_init(&fdev->ipsec->pending_cmds_lock); in mlx5_fpga_ipsec_init()
352 mlx5_fpga_err(fdev, "Error creating IPSec command connection %d\n", in mlx5_fpga_ipsec_init()
356 fdev->ipsec->conn = conn; in mlx5_fpga_ipsec_init()
360 kfree(fdev->ipsec); in mlx5_fpga_ipsec_init()
361 fdev->ipsec = NULL; in mlx5_fpga_ipsec_init()
372 mlx5_fpga_sbu_conn_destroy(fdev->ipsec->conn); in mlx5_fpga_ipsec_cleanup()
373 kfree(fdev->ipsec); in mlx5_fpga_ipsec_cleanup()
374 fdev->ipsec = NULL; in mlx5_fpga_ipsec_cleanup()