Browse Source

[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 years ago
parent
commit
aa69bf84d2

+ 48
- 15
src/drivers/net/vxge/vxge_config.c View File

17
 #include <stdlib.h>
17
 #include <stdlib.h>
18
 #include <stdio.h>
18
 #include <stdio.h>
19
 #include <ipxe/malloc.h>
19
 #include <ipxe/malloc.h>
20
+#include <ipxe/pci.h>
20
 #include <ipxe/iobuf.h>
21
 #include <ipxe/iobuf.h>
21
 #include <ipxe/ethernet.h>
22
 #include <ipxe/ethernet.h>
22
 #include <byteswap.h>
23
 #include <byteswap.h>
186
 	return status;
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
  * __vxge_hw_device_toc_get
217
  * __vxge_hw_device_toc_get
191
  * This routine sets the swapper and reads the toc pointer and returns the
218
  * This routine sets the swapper and reads the toc pointer and returns the
192
  * memory mapped address of the toc
219
  * memory mapped address of the toc
193
  */
220
  */
194
 struct vxge_hw_toc_reg __iomem *
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
 	u64 val64;
225
 	u64 val64;
198
 	struct vxge_hw_toc_reg __iomem *toc = NULL;
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
 	val64 =	readq(&legacy_reg->toc_first_pointer);
228
 	val64 =	readq(&legacy_reg->toc_first_pointer);
209
 	toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64);
229
 	toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64);
210
-exit:
230
+
211
 	return toc;
231
 	return toc;
212
 }
232
 }
213
 
233
 
224
 	u32 i;
244
 	u32 i;
225
 	enum vxge_hw_status status = VXGE_HW_OK;
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
 	if (hldev->toc_reg  == NULL) {
256
 	if (hldev->toc_reg  == NULL) {
231
 		status = VXGE_HW_FAIL;
257
 		status = VXGE_HW_FAIL;
232
 		goto exit;
258
 		goto exit;
234
 
260
 
235
 	val64 = readq(&hldev->toc_reg->toc_common_pointer);
261
 	val64 = readq(&hldev->toc_reg->toc_common_pointer);
236
 	hldev->common_reg =
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
 	val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer);
265
 	val64 = readq(&hldev->toc_reg->toc_mrpcim_pointer);
240
 	hldev->mrpcim_reg =
266
 	hldev->mrpcim_reg =
355
  * each vpath
381
  * each vpath
356
  */
382
  */
357
 enum vxge_hw_status
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
 				struct vxge_hw_device_hw_info *hw_info)
385
 				struct vxge_hw_device_hw_info *hw_info)
360
 {
386
 {
361
 	u32 i;
387
 	u32 i;
365
 	struct vxge_hw_common_reg __iomem *common_reg;
391
 	struct vxge_hw_common_reg __iomem *common_reg;
366
 	struct vxge_hw_vpath_reg __iomem *vpath_reg;
392
 	struct vxge_hw_vpath_reg __iomem *vpath_reg;
367
 	struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
393
 	struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg;
394
+	struct vxge_hw_legacy_reg __iomem *legacy_reg;
368
 	enum vxge_hw_status status;
395
 	enum vxge_hw_status status;
369
 
396
 
370
 	vxge_trace();
397
 	vxge_trace();
371
 
398
 
372
 	memset(hw_info, 0, sizeof(struct vxge_hw_device_hw_info));
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
 	if (toc == NULL) {
408
 	if (toc == NULL) {
376
 		status = VXGE_HW_ERR_CRITICAL;
409
 		status = VXGE_HW_ERR_CRITICAL;
377
 		goto exit;
410
 		goto exit;

+ 3
- 7
src/drivers/net/vxge/vxge_config.h View File

440
 #define VXGE_HW_VH_NORMAL_FUNCTION				7
440
 #define VXGE_HW_VH_NORMAL_FUNCTION				7
441
 	u64		function_mode;
441
 	u64		function_mode;
442
 #define VXGE_HW_FUNCTION_MODE_MIN				0
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
 #define VXGE_HW_FUNCTION_MODE_SINGLE_FUNCTION			0
445
 #define VXGE_HW_FUNCTION_MODE_SINGLE_FUNCTION			0
446
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION			1
446
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION			1
453
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_2			8
453
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_2			8
454
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_4			9
454
 #define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_4			9
455
 #define VXGE_HW_FUNCTION_MODE_MRIOV_4				10
455
 #define VXGE_HW_FUNCTION_MODE_MRIOV_4				10
456
+#define VXGE_HW_FUNCTION_MODE_MULTI_FUNCTION_DIRECT_IO		11
456
 
457
 
457
 	u32		func_id;
458
 	u32		func_id;
458
 	u64		vpath_mask;
459
 	u64		vpath_mask;
607
 }
608
 }
608
 
609
 
609
 enum vxge_hw_status vxge_hw_device_hw_info_get(
610
 enum vxge_hw_status vxge_hw_device_hw_info_get(
611
+	struct pci_device *pdev,
610
 	void __iomem *bar0,
612
 	void __iomem *bar0,
611
 	struct vxge_hw_device_hw_info *hw_info);
613
 	struct vxge_hw_device_hw_info *hw_info);
612
 
614
 
727
 	return status;
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
 void
732
 void
737
 __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
733
 __vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
738
 
734
 

+ 2
- 1
src/drivers/net/vxge/vxge_main.c View File

45
 	"Multi Function 2 - 2 func, 8 vpath per func",
45
 	"Multi Function 2 - 2 func, 8 vpath per func",
46
 	"Multi Function 4 - 4 func, 4 vpath per func",
46
 	"Multi Function 4 - 4 func, 4 vpath per func",
47
 	"WLPEX/SharedIO 4 - 17 func, 1 vpath per func (PCIe ARI)",
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
 static inline int is_vxge_card_up(struct vxgedev *vdev)
51
 static inline int is_vxge_card_up(struct vxgedev *vdev)
533
 		goto _exit0;
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
 	if (status != VXGE_HW_OK) {
538
 	if (status != VXGE_HW_OK) {
538
 		vxge_debug(VXGE_ERR,
539
 		vxge_debug(VXGE_ERR,
539
 			"%s: Reading of hardware info failed.\n",
540
 			"%s: Reading of hardware info failed.\n",

+ 2
- 2
src/drivers/net/vxge/vxge_version.h View File

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

Loading…
Cancel
Save