diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2015-12-04 19:56:34 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2015-12-09 07:03:52 -0500 |
commit | 890c55f4dc0e60a4ba71ab9b6877f69ff7053213 (patch) | |
tree | 792f34b8a2bff2c9818952bf15fe7dc7da5596b8 | |
parent | 1a72d3a6d1d9a08705546eba14f0390c565ccd24 (diff) |
crypto: qat - add support for c3xxx accel type
Add support for c3xxx accel type.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/qat/Kconfig | 11 | ||||
-rw-r--r-- | drivers/crypto/qat/Makefile | 1 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_c3xxx/Makefile | 3 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c | 248 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.h | 84 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_c3xxx/adf_drv.c | 335 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_cfg_common.h | 1 | ||||
-rw-r--r-- | drivers/crypto/qat/qat_common/adf_dev_mgr.c | 36 |
8 files changed, 714 insertions, 5 deletions
diff --git a/drivers/crypto/qat/Kconfig b/drivers/crypto/qat/Kconfig index eefccf7b8be7..7b3e791ae2d6 100644 --- a/drivers/crypto/qat/Kconfig +++ b/drivers/crypto/qat/Kconfig | |||
@@ -22,6 +22,17 @@ config CRYPTO_DEV_QAT_DH895xCC | |||
22 | To compile this as a module, choose M here: the module | 22 | To compile this as a module, choose M here: the module |
23 | will be called qat_dh895xcc. | 23 | will be called qat_dh895xcc. |
24 | 24 | ||
25 | config CRYPTO_DEV_QAT_C3XXX | ||
26 | tristate "Support for Intel(R) C3XXX" | ||
27 | depends on X86 && PCI | ||
28 | select CRYPTO_DEV_QAT | ||
29 | help | ||
30 | Support for Intel(R) C3xxx with Intel(R) QuickAssist Technology | ||
31 | for accelerating crypto and compression workloads. | ||
32 | |||
33 | To compile this as a module, choose M here: the module | ||
34 | will be called qat_c3xxx. | ||
35 | |||
25 | config CRYPTO_DEV_QAT_DH895xCCVF | 36 | config CRYPTO_DEV_QAT_DH895xCCVF |
26 | tristate "Support for Intel(R) DH895xCC Virtual Function" | 37 | tristate "Support for Intel(R) DH895xCC Virtual Function" |
27 | depends on X86 && PCI | 38 | depends on X86 && PCI |
diff --git a/drivers/crypto/qat/Makefile b/drivers/crypto/qat/Makefile index a3ce0b70e32f..e08d66031bcc 100644 --- a/drivers/crypto/qat/Makefile +++ b/drivers/crypto/qat/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | obj-$(CONFIG_CRYPTO_DEV_QAT) += qat_common/ | 1 | obj-$(CONFIG_CRYPTO_DEV_QAT) += qat_common/ |
2 | obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCC) += qat_dh895xcc/ | 2 | obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCC) += qat_dh895xcc/ |
3 | obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXX) += qat_c3xxx/ | ||
3 | obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCCVF) += qat_dh895xccvf/ | 4 | obj-$(CONFIG_CRYPTO_DEV_QAT_DH895xCCVF) += qat_dh895xccvf/ |
diff --git a/drivers/crypto/qat/qat_c3xxx/Makefile b/drivers/crypto/qat/qat_c3xxx/Makefile new file mode 100644 index 000000000000..8f5fd4838a96 --- /dev/null +++ b/drivers/crypto/qat/qat_c3xxx/Makefile | |||
@@ -0,0 +1,3 @@ | |||
1 | ccflags-y := -I$(src)/../qat_common | ||
2 | obj-$(CONFIG_CRYPTO_DEV_QAT_C3XXX) += qat_c3xxx.o | ||
3 | qat_c3xxx-objs := adf_drv.o adf_c3xxx_hw_data.o | ||
diff --git a/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c b/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c new file mode 100644 index 000000000000..bda8f9f789b9 --- /dev/null +++ b/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.c | |||
@@ -0,0 +1,248 @@ | |||
1 | /* | ||
2 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | redistributing this file, you may do so under either license. | ||
4 | |||
5 | GPL LICENSE SUMMARY | ||
6 | Copyright(c) 2014 Intel Corporation. | ||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of version 2 of the GNU General Public License as | ||
9 | published by the Free Software Foundation. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, but | ||
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | General Public License for more details. | ||
15 | |||
16 | Contact Information: | ||
17 | qat-linux@intel.com | ||
18 | |||
19 | BSD LICENSE | ||
20 | Copyright(c) 2014 Intel Corporation. | ||
21 | Redistribution and use in source and binary forms, with or without | ||
22 | modification, are permitted provided that the following conditions | ||
23 | are met: | ||
24 | |||
25 | * Redistributions of source code must retain the above copyright | ||
26 | notice, this list of conditions and the following disclaimer. | ||
27 | * Redistributions in binary form must reproduce the above copyright | ||
28 | notice, this list of conditions and the following disclaimer in | ||
29 | the documentation and/or other materials provided with the | ||
30 | distribution. | ||
31 | * Neither the name of Intel Corporation nor the names of its | ||
32 | contributors may be used to endorse or promote products derived | ||
33 | from this software without specific prior written permission. | ||
34 | |||
35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
36 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
37 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
38 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
39 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
40 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
41 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
42 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
43 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
44 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
46 | */ | ||
47 | #include <adf_accel_devices.h> | ||
48 | #include <adf_common_drv.h> | ||
49 | #include <adf_pf2vf_msg.h> | ||
50 | #include "adf_c3xxx_hw_data.h" | ||
51 | |||
52 | /* Worker thread to service arbiter mappings based on dev SKUs */ | ||
53 | static const u32 thrd_to_arb_map_8_me_sku[] = { | ||
54 | 0x10000888, 0x11000888, 0x10000888, 0x11000888, 0x10000888, | ||
55 | 0x11000888, 0x10000888, 0x11000888, 0, 0 | ||
56 | }; | ||
57 | |||
58 | static const u32 thrd_to_arb_map_10_me_sku[] = { | ||
59 | 0x12222AAA, 0x11222AAA, 0x12222AAA, 0x11222AAA, 0x12222AAA, | ||
60 | 0x11222AAA, 0x12222AAA, 0x11222AAA, 0x12222AAA, 0x11222AAA | ||
61 | }; | ||
62 | |||
63 | static struct adf_hw_device_class c3xxx_class = { | ||
64 | .name = ADF_C3XXX_DEVICE_NAME, | ||
65 | .type = DEV_C3XXX, | ||
66 | .instances = 0 | ||
67 | }; | ||
68 | |||
69 | static u32 get_accel_mask(u32 fuse) | ||
70 | { | ||
71 | return (~fuse) >> ADF_C3XXX_ACCELERATORS_REG_OFFSET & | ||
72 | ADF_C3XXX_ACCELERATORS_MASK; | ||
73 | } | ||
74 | |||
75 | static u32 get_ae_mask(u32 fuse) | ||
76 | { | ||
77 | return (~fuse) & ADF_C3XXX_ACCELENGINES_MASK; | ||
78 | } | ||
79 | |||
80 | static u32 get_num_accels(struct adf_hw_device_data *self) | ||
81 | { | ||
82 | u32 i, ctr = 0; | ||
83 | |||
84 | if (!self || !self->accel_mask) | ||
85 | return 0; | ||
86 | |||
87 | for (i = 0; i < ADF_C3XXX_MAX_ACCELERATORS; i++) { | ||
88 | if (self->accel_mask & (1 << i)) | ||
89 | ctr++; | ||
90 | } | ||
91 | return ctr; | ||
92 | } | ||
93 | |||
94 | static u32 get_num_aes(struct adf_hw_device_data *self) | ||
95 | { | ||
96 | u32 i, ctr = 0; | ||
97 | |||
98 | if (!self || !self->ae_mask) | ||
99 | return 0; | ||
100 | |||
101 | for (i = 0; i < ADF_C3XXX_MAX_ACCELENGINES; i++) { | ||
102 | if (self->ae_mask & (1 << i)) | ||
103 | ctr++; | ||
104 | } | ||
105 | return ctr; | ||
106 | } | ||
107 | |||
108 | static u32 get_misc_bar_id(struct adf_hw_device_data *self) | ||
109 | { | ||
110 | return ADF_C3XXX_PMISC_BAR; | ||
111 | } | ||
112 | |||
113 | static u32 get_etr_bar_id(struct adf_hw_device_data *self) | ||
114 | { | ||
115 | return ADF_C3XXX_ETR_BAR; | ||
116 | } | ||
117 | |||
118 | static u32 get_sram_bar_id(struct adf_hw_device_data *self) | ||
119 | { | ||
120 | return ADF_C3XXX_SRAM_BAR; | ||
121 | } | ||
122 | |||
123 | static enum dev_sku_info get_sku(struct adf_hw_device_data *self) | ||
124 | { | ||
125 | int aes = get_num_aes(self); | ||
126 | |||
127 | if (aes == 8) | ||
128 | return DEV_SKU_2; | ||
129 | else if (aes == 10) | ||
130 | return DEV_SKU_4; | ||
131 | |||
132 | return DEV_SKU_UNKNOWN; | ||
133 | } | ||
134 | |||
135 | static void adf_get_arbiter_mapping(struct adf_accel_dev *accel_dev, | ||
136 | u32 const **arb_map_config) | ||
137 | { | ||
138 | switch (accel_dev->accel_pci_dev.sku) { | ||
139 | case DEV_SKU_2: | ||
140 | *arb_map_config = thrd_to_arb_map_8_me_sku; | ||
141 | break; | ||
142 | case DEV_SKU_4: | ||
143 | *arb_map_config = thrd_to_arb_map_10_me_sku; | ||
144 | break; | ||
145 | default: | ||
146 | dev_err(&GET_DEV(accel_dev), | ||
147 | "The configuration doesn't match any SKU"); | ||
148 | *arb_map_config = NULL; | ||
149 | } | ||
150 | } | ||
151 | |||
152 | static u32 get_pf2vf_offset(u32 i) | ||
153 | { | ||
154 | return ADF_C3XXX_PF2VF_OFFSET(i); | ||
155 | } | ||
156 | |||
157 | static u32 get_vintmsk_offset(u32 i) | ||
158 | { | ||
159 | return ADF_C3XXX_VINTMSK_OFFSET(i); | ||
160 | } | ||
161 | |||
162 | static void adf_enable_error_correction(struct adf_accel_dev *accel_dev) | ||
163 | { | ||
164 | struct adf_hw_device_data *hw_device = accel_dev->hw_device; | ||
165 | struct adf_bar *misc_bar = &GET_BARS(accel_dev)[ADF_C3XXX_PMISC_BAR]; | ||
166 | void __iomem *csr = misc_bar->virt_addr; | ||
167 | unsigned int val, i; | ||
168 | |||
169 | /* Enable Accel Engine error detection & correction */ | ||
170 | for (i = 0; i < hw_device->get_num_aes(hw_device); i++) { | ||
171 | val = ADF_CSR_RD(csr, ADF_C3XXX_AE_CTX_ENABLES(i)); | ||
172 | val |= ADF_C3XXX_ENABLE_AE_ECC_ERR; | ||
173 | ADF_CSR_WR(csr, ADF_C3XXX_AE_CTX_ENABLES(i), val); | ||
174 | val = ADF_CSR_RD(csr, ADF_C3XXX_AE_MISC_CONTROL(i)); | ||
175 | val |= ADF_C3XXX_ENABLE_AE_ECC_PARITY_CORR; | ||
176 | ADF_CSR_WR(csr, ADF_C3XXX_AE_MISC_CONTROL(i), val); | ||
177 | } | ||
178 | |||
179 | /* Enable shared memory error detection & correction */ | ||
180 | for (i = 0; i < hw_device->get_num_accels(hw_device); i++) { | ||
181 | val = ADF_CSR_RD(csr, ADF_C3XXX_UERRSSMSH(i)); | ||
182 | val |= ADF_C3XXX_ERRSSMSH_EN; | ||
183 | ADF_CSR_WR(csr, ADF_C3XXX_UERRSSMSH(i), val); | ||
184 | val = ADF_CSR_RD(csr, ADF_C3XXX_CERRSSMSH(i)); | ||
185 | val |= ADF_C3XXX_ERRSSMSH_EN; | ||
186 | ADF_CSR_WR(csr, ADF_C3XXX_CERRSSMSH(i), val); | ||
187 | } | ||
188 | } | ||
189 | |||
190 | static void adf_enable_ints(struct adf_accel_dev *accel_dev) | ||
191 | { | ||
192 | void __iomem *addr; | ||
193 | |||
194 | addr = (&GET_BARS(accel_dev)[ADF_C3XXX_PMISC_BAR])->virt_addr; | ||
195 | |||
196 | /* Enable bundle and misc interrupts */ | ||
197 | ADF_CSR_WR(addr, ADF_C3XXX_SMIAPF0_MASK_OFFSET, | ||
198 | ADF_C3XXX_SMIA0_MASK); | ||
199 | ADF_CSR_WR(addr, ADF_C3XXX_SMIAPF1_MASK_OFFSET, | ||
200 | ADF_C3XXX_SMIA1_MASK); | ||
201 | } | ||
202 | |||
203 | static int adf_pf_enable_vf2pf_comms(struct adf_accel_dev *accel_dev) | ||
204 | { | ||
205 | return 0; | ||
206 | } | ||
207 | |||
208 | void adf_init_hw_data_c3xxx(struct adf_hw_device_data *hw_data) | ||
209 | { | ||
210 | hw_data->dev_class = &c3xxx_class; | ||
211 | hw_data->instance_id = c3xxx_class.instances++; | ||
212 | hw_data->num_banks = ADF_C3XXX_ETR_MAX_BANKS; | ||
213 | hw_data->num_accel = ADF_C3XXX_MAX_ACCELERATORS; | ||
214 | hw_data->num_logical_accel = 1; | ||
215 | hw_data->num_engines = ADF_C3XXX_MAX_ACCELENGINES; | ||
216 | hw_data->tx_rx_gap = ADF_C3XXX_RX_RINGS_OFFSET; | ||
217 | hw_data->tx_rings_mask = ADF_C3XXX_TX_RINGS_MASK; | ||
218 | hw_data->alloc_irq = adf_isr_resource_alloc; | ||
219 | hw_data->free_irq = adf_isr_resource_free; | ||
220 | hw_data->enable_error_correction = adf_enable_error_correction; | ||
221 | hw_data->get_accel_mask = get_accel_mask; | ||
222 | hw_data->get_ae_mask = get_ae_mask; | ||
223 | hw_data->get_num_accels = get_num_accels; | ||
224 | hw_data->get_num_aes = get_num_aes; | ||
225 | hw_data->get_sram_bar_id = get_sram_bar_id; | ||
226 | hw_data->get_etr_bar_id = get_etr_bar_id; | ||
227 | hw_data->get_misc_bar_id = get_misc_bar_id; | ||
228 | hw_data->get_pf2vf_offset = get_pf2vf_offset; | ||
229 | hw_data->get_vintmsk_offset = get_vintmsk_offset; | ||
230 | hw_data->get_sku = get_sku; | ||
231 | hw_data->fw_name = ADF_C3XXX_FW; | ||
232 | hw_data->fw_mmp_name = ADF_C3XXX_MMP; | ||
233 | hw_data->init_admin_comms = adf_init_admin_comms; | ||
234 | hw_data->exit_admin_comms = adf_exit_admin_comms; | ||
235 | hw_data->disable_iov = adf_disable_sriov; | ||
236 | hw_data->send_admin_init = adf_send_admin_init; | ||
237 | hw_data->init_arb = adf_init_arb; | ||
238 | hw_data->exit_arb = adf_exit_arb; | ||
239 | hw_data->get_arb_mapping = adf_get_arbiter_mapping; | ||
240 | hw_data->enable_ints = adf_enable_ints; | ||
241 | hw_data->enable_vf2pf_comms = adf_pf_enable_vf2pf_comms; | ||
242 | hw_data->min_iov_compat_ver = ADF_PFVF_COMPATIBILITY_VERSION; | ||
243 | } | ||
244 | |||
245 | void adf_clean_hw_data_c3xxx(struct adf_hw_device_data *hw_data) | ||
246 | { | ||
247 | hw_data->dev_class->instances--; | ||
248 | } | ||
diff --git a/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.h b/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.h new file mode 100644 index 000000000000..f2fa23458c8c --- /dev/null +++ b/drivers/crypto/qat/qat_c3xxx/adf_c3xxx_hw_data.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /* | ||
2 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | redistributing this file, you may do so under either license. | ||
4 | |||
5 | GPL LICENSE SUMMARY | ||
6 | Copyright(c) 2014 Intel Corporation. | ||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of version 2 of the GNU General Public License as | ||
9 | published by the Free Software Foundation. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, but | ||
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | General Public License for more details. | ||
15 | |||
16 | Contact Information: | ||
17 | qat-linux@intel.com | ||
18 | |||
19 | BSD LICENSE | ||
20 | Copyright(c) 2014 Intel Corporation. | ||
21 | Redistribution and use in source and binary forms, with or without | ||
22 | modification, are permitted provided that the following conditions | ||
23 | are met: | ||
24 | |||
25 | * Redistributions of source code must retain the above copyright | ||
26 | notice, this list of conditions and the following disclaimer. | ||
27 | * Redistributions in binary form must reproduce the above copyright | ||
28 | notice, this list of conditions and the following disclaimer in | ||
29 | the documentation and/or other materials provided with the | ||
30 | distribution. | ||
31 | * Neither the name of Intel Corporation nor the names of its | ||
32 | contributors may be used to endorse or promote products derived | ||
33 | from this software without specific prior written permission. | ||
34 | |||
35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
36 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
37 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
38 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
39 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
40 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
41 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
42 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
43 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
44 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
46 | */ | ||
47 | #ifndef ADF_C3XXX_HW_DATA_H_ | ||
48 | #define ADF_C3XXX_HW_DATA_H_ | ||
49 | |||
50 | /* PCIe configuration space */ | ||
51 | #define ADF_C3XXX_SRAM_BAR 0 | ||
52 | #define ADF_C3XXX_PMISC_BAR 1 | ||
53 | #define ADF_C3XXX_ETR_BAR 2 | ||
54 | #define ADF_C3XXX_RX_RINGS_OFFSET 8 | ||
55 | #define ADF_C3XXX_TX_RINGS_MASK 0xFF | ||
56 | #define ADF_C3XXX_MAX_ACCELERATORS 3 | ||
57 | #define ADF_C3XXX_MAX_ACCELENGINES 6 | ||
58 | #define ADF_C3XXX_ACCELERATORS_REG_OFFSET 16 | ||
59 | #define ADF_C3XXX_ACCELERATORS_MASK 0x3 | ||
60 | #define ADF_C3XXX_ACCELENGINES_MASK 0x3F | ||
61 | #define ADF_C3XXX_ETR_MAX_BANKS 16 | ||
62 | #define ADF_C3XXX_SMIAPF0_MASK_OFFSET (0x3A000 + 0x28) | ||
63 | #define ADF_C3XXX_SMIAPF1_MASK_OFFSET (0x3A000 + 0x30) | ||
64 | #define ADF_C3XXX_SMIA0_MASK 0xFFFF | ||
65 | #define ADF_C3XXX_SMIA1_MASK 0x1 | ||
66 | /* Error detection and correction */ | ||
67 | #define ADF_C3XXX_AE_CTX_ENABLES(i) (i * 0x1000 + 0x20818) | ||
68 | #define ADF_C3XXX_AE_MISC_CONTROL(i) (i * 0x1000 + 0x20960) | ||
69 | #define ADF_C3XXX_ENABLE_AE_ECC_ERR BIT(28) | ||
70 | #define ADF_C3XXX_ENABLE_AE_ECC_PARITY_CORR (BIT(24) | BIT(12)) | ||
71 | #define ADF_C3XXX_UERRSSMSH(i) (i * 0x4000 + 0x18) | ||
72 | #define ADF_C3XXX_CERRSSMSH(i) (i * 0x4000 + 0x10) | ||
73 | #define ADF_C3XXX_ERRSSMSH_EN BIT(3) | ||
74 | |||
75 | #define ADF_C3XXX_PF2VF_OFFSET(i) (0x3A000 + 0x280 + ((i) * 0x04)) | ||
76 | #define ADF_C3XXX_VINTMSK_OFFSET(i) (0x3A000 + 0x200 + ((i) * 0x04)) | ||
77 | |||
78 | /* Firmware Binary */ | ||
79 | #define ADF_C3XXX_FW "qat_c3xxx.bin" | ||
80 | #define ADF_C3XXX_MMP "qat_c3xxx_mmp.bin" | ||
81 | |||
82 | void adf_init_hw_data_c3xxx(struct adf_hw_device_data *hw_data); | ||
83 | void adf_clean_hw_data_c3xxx(struct adf_hw_device_data *hw_data); | ||
84 | #endif | ||
diff --git a/drivers/crypto/qat/qat_c3xxx/adf_drv.c b/drivers/crypto/qat/qat_c3xxx/adf_drv.c new file mode 100644 index 000000000000..e13bd08ddd1e --- /dev/null +++ b/drivers/crypto/qat/qat_c3xxx/adf_drv.c | |||
@@ -0,0 +1,335 @@ | |||
1 | /* | ||
2 | This file is provided under a dual BSD/GPLv2 license. When using or | ||
3 | redistributing this file, you may do so under either license. | ||
4 | |||
5 | GPL LICENSE SUMMARY | ||
6 | Copyright(c) 2014 Intel Corporation. | ||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of version 2 of the GNU General Public License as | ||
9 | published by the Free Software Foundation. | ||
10 | |||
11 | This program is distributed in the hope that it will be useful, but | ||
12 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
14 | General Public License for more details. | ||
15 | |||
16 | Contact Information: | ||
17 | qat-linux@intel.com | ||
18 | |||
19 | BSD LICENSE | ||
20 | Copyright(c) 2014 Intel Corporation. | ||
21 | Redistribution and use in source and binary forms, with or without | ||
22 | modification, are permitted provided that the following conditions | ||
23 | are met: | ||
24 | |||
25 | * Redistributions of source code must retain the above copyright | ||
26 | notice, this list of conditions and the following disclaimer. | ||
27 | * Redistributions in binary form must reproduce the above copyright | ||
28 | notice, this list of conditions and the following disclaimer in | ||
29 | the documentation and/or other materials provided with the | ||
30 | distribution. | ||
31 | * Neither the name of Intel Corporation nor the names of its | ||
32 | contributors may be used to endorse or promote products derived | ||
33 | from this software without specific prior written permission. | ||
34 | |||
35 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
36 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
37 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
38 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
39 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
40 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
41 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
42 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
43 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
44 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
46 | */ | ||
47 | #include <linux/kernel.h> | ||
48 | #include <linux/module.h> | ||
49 | #include <linux/pci.h> | ||
50 | #include <linux/init.h> | ||
51 | #include <linux/types.h> | ||
52 | #include <linux/fs.h> | ||
53 | #include <linux/slab.h> | ||
54 | #include <linux/errno.h> | ||
55 | #include <linux/device.h> | ||
56 | #include <linux/dma-mapping.h> | ||
57 | #include <linux/platform_device.h> | ||
58 | #include <linux/workqueue.h> | ||
59 | #include <linux/io.h> | ||
60 | #include <adf_accel_devices.h> | ||
61 | #include <adf_common_drv.h> | ||
62 | #include <adf_cfg.h> | ||
63 | #include "adf_c3xxx_hw_data.h" | ||
64 | |||
65 | #define ADF_SYSTEM_DEVICE(device_id) \ | ||
66 | {PCI_DEVICE(PCI_VENDOR_ID_INTEL, device_id)} | ||
67 | |||
68 | static const struct pci_device_id adf_pci_tbl[] = { | ||
69 | ADF_SYSTEM_DEVICE(ADF_C3XXX_PCI_DEVICE_ID), | ||
70 | {0,} | ||
71 | }; | ||
72 | MODULE_DEVICE_TABLE(pci, adf_pci_tbl); | ||
73 | |||
74 | static int adf_probe(struct pci_dev *dev, const struct pci_device_id *ent); | ||
75 | static void adf_remove(struct pci_dev *dev); | ||
76 | |||
77 | static struct pci_driver adf_driver = { | ||
78 | .id_table = adf_pci_tbl, | ||
79 | .name = ADF_C3XXX_DEVICE_NAME, | ||
80 | .probe = adf_probe, | ||
81 | .remove = adf_remove, | ||
82 | .sriov_configure = adf_sriov_configure, | ||
83 | }; | ||
84 | |||
85 | static void adf_cleanup_pci_dev(struct adf_accel_dev *accel_dev) | ||
86 | { | ||
87 | pci_release_regions(accel_dev->accel_pci_dev.pci_dev); | ||
88 | pci_disable_device(accel_dev->accel_pci_dev.pci_dev); | ||
89 | } | ||
90 | |||
91 | static void adf_cleanup_accel(struct adf_accel_dev *accel_dev) | ||
92 | { | ||
93 | struct adf_accel_pci *accel_pci_dev = &accel_dev->accel_pci_dev; | ||
94 | int i; | ||
95 | |||
96 | for (i = 0; i < ADF_PCI_MAX_BARS; i++) { | ||
97 | struct adf_bar *bar = &accel_pci_dev->pci_bars[i]; | ||
98 | |||
99 | if (bar->virt_addr) | ||
100 | pci_iounmap(accel_pci_dev->pci_dev, bar->virt_addr); | ||
101 | } | ||
102 | |||
103 | if (accel_dev->hw_device) { | ||
104 | switch (accel_pci_dev->pci_dev->device) { | ||
105 | case ADF_C3XXX_PCI_DEVICE_ID: | ||
106 | adf_clean_hw_data_c3xxx(accel_dev->hw_device); | ||
107 | break; | ||
108 | default: | ||
109 | break; | ||
110 | } | ||
111 | kfree(accel_dev->hw_device); | ||
112 | accel_dev->hw_device = NULL; | ||
113 | } | ||
114 | adf_cfg_dev_remove(accel_dev); | ||
115 | debugfs_remove(accel_dev->debugfs_dir); | ||
116 | adf_devmgr_rm_dev(accel_dev, NULL); | ||
117 | } | ||
118 | |||
119 | static int adf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | ||
120 | { | ||
121 | struct adf_accel_dev *accel_dev; | ||
122 | struct adf_accel_pci *accel_pci_dev; | ||
123 | struct adf_hw_device_data *hw_data; | ||
124 | char name[ADF_DEVICE_NAME_LENGTH]; | ||
125 | unsigned int i, bar_nr; | ||
126 | int ret, bar_mask; | ||
127 | |||
128 | switch (ent->device) { | ||
129 | case ADF_C3XXX_PCI_DEVICE_ID: | ||
130 | break; | ||
131 | default: | ||
132 | dev_err(&pdev->dev, "Invalid device 0x%x.\n", ent->device); | ||
133 | return -ENODEV; | ||
134 | } | ||
135 | |||
136 | if (num_possible_nodes() > 1 && dev_to_node(&pdev->dev) < 0) { | ||
137 | /* If the accelerator is connected to a node with no memory | ||
138 | * there is no point in using the accelerator since the remote | ||
139 | * memory transaction will be very slow. */ | ||
140 | dev_err(&pdev->dev, "Invalid NUMA configuration.\n"); | ||
141 | return -EINVAL; | ||
142 | } | ||
143 | |||
144 | accel_dev = kzalloc_node(sizeof(*accel_dev), GFP_KERNEL, | ||
145 | dev_to_node(&pdev->dev)); | ||
146 | if (!accel_dev) | ||
147 | return -ENOMEM; | ||
148 | |||
149 | INIT_LIST_HEAD(&accel_dev->crypto_list); | ||
150 | accel_pci_dev = &accel_dev->accel_pci_dev; | ||
151 | accel_pci_dev->pci_dev = pdev; | ||
152 | |||
153 | /* Add accel device to accel table. | ||
154 | * This should be called before adf_cleanup_accel is called */ | ||
155 | if (adf_devmgr_add_dev(accel_dev, NULL)) { | ||
156 | dev_err(&pdev->dev, "Failed to add new accelerator device.\n"); | ||
157 | kfree(accel_dev); | ||
158 | return -EFAULT; | ||
159 | } | ||
160 | |||
161 | accel_dev->owner = THIS_MODULE; | ||
162 | /* Allocate and configure device configuration structure */ | ||
163 | hw_data = kzalloc_node(sizeof(*hw_data), GFP_KERNEL, | ||
164 | dev_to_node(&pdev->dev)); | ||
165 | if (!hw_data) { | ||
166 | ret = -ENOMEM; | ||
167 | goto out_err; | ||
168 | } | ||
169 | |||
170 | accel_dev->hw_device = hw_data; | ||
171 | adf_init_hw_data_c3xxx(accel_dev->hw_device); | ||
172 | pci_read_config_byte(pdev, PCI_REVISION_ID, &accel_pci_dev->revid); | ||
173 | pci_read_config_dword(pdev, ADF_DEVICE_FUSECTL_OFFSET, | ||
174 | &hw_data->fuses); | ||
175 | |||
176 | /* Get Accelerators and Accelerators Engines masks */ | ||
177 | hw_data->accel_mask = hw_data->get_accel_mask(hw_data->fuses); | ||
178 | hw_data->ae_mask = hw_data->get_ae_mask(hw_data->fuses); | ||
179 | accel_pci_dev->sku = hw_data->get_sku(hw_data); | ||
180 | /* If the device has no acceleration engines then ignore it. */ | ||
181 | if (!hw_data->accel_mask || !hw_data->ae_mask || | ||
182 | ((~hw_data->ae_mask) & 0x01)) { | ||
183 | dev_err(&pdev->dev, "No acceleration units found"); | ||
184 | ret = -EFAULT; | ||
185 | goto out_err; | ||
186 | } | ||
187 | |||
188 | /* Create dev top level debugfs entry */ | ||
189 | snprintf(name, sizeof(name), "%s%s_%02x:%02d.%02d", | ||
190 | ADF_DEVICE_NAME_PREFIX, hw_data->dev_class->name, | ||
191 | pdev->bus->number, PCI_SLOT(pdev->devfn), | ||
192 | PCI_FUNC(pdev->devfn)); | ||
193 | |||
194 | accel_dev->debugfs_dir = debugfs_create_dir(name, NULL); | ||
195 | if (!accel_dev->debugfs_dir) { | ||
196 | dev_err(&pdev->dev, "Could not create debugfs dir %s\n", name); | ||
197 | ret = -EINVAL; | ||
198 | goto out_err; | ||
199 | } | ||
200 | |||
201 | /* Create device configuration table */ | ||
202 | ret = adf_cfg_dev_add(accel_dev); | ||
203 | if (ret) | ||
204 | goto out_err; | ||
205 | |||
206 | /* enable PCI device */ | ||
207 | if (pci_enable_device(pdev)) { | ||
208 | ret = -EFAULT; | ||
209 | goto out_err; | ||
210 | } | ||
211 | |||
212 | /* set dma identifier */ | ||
213 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) { | ||
214 | if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)))) { | ||
215 | dev_err(&pdev->dev, "No usable DMA configuration\n"); | ||
216 | ret = -EFAULT; | ||
217 | goto out_err_disable; | ||
218 | } else { | ||
219 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); | ||
220 | } | ||
221 | |||
222 | } else { | ||
223 | pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)); | ||
224 | } | ||
225 | |||
226 | if (pci_request_regions(pdev, ADF_C3XXX_DEVICE_NAME)) { | ||
227 | ret = -EFAULT; | ||
228 | goto out_err_disable; | ||
229 | } | ||
230 | |||
231 | /* Read accelerator capabilities mask */ | ||
232 | pci_read_config_dword(pdev, ADF_DEVICE_LEGFUSE_OFFSET, | ||
233 | &hw_data->accel_capabilities_mask); | ||
234 | |||
235 | /* Find and map all the device's BARS */ | ||
236 | i = 0; | ||
237 | bar_mask = pci_select_bars(pdev, IORESOURCE_MEM); | ||
238 | for_each_set_bit(bar_nr, (const unsigned long *)&bar_mask, | ||
239 | ADF_PCI_MAX_BARS * 2) { | ||
240 | struct adf_bar *bar = &accel_pci_dev->pci_bars[i++]; | ||
241 | |||
242 | bar->base_addr = pci_resource_start(pdev, bar_nr); | ||
243 | if (!bar->base_addr) | ||
244 | break; | ||
245 | bar->size = pci_resource_len(pdev, bar_nr); | ||
246 | bar->virt_addr = pci_iomap(accel_pci_dev->pci_dev, bar_nr, 0); | ||
247 | if (!bar->virt_addr) { | ||
248 | dev_err(&pdev->dev, "Failed to map BAR %d\n", bar_nr); | ||
249 | ret = -EFAULT; | ||
250 | goto out_err_free_reg; | ||
251 | } | ||
252 | } | ||
253 | pci_set_master(pdev); | ||
254 | |||
255 | if (adf_enable_aer(accel_dev, &adf_driver)) { | ||
256 | dev_err(&pdev->dev, "Failed to enable aer\n"); | ||
257 | ret = -EFAULT; | ||
258 | goto out_err_free_reg; | ||
259 | } | ||
260 | |||
261 | if (pci_save_state(pdev)) { | ||
262 | dev_err(&pdev->dev, "Failed to save pci state\n"); | ||
263 | ret = -ENOMEM; | ||
264 | goto out_err_free_reg; | ||
265 | } | ||
266 | |||
267 | ret = qat_crypto_dev_config(accel_dev); | ||
268 | if (ret) | ||
269 | goto out_err_free_reg; | ||
270 | |||
271 | ret = adf_dev_init(accel_dev); | ||
272 | if (ret) | ||
273 | goto out_err_dev_shutdown; | ||
274 | |||
275 | ret = adf_dev_start(accel_dev); | ||
276 | if (ret) | ||
277 | goto out_err_dev_stop; | ||
278 | |||
279 | return ret; | ||
280 | |||
281 | out_err_dev_stop: | ||
282 | adf_dev_stop(accel_dev); | ||
283 | out_err_dev_shutdown: | ||
284 | adf_dev_shutdown(accel_dev); | ||
285 | out_err_free_reg: | ||
286 | pci_release_regions(accel_pci_dev->pci_dev); | ||
287 | out_err_disable: | ||
288 | pci_disable_device(accel_pci_dev->pci_dev); | ||
289 | out_err: | ||
290 | adf_cleanup_accel(accel_dev); | ||
291 | kfree(accel_dev); | ||
292 | return ret; | ||
293 | } | ||
294 | |||
295 | static void adf_remove(struct pci_dev *pdev) | ||
296 | { | ||
297 | struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); | ||
298 | |||
299 | if (!accel_dev) { | ||
300 | pr_err("QAT: Driver removal failed\n"); | ||
301 | return; | ||
302 | } | ||
303 | if (adf_dev_stop(accel_dev)) | ||
304 | dev_err(&GET_DEV(accel_dev), "Failed to stop QAT accel dev\n"); | ||
305 | |||
306 | adf_dev_shutdown(accel_dev); | ||
307 | adf_disable_aer(accel_dev); | ||
308 | adf_cleanup_accel(accel_dev); | ||
309 | adf_cleanup_pci_dev(accel_dev); | ||
310 | kfree(accel_dev); | ||
311 | } | ||
312 | |||
313 | static int __init adfdrv_init(void) | ||
314 | { | ||
315 | request_module("intel_qat"); | ||
316 | |||
317 | if (pci_register_driver(&adf_driver)) { | ||
318 | pr_err("QAT: Driver initialization failed\n"); | ||
319 | return -EFAULT; | ||
320 | } | ||
321 | return 0; | ||
322 | } | ||
323 | |||
324 | static void __exit adfdrv_release(void) | ||
325 | { | ||
326 | pci_unregister_driver(&adf_driver); | ||
327 | } | ||
328 | |||
329 | module_init(adfdrv_init); | ||
330 | module_exit(adfdrv_release); | ||
331 | |||
332 | MODULE_LICENSE("Dual BSD/GPL"); | ||
333 | MODULE_AUTHOR("Intel"); | ||
334 | MODULE_DESCRIPTION("Intel(R) QuickAssist Technology"); | ||
335 | MODULE_VERSION(ADF_DRV_VERSION); | ||
diff --git a/drivers/crypto/qat/qat_common/adf_cfg_common.h b/drivers/crypto/qat/qat_common/adf_cfg_common.h index c697fb1cdfb5..39884c982c37 100644 --- a/drivers/crypto/qat/qat_common/adf_cfg_common.h +++ b/drivers/crypto/qat/qat_common/adf_cfg_common.h | |||
@@ -72,6 +72,7 @@ enum adf_device_type { | |||
72 | DEV_UNKNOWN = 0, | 72 | DEV_UNKNOWN = 0, |
73 | DEV_DH895XCC, | 73 | DEV_DH895XCC, |
74 | DEV_DH895XCCVF, | 74 | DEV_DH895XCCVF, |
75 | DEV_C3XXX | ||
75 | }; | 76 | }; |
76 | 77 | ||
77 | struct adf_dev_status_info { | 78 | struct adf_dev_status_info { |
diff --git a/drivers/crypto/qat/qat_common/adf_dev_mgr.c b/drivers/crypto/qat/qat_common/adf_dev_mgr.c index 8dfdb8f90797..b3ebb25f9ca7 100644 --- a/drivers/crypto/qat/qat_common/adf_dev_mgr.c +++ b/drivers/crypto/qat/qat_common/adf_dev_mgr.c | |||
@@ -53,6 +53,7 @@ static LIST_HEAD(accel_table); | |||
53 | static LIST_HEAD(vfs_table); | 53 | static LIST_HEAD(vfs_table); |
54 | static DEFINE_MUTEX(table_lock); | 54 | static DEFINE_MUTEX(table_lock); |
55 | static uint32_t num_devices; | 55 | static uint32_t num_devices; |
56 | static u8 id_map[ADF_MAX_DEVICES]; | ||
56 | 57 | ||
57 | struct vf_id_map { | 58 | struct vf_id_map { |
58 | u32 bdf; | 59 | u32 bdf; |
@@ -116,8 +117,10 @@ void adf_clean_vf_map(bool vf) | |||
116 | mutex_lock(&table_lock); | 117 | mutex_lock(&table_lock); |
117 | list_for_each_safe(ptr, tmp, &vfs_table) { | 118 | list_for_each_safe(ptr, tmp, &vfs_table) { |
118 | map = list_entry(ptr, struct vf_id_map, list); | 119 | map = list_entry(ptr, struct vf_id_map, list); |
119 | if (map->bdf != -1) | 120 | if (map->bdf != -1) { |
121 | id_map[map->id] = 0; | ||
120 | num_devices--; | 122 | num_devices--; |
123 | } | ||
121 | 124 | ||
122 | if (vf && map->bdf == -1) | 125 | if (vf && map->bdf == -1) |
123 | continue; | 126 | continue; |
@@ -154,6 +157,19 @@ void adf_devmgr_update_class_index(struct adf_hw_device_data *hw_data) | |||
154 | } | 157 | } |
155 | EXPORT_SYMBOL_GPL(adf_devmgr_update_class_index); | 158 | EXPORT_SYMBOL_GPL(adf_devmgr_update_class_index); |
156 | 159 | ||
160 | static unsigned int adf_find_free_id(void) | ||
161 | { | ||
162 | unsigned int i; | ||
163 | |||
164 | for (i = 0; i < ADF_MAX_DEVICES; i++) { | ||
165 | if (!id_map[i]) { | ||
166 | id_map[i] = 1; | ||
167 | return i; | ||
168 | } | ||
169 | } | ||
170 | return ADF_MAX_DEVICES + 1; | ||
171 | } | ||
172 | |||
157 | /** | 173 | /** |
158 | * adf_devmgr_add_dev() - Add accel_dev to the acceleration framework | 174 | * adf_devmgr_add_dev() - Add accel_dev to the acceleration framework |
159 | * @accel_dev: Pointer to acceleration device. | 175 | * @accel_dev: Pointer to acceleration device. |
@@ -194,8 +210,12 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, | |||
194 | } | 210 | } |
195 | 211 | ||
196 | list_add_tail(&accel_dev->list, &accel_table); | 212 | list_add_tail(&accel_dev->list, &accel_table); |
197 | accel_dev->accel_id = num_devices++; | 213 | accel_dev->accel_id = adf_find_free_id(); |
198 | 214 | if (accel_dev->accel_id > ADF_MAX_DEVICES) { | |
215 | ret = -EFAULT; | ||
216 | goto unlock; | ||
217 | } | ||
218 | num_devices++; | ||
199 | map = kzalloc(sizeof(*map), GFP_KERNEL); | 219 | map = kzalloc(sizeof(*map), GFP_KERNEL); |
200 | if (!map) { | 220 | if (!map) { |
201 | ret = -ENOMEM; | 221 | ret = -ENOMEM; |
@@ -236,8 +256,13 @@ int adf_devmgr_add_dev(struct adf_accel_dev *accel_dev, | |||
236 | ret = -ENOMEM; | 256 | ret = -ENOMEM; |
237 | goto unlock; | 257 | goto unlock; |
238 | } | 258 | } |
239 | 259 | accel_dev->accel_id = adf_find_free_id(); | |
240 | accel_dev->accel_id = num_devices++; | 260 | if (accel_dev->accel_id > ADF_MAX_DEVICES) { |
261 | kfree(map); | ||
262 | ret = -EFAULT; | ||
263 | goto unlock; | ||
264 | } | ||
265 | num_devices++; | ||
241 | list_add_tail(&accel_dev->list, &accel_table); | 266 | list_add_tail(&accel_dev->list, &accel_table); |
242 | map->bdf = adf_get_vf_num(accel_dev); | 267 | map->bdf = adf_get_vf_num(accel_dev); |
243 | map->id = accel_dev->accel_id; | 268 | map->id = accel_dev->accel_id; |
@@ -271,6 +296,7 @@ void adf_devmgr_rm_dev(struct adf_accel_dev *accel_dev, | |||
271 | { | 296 | { |
272 | mutex_lock(&table_lock); | 297 | mutex_lock(&table_lock); |
273 | if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) { | 298 | if (!accel_dev->is_vf || (accel_dev->is_vf && !pf)) { |
299 | id_map[accel_dev->accel_id] = 0; | ||
274 | num_devices--; | 300 | num_devices--; |
275 | } else if (accel_dev->is_vf && pf) { | 301 | } else if (accel_dev->is_vf && pf) { |
276 | struct vf_id_map *map, *next; | 302 | struct vf_id_map *map, *next; |