1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2020 Intel Corporation
10 #include <rte_spinlock.h>
12 #include <rte_bus_pci.h>
15 #define PAGE_SIZE (sysconf(_SC_PAGESIZE))
18 #include "base/dlb2_hw_types.h"
19 #include "../dlb2_user.h"
21 #define DLB2_DEFAULT_UNREGISTER_TIMEOUT_S 5
25 struct dlb2_port_memory {
26 struct dlb2_list_head list;
32 struct rte_pci_device *pdev;
34 /* struct list_head list; */
35 struct device *dlb2_device;
36 bool domain_reset_failed;
37 /* The resource mutex serializes access to driver data structures and
40 rte_spinlock_t resource_mutex;
45 struct dlb2_dev *dlb2_probe(struct rte_pci_device *pdev);
47 int dlb2_pf_reset(struct dlb2_dev *dlb2_dev);
48 int dlb2_pf_create_sched_domain(struct dlb2_hw *hw,
49 struct dlb2_create_sched_domain_args *args,
50 struct dlb2_cmd_response *resp);
51 int dlb2_pf_create_ldb_queue(struct dlb2_hw *hw,
53 struct dlb2_create_ldb_queue_args *args,
54 struct dlb2_cmd_response *resp);
55 int dlb2_pf_create_dir_queue(struct dlb2_hw *hw,
57 struct dlb2_create_dir_queue_args *args,
58 struct dlb2_cmd_response *resp);
59 int dlb2_pf_create_ldb_port(struct dlb2_hw *hw,
61 struct dlb2_create_ldb_port_args *args,
62 uintptr_t cq_dma_base,
63 struct dlb2_cmd_response *resp);
64 int dlb2_pf_create_dir_port(struct dlb2_hw *hw,
66 struct dlb2_create_dir_port_args *args,
67 uintptr_t cq_dma_base,
68 struct dlb2_cmd_response *resp);
69 int dlb2_pf_start_domain(struct dlb2_hw *hw,
71 struct dlb2_start_domain_args *args,
72 struct dlb2_cmd_response *resp);
73 int dlb2_pf_enable_ldb_port(struct dlb2_hw *hw,
75 struct dlb2_enable_ldb_port_args *args,
76 struct dlb2_cmd_response *resp);
77 int dlb2_pf_disable_ldb_port(struct dlb2_hw *hw,
79 struct dlb2_disable_ldb_port_args *args,
80 struct dlb2_cmd_response *resp);
81 int dlb2_pf_enable_dir_port(struct dlb2_hw *hw,
83 struct dlb2_enable_dir_port_args *args,
84 struct dlb2_cmd_response *resp);
85 int dlb2_pf_disable_dir_port(struct dlb2_hw *hw,
87 struct dlb2_disable_dir_port_args *args,
88 struct dlb2_cmd_response *resp);
89 int dlb2_pf_reset_domain(struct dlb2_hw *hw, u32 domain_id);
90 int dlb2_pf_ldb_port_owned_by_domain(struct dlb2_hw *hw,
93 int dlb2_pf_dir_port_owned_by_domain(struct dlb2_hw *hw,
97 #endif /* __DLB2_MAIN_H */