opnsense-src/sys/dev/qat/include/common/adf_uio_control.h
Krzysztof Zdziarski 266b0663c5 qat: Add Intel® 4xxx Series VF driver support
Overview:
Intel(R) QuickAssist Technology (Intel(R) QAT) provides hardware
acceleration for offloading security, authentication and compression
services from the CPU, thus significantly increasing the performance and
efficiency of standard platform solutions.

This commit introduces:
- Intel® 4xxx Series VF driver support.
- Device configurability via sysctls.
- UIO support for Intel® 4xxx Series devices.

Patch co-authored by: Krzysztof Zdziarski <krzysztofx.zdziarski@intel.com>
Patch co-authored by: Michal Gulbicki <michalx.gulbicki@intel.com>
Patch co-authored by: Julian Grajkowski <julianx.grajkowski@intel.com>
Patch co-authored by: Piotr Kasierski <piotrx.kasierski@intel.com>
Patch co-authored by: Lukasz Kolodzinski <lukaszx.kolodzinski@intel.com>
Patch co-authored by: Karol Grzadziel <karolx.grzadziel@intel.com>

Sponsored by:	Intel Corporation
Differential Revision: https://reviews.freebsd.org/D39850
2023-06-12 13:44:01 -04:00

43 lines
1 KiB
C

/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright(c) 2007-2023 Intel Corporation */
/* $FreeBSD$ */
#ifndef QAT_UIO_CONTROL_H
#define QAT_UIO_CONTROL_H
#include <sys/condvar.h>
struct adf_uio_instance_rings {
unsigned int user_pid;
u16 ring_mask;
struct list_head list;
};
struct adf_uio_control_bundle {
uint8_t hardware_bundle_number;
bool used;
struct list_head list;
struct mutex list_lock; /* protects list struct */
struct mutex lock; /* protects rings_used and csr_addr */
u16 rings_used;
u32 rings_enabled;
void *csr_addr;
struct qat_uio_bundle_dev uio_priv;
vm_object_t obj;
};
struct adf_uio_control_accel {
struct adf_accel_dev *accel_dev;
struct cdev *cdev;
struct mtx lock;
struct adf_bar *bar;
unsigned int nb_bundles;
unsigned int num_ker_bundles;
unsigned int total_used_bundles;
unsigned int num_handles;
struct cv cleanup_ok;
/* bundle[] must be last to allow dynamic size allocation. */
struct adf_uio_control_bundle bundle[0];
};
#endif /* end of include guard: QAT_UIO_CONTROL_H */