Переглянути джерело

[vxge] Add support for new function mode "multi-function 8 Direct IO"

Support a new function mode "multi-function 8 Direct IO" which is used
in ESX Direct I/O configuration.

Update driver version to 3.5.0.1

Signed-off-by: Masroor Vettuparambil <masroor.vettuparambil@exar.com>
Signed-off-by: Sivakumar Subramani <sivakumar.subramani@exar.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Masroor Vettuparambil 14 роки тому
джерело
коміт
aa69bf84d2

+ 48
- 15
src/drivers/net/vxge/vxge_config.c Переглянути файл

@@ -17,6 +17,7 @@ FILE_LICENCE(GPL2_ONLY);
17 17
 #include <stdlib.h>
18 18
 #include <stdio.h>
19 19
 #include <ipxe/malloc.h>
20
+#include <ipxe/pci.h>
20 21
 #include <ipxe/iobuf.h>
21 22
 #include <ipxe/ethernet.h>
22 23
 #include <byteswap.h>
@@ -186,28 +187,47 @@ __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
186 187
 	return status;
187 188
 }
188 189
 
190
+/*
191
+ * __vxge_hw_device_get_legacy_reg
192
+ * This routine gets the legacy register section's memory mapped address
193
+ * and sets the swapper.
194
+ */
195
+static struct vxge_hw_legacy_reg __iomem *
196
+__vxge_hw_device_get_legacy_reg(struct pci_device *pdev, void __iomem *bar0)
197
+{
198
+	enum vxge_hw_status status;
199
+	struct vxge_hw_legacy_reg __iomem *legacy_reg;
200
+	/*
201
+	 * If the length of Bar0 is 16MB, then assume that we are configured
202
+	 * in MF8P_VP2 mode and then add 8MB to the legacy_reg offsets
203
+	 */
204
+	if (pci_bar_size(pdev, PCI_BASE_ADDRESS_0) == 0x1000000)
205
+		legacy_reg = (struct vxge_hw_legacy_reg __iomem *)
206
+				(bar0 + 0x800000);
207
+	else
208
+		legacy_reg = (struct vxge_hw_legacy_reg __iomem *)bar0;
209
+
210
+	status = __vxge_hw_legacy_swapper_set(legacy_reg);
211
+	if (status != VXGE_HW_OK)
212
+		return NULL;
213
+
214
+	return legacy_reg;
215
+}
189 216
 /*
190 217
  * __vxge_hw_device_toc_get
191 218
  * This routine sets the swapper and reads the toc pointer and returns the
192 219
  * memory mapped address of the toc
193 220
  */
194 221
 struct vxge_hw_toc_reg __iomem *
195
-__vxge_hw_device_toc_get(void __iomem *bar0)
222
+__vxge_hw_device_toc_get(void __iomem *bar0,
223
+	struct vxge_hw_legacy_reg __iomem *legacy_reg)
196 224
 {
197 225
 	u64 val64;
198 226
 	struct vxge_hw_toc_reg __iomem *toc = NULL;
199
-	enum vxge_hw_status status;
200
-
201
-	struct vxge_hw_legacy_reg __iomem *legacy_reg =
202
-		(struct vxge_hw_legacy_reg __iomem *)bar0;
203
-
204
-	status = __vxge_hw_legacy_swapper_set(legacy_reg);
205
-	if (status != VXGE_HW_OK)
206
-		goto exit;
207 227
 
208 228
 	val64 =	readq(&legacy_reg->toc_first_pointer);
209 229
 	toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64);
210
-exit:
230
+
211 231
 	return toc;
212 232
 }
213 233
 
@@ -224,9 +244,15 @@ __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
224 244
 	u32 i;
225 245
 	enum vxge_hw_status status = VXGE_HW_OK;
226 246
 
227
-	hldev->legacy_reg = (struct vxge_hw_legacy_reg __iomem *)hldev->bar0;
247
+	hldev->legacy_reg = __vxge_hw_device_get_legacy_reg(hldev->pdev,
248
+					hldev->bar0);
249
+	if (hldev->legacy_reg  == NULL) {
250
+		status = VXGE_HW_FAIL;
251
+		goto exit;
252
+	}
228 253
 
229
-	hldev->toc_reg = __vxge_hw_device_toc_get(hldev->bar0);
254
+	hldev->toc_reg = __vxge_hw_device_toc_get(hldev->bar0,
255
+					hldev->legacy_reg);
230 256
 	if (hldev->toc_reg  == NULL) {
231 257
 		status = VXGE_HW_FAIL;
232 258
 		goto exit;
@@ -234,7 +260,7 @@ __vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev)
234 260
 
235 261
 	val64 = readq(&hldev->toc_reg->toc_common_pointer);
236 262
 	hldev->common_reg =
237
-	(struct vxge_hw_common_reg __iomem *)(hldev->bar0 + val64);
263
+		(struct vxge_hw_common_reg __iomem *)(hldev->bar0 + val64);
238 264
 
239 265
 	val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer);
240 266
 	hldev->mrpcim_reg =
@@ -355,7 +381,7 @@ void __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev)
355 381
  * each vpath
356 382
  */
357 383
 enum vxge_hw_status
358
-vxge_hw_device_hw_info_get(void __iomem *bar0,
384
+vxge_hw_device_hw_info_get(struct pci_device *pdev, void __iomem *bar0,
359 385
 				struct vxge_hw_device_hw_info *hw_info)
360 386
 {
361 387
 	u32 i;
@@ -365,13 +391,20 @@ vxge_hw_device_hw_info_get(void __iomem *bar0,
365 391
 	struct vxge_hw_common_reg __iomem *common_reg;
366 392
 	struct vxge_hw_vpath_reg __iomem *vpath_reg;
367 393
 	struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
394
+	struct vxge_hw_legacy_reg __iomem *legacy_reg;
368 395
 	enum vxge_hw_status status;
369 396
 
370 397
 	vxge_trace();
371 398
 
372 399
 	memset(hw_info, 0, sizeof(struct vxge_hw_device_hw_info));
373 400
 
374
-	toc = __vxge_hw_device_toc_get(bar0);
401
+	legacy_reg = __vxge_hw_device_get_legacy_reg(pdev, bar0);
402
+	if (legacy_reg == NULL) {
403
+		status = VXGE_HW_ERR_CRITICAL;
404
+		goto exit;
405
+	}
406
+
407
+	toc = __vxge_hw_device_toc_get(bar0, legacy_reg);
375 408
 	if (toc == NULL) {
376 409
 		status = VXGE_HW_ERR_CRITICAL;
377 410
 		goto exit;

+ 3
- 7
src/drivers/net/vxge/vxge_config.h Переглянути файл

@@ -440,7 +440,7 @@ struct vxge_hw_device_hw_info {
440 440
 #define VXGE_HW_VH_NORMAL_FUNCTION				7
441 441
 	u64		function_mode;
442 442
 #define VXGE_HW_FUNCTION_MODE_MIN				0
443
-#define VXGE_HW_FUNCTION_MODE_MAX				10
443
+#define VXGE_HW_FUNCTION_MODE_MAX				11
444 444
 
445 445
 #define VXGE_HW_FUNCTION_MODE_SINGLE_FUNCTION			0
446 446
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION			1
@@ -453,6 +453,7 @@ struct vxge_hw_device_hw_info {
453 453
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_2			8
454 454
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_4			9
455 455
 #define VXGE_HW_FUNCTION_MODE_MRIOV_4				10
456
+#define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_DIRECT_IO		11
456 457
 
457 458
 	u32		func_id;
458 459
 	u64		vpath_mask;
@@ -607,6 +608,7 @@ void vxge_hw_ring_rxd_1b_set(struct vxge_hw_ring_rxd_1 *rxdp,
607 608
 }
608 609
 
609 610
 enum vxge_hw_status vxge_hw_device_hw_info_get(
611
+	struct pci_device *pdev,
610 612
 	void __iomem *bar0,
611 613
 	struct vxge_hw_device_hw_info *hw_info);
612 614
 
@@ -727,12 +729,6 @@ __vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
727 729
 	return status;
728 730
 }
729 731
 
730
-struct vxge_hw_toc_reg __iomem *
731
-__vxge_hw_device_toc_get(void __iomem *bar0);
732
-
733
-enum vxge_hw_status
734
-__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
735
-
736 732
 void
737 733
 __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
738 734
 

+ 2
- 1
src/drivers/net/vxge/vxge_main.c Переглянути файл

@@ -45,6 +45,7 @@ static char *vxge_func_mode_names[] = {
45 45
 	"Multi Function 2 - 2 func, 8 vpath per func",
46 46
 	"Multi Function 4 - 4 func, 4 vpath per func",
47 47
 	"WLPEX/SharedIO 4 - 17 func, 1 vpath per func (PCIe ARI)",
48
+	"Multi Function 8 - For ESX DirectIO - 8 func, 2 vpath per func",
48 49
 };
49 50
 
50 51
 static inline int is_vxge_card_up(struct vxgedev *vdev)
@@ -533,7 +534,7 @@ vxge_probe(struct pci_device *pdev, const struct pci_device_id *id __unused)
533 534
 		goto _exit0;
534 535
 	}
535 536
 
536
-	status = vxge_hw_device_hw_info_get(bar0, &hw_info);
537
+	status = vxge_hw_device_hw_info_get(pdev, bar0, &hw_info);
537 538
 	if (status != VXGE_HW_OK) {
538 539
 		vxge_debug(VXGE_ERR,
539 540
 			"%s: Reading of hardware info failed.\n",

+ 2
- 2
src/drivers/net/vxge/vxge_version.h Переглянути файл

@@ -22,9 +22,9 @@ FILE_LICENCE(GPL2_ONLY);
22 22
  * Note: Each field must be a nibble size
23 23
  */
24 24
 #define VXGE_VERSION_MAJOR	3
25
-#define VXGE_VERSION_MINOR	1
25
+#define VXGE_VERSION_MINOR	5
26 26
 #define VXGE_VERSION_FIX	0
27
-#define VXGE_VERSION_BUILD	0
27
+#define VXGE_VERSION_BUILD	1
28 28
 
29 29
 #define VXGE_FW_VER(major, minor, build) \
30 30
 	(((major) << 16) + ((minor) << 8) + (build))

Завантаження…
Відмінити
Зберегти