1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020-2021 Xilinx, Inc.
5 #ifndef _SFC_VDPA_OPS_H
6 #define _SFC_VDPA_OPS_H
10 #define SFC_VDPA_MAX_QUEUE_PAIRS 1
12 enum sfc_vdpa_context {
17 SFC_VDPA_STATE_UNINITIALIZED = 0,
18 SFC_VDPA_STATE_INITIALIZED,
19 SFC_VDPA_STATE_CONFIGURING,
20 SFC_VDPA_STATE_CONFIGURED,
21 SFC_VDPA_STATE_CLOSING,
22 SFC_VDPA_STATE_CLOSED,
23 SFC_VDPA_STATE_STARTING,
24 SFC_VDPA_STATE_STARTED,
25 SFC_VDPA_STATE_STOPPING,
28 struct sfc_vdpa_vring_info {
33 uint16_t last_avail_idx;
34 uint16_t last_used_idx;
37 typedef struct sfc_vdpa_vq_context_s {
42 } sfc_vdpa_vq_context_t;
44 struct sfc_vdpa_ops_data {
47 struct rte_vdpa_device *vdpa_dev;
48 enum sfc_vdpa_context vdpa_context;
49 enum sfc_vdpa_state state;
51 bool is_notify_thread_started;
53 uint64_t dev_features;
54 uint64_t drv_features;
55 uint64_t req_features;
58 struct sfc_vdpa_vq_context_s vq_cxt[SFC_VDPA_MAX_QUEUE_PAIRS * 2];
61 struct sfc_vdpa_ops_data *
62 sfc_vdpa_device_init(void *adapter, enum sfc_vdpa_context context);
64 sfc_vdpa_device_fini(struct sfc_vdpa_ops_data *ops_data);
66 #endif /* _SFC_VDPA_OPS_H */