Lines Matching refs:fdev

95 					  struct mlx5_fpga_device *fdev,  in mlx5_fpga_ipsec_send_complete()  argument
104 mlx5_fpga_warn(fdev, "IPSec command send failed with status %u\n", in mlx5_fpga_ipsec_send_complete()
131 struct mlx5_fpga_device *fdev = cb_arg; in mlx5_fpga_ipsec_recv() local
135 mlx5_fpga_warn(fdev, "Short receive from FPGA IPSec: %u < %zu bytes\n", in mlx5_fpga_ipsec_recv()
140 mlx5_fpga_dbg(fdev, "mlx5_ipsec recv_cb syndrome %08x sa_id %x\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()
155 mlx5_fpga_dbg(fdev, "Handling response for %p\n", context); in mlx5_fpga_ipsec_recv()
158 mlx5_fpga_err(fdev, "mismatch SA handle. cmd 0x%08x vs resp 0x%08x\n", in mlx5_fpga_ipsec_recv()
169 mlx5_fpga_warn(fdev, "IPSec SADB command failed with syndrome %08x\n", in mlx5_fpga_ipsec_recv()
178 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_sa_cmd_exec() local
183 if (!fdev || !fdev->ipsec) in mlx5_fpga_ipsec_sa_cmd_exec()
195 context->dev = fdev; 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()
238 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_device_caps() local
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()
263 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_counters_count() local
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()
275 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_counters_read() local
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()
298 ret = mlx5_fpga_mem_read(fdev, count * sizeof(u64), addr, data, 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()
323 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_init() local
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()
348 init_attr.cb_arg = fdev; in mlx5_fpga_ipsec_init()
349 conn = mlx5_fpga_sbu_conn_create(fdev, &init_attr); 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()
367 struct mlx5_fpga_device *fdev = mdev->fpga; in mlx5_fpga_ipsec_cleanup() local
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()