Browse Source

Imported latest versions from Etherboot 5.4

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
d9bba621c8

+ 43
- 8
src/drivers/net/mlx_ipoib/cmdif_mt25218.c View File

@@ -22,14 +22,6 @@
22 22
 #include "cmdif_priv.h"
23 23
 #include "mt25218.h"
24 24
 
25
-/*
26
- *  cmd_sys_dis
27
- */
28
-static int cmd_sys_dis(void)
29
-{
30
-	return 0;
31
-}
32
-
33 25
 /*
34 26
  *  cmd_write_mgm
35 27
  */
@@ -325,6 +317,24 @@ static int cmd_map_icm_aux(struct map_icm_st *map_icm_aux_p)
325 317
 	return rc;
326 318
 }
327 319
 
320
+
321
+/*
322
+ *  cmd_unmap_icm_aux
323
+ */
324
+static int cmd_unmap_icm_aux(void)
325
+{
326
+	int rc;
327
+	command_fields_t cmd_desc;
328
+
329
+	memset(&cmd_desc, 0, sizeof cmd_desc);
330
+
331
+	cmd_desc.opcode = MEMFREE_CMD_UNMAP_ICM_AUX;
332
+
333
+	rc = cmd_invoke(&cmd_desc);
334
+
335
+	return rc;
336
+}
337
+
328 338
 /*
329 339
  *  cmd_map_icm
330 340
  */
@@ -371,6 +381,31 @@ static int cmd_map_icm(struct map_icm_st *map_icm_p)
371 381
 	return rc;
372 382
 }
373 383
 
384
+
385
+
386
+/*
387
+ *  cmd_unmap_icm
388
+ */
389
+static int cmd_unmap_icm(struct map_icm_st *map_icm_p)
390
+{
391
+	int rc;
392
+	command_fields_t cmd_desc;
393
+	__u32 iprm[2];
394
+
395
+	memset(&cmd_desc, 0, sizeof cmd_desc);
396
+
397
+	cmd_desc.opcode = MEMFREE_CMD_UNMAP_ICM;
398
+	iprm[0] = map_icm_p->vpm_arr[0].va_h;
399
+	iprm[1] = map_icm_p->vpm_arr[0].va_l;
400
+	cmd_desc.in_param = iprm;
401
+	cmd_desc.in_trans = TRANS_IMMEDIATE;
402
+	cmd_desc.input_modifier = 1 << map_icm_p->vpm_arr[0].log2_size;
403
+
404
+	rc = cmd_invoke(&cmd_desc);
405
+
406
+	return rc;
407
+}
408
+
374 409
 /*
375 410
  *  cmd_query_dev_lim
376 411
  */

+ 13
- 7
src/drivers/net/mlx_ipoib/doc/README.boot_over_ib View File

@@ -92,13 +92,11 @@ files with .mlx extension also available from Mellanox's web site.
92 92
 
93 93
 6. Preparing the DHCP Server
94 94
 -----------------------------
95
-DHCP messages over IP Over IB are transmitted as broadcasts. In order to 
96
-distinguish between messages belonging to a certain DHCP session, the messages 
97
-must carry the client identifier option (see ietf documentation	referred to 
98
-above). As of November 2005, ISC DHCP servers do not support this feature. 
99
-They are expected to support this at the end of 2005. In order to work this 
100
-out, the appropriate patch must be applied (see patches directory). It has 
101
-been tested on version isc-dhcpd-V3.0.4b2.
95
+The DHCP server may need to be modified in order to work on IPOIB. Some
96
+distributuions alreay support this (Some SUSE distributuions) while others
97
+do not. If the pre-installed server does not support IPOIB, the user can download
98
+the sources from ISC http://www.isc.org/ and apply the appropriate patch in
99
+the patches directory.
102 100
 
103 101
 The DHCP server must run on a machine which supports IP Over IB. The Mellanox 
104 102
 IBGD package (gen1 or gen2) can be used to provide this.
@@ -171,6 +169,14 @@ PXE_IB_PORT.
171 169
 
172 170
 14. Installing a package from Mellanox
173 171
 --------------------------------------
172
+The package comes as a compressed file with extension .bz2 or .gz. Follow 
173
+these steps:
174
+1. Create a directory
175
+2. cd to this directory
176
+3. tar jxf <package file name>  for .bz2 files or
177
+   tar zxf <package file name>  for .gz files
178
+
179
+The binaries can be found under src/bin
174 180
 When using a package obtained from Mellanox Technologies' web site, the
175 181
 directory src/bin will contain the driver binary files. The files have a .bin
176 182
 extension and are equivalent to the same files with .zrom extension.

+ 4
- 6
src/drivers/net/mlx_ipoib/ib_driver.c View File

@@ -248,12 +248,10 @@ static int ib_driver_close(int fw_fatal)
248 248
 		ret = 1;
249 249
 	}
250 250
 
251
-	if (!fw_fatal) {
252
-		rc = cmd_sys_dis();
253
-		if (rc) {
254
-			eprintf("");
255
-			ret = 1;
256
-		}
251
+	rc = unset_hca();
252
+	if (rc) {
253
+		eprintf("");
254
+		ret = 1;
257 255
 	}
258 256
 
259 257
 	return ret;

+ 15
- 1
src/drivers/net/mlx_ipoib/ib_mt23108.c View File

@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "mt23108.h"
23 23
 #include "ib_driver.h"
24
-#include <gpxe/pci.h>
24
+#include "pci.h"
25 25
 
26 26
 struct device_buffers_st {
27 27
 	union recv_wqe_u mads_qp_rcv_queue[NUM_MADS_RCV_WQES]
@@ -799,6 +799,20 @@ static int setup_hca(__u8 port, void **eq_p)
799 799
 	return ret;
800 800
 }
801 801
 
802
+
803
+static int unset_hca(void)
804
+{
805
+	int rc = 0;
806
+
807
+	if (!fw_fatal) {
808
+		rc = cmd_sys_dis();
809
+		if (rc)
810
+			eprintf("");
811
+	}
812
+
813
+	return rc;
814
+}
815
+
802 816
 static void *get_inprm_buf(void)
803 817
 {
804 818
 	return dev_buffers_p->inprm_buf;

+ 31
- 1
src/drivers/net/mlx_ipoib/ib_mt25218.c View File

@@ -21,7 +21,7 @@
21 21
 
22 22
 #include "mt25218.h"
23 23
 #include "ib_driver.h"
24
-#include <gpxe/pci.h>
24
+#include "pci.h"
25 25
 
26 26
 #define MOD_INC(counter, max_count) (counter) = ((counter)+1) & ((max_count) - 1)
27 27
 
@@ -89,6 +89,10 @@ static struct dev_pci_struct memfree_pci_dev;
89 89
 static struct device_buffers_st *dev_buffers_p;
90 90
 static struct device_ib_data_st dev_ib_data;
91 91
 
92
+
93
+
94
+struct map_icm_st icm_map_obj;
95
+
92 96
 static int gw_write_cr(__u32 addr, __u32 data)
93 97
 {
94 98
 	writel(htonl(data), memfree_pci_dev.cr_space + addr);
@@ -850,6 +854,8 @@ static int setup_hca(__u8 port, void **eq_p)
850 854
 		eprintf("");
851 855
 		goto undo_map_fa;
852 856
 	}
857
+	icm_map_obj = map_obj;
858
+
853 859
 	phys_mem.offset += (1 << (map_obj.vpm_arr[0].log2_size + 12));
854 860
 
855 861
 	init_hca.log_max_uars = log_max_uars;
@@ -978,6 +984,30 @@ static int setup_hca(__u8 port, void **eq_p)
978 984
 	return ret;
979 985
 }
980 986
 
987
+
988
+static int unset_hca(void)
989
+{
990
+	int rc, ret = 0;
991
+
992
+	rc = cmd_unmap_icm(&icm_map_obj);
993
+	if (rc)
994
+		eprintf("");
995
+	ret |= rc;
996
+
997
+
998
+	rc = cmd_unmap_icm_aux();
999
+	if (rc)
1000
+		eprintf("");
1001
+	ret |= rc;
1002
+
1003
+	rc = cmd_unmap_fa();
1004
+	if (rc)
1005
+		eprintf("");
1006
+	ret |= rc;
1007
+
1008
+	return ret;
1009
+}
1010
+
981 1011
 static void *get_inprm_buf(void)
982 1012
 {
983 1013
 	return dev_buffers_p->inprm_buf;

+ 3
- 59
src/drivers/net/mlx_ipoib/ipoib.c View File

@@ -357,52 +357,12 @@ static void modify_dhcp_resp(void *buf, __u16 size)
357 357
 	modify_udp_csum(buf, size);
358 358
 }
359 359
 
360
-static void get_my_client_id(__u8 * my_client_id)
361
-{
362
-
363
-	my_client_id[0] = 0;
364
-	qpn2buf(ipoib_data.ipoib_qpn, my_client_id + 1);
365
-	memcpy(my_client_id + 4, ipoib_data.port_gid_raw, 16);
366
-}
367
-
368
-static const __u8 *get_client_id(const void *buf, int len)
369
-{
370
-	const __u8 *ptr;
371
-	int delta;
372
-
373
-	if (len < 268)
374
-		return NULL;
375
-
376
-	/* pointer to just after magic cookie */
377
-	ptr = (const __u8 *)buf + 268;
378
-
379
-	/* find last client identifier option */
380
-	do {
381
-		if (ptr[0] == 255) {
382
-			/* found end of options list */
383
-			return NULL;
384
-		}
385
-
386
-		if (ptr[0] == 0x3d) {
387
-			/* client identifer option */
388
-			return ptr + 3;
389
-		}
390
-
391
-		delta = ptr[1] + 2;
392
-		ptr += delta;
393
-		len -= delta;
394
-	} while (len > 0);
395
-
396
-	return NULL;
397
-}
398
-
399 360
 static int handle_ipv4_packet(void *buf, void **out_buf_p,
400 361
 			      unsigned int *new_size_p, int *is_bcast_p)
401 362
 {
402 363
 	void *new_buf;
403 364
 	__u16 new_size;
404 365
 	__u8 msg_type;
405
-	__u8 my_client_id[20];
406 366
 
407 367
 	new_buf = (void *)(((__u8 *) buf) + 4);
408 368
 	new_size = (*new_size_p) - 4;
@@ -411,7 +371,6 @@ static int handle_ipv4_packet(void *buf, void **out_buf_p,
411 371
 
412 372
 	if (get_ip_protocl(new_buf) == IP_PROT_UDP) {
413 373
 		__u16 udp_dst_port;
414
-		const __u8 *client_id;
415 374
 
416 375
 		udp_dst_port = get_udp_dst_port(new_buf);
417 376
 
@@ -420,22 +379,6 @@ static int handle_ipv4_packet(void *buf, void **out_buf_p,
420 379
 			*out_buf_p = 0;
421 380
 			return 0;
422 381
 		}
423
-
424
-		if (udp_dst_port == 68) {
425
-			get_my_client_id(my_client_id);
426
-
427
-			/* packet client id */
428
-			client_id = get_client_id(new_buf, new_size);
429
-			if (!client_id) {
430
-				*out_buf_p = 0;
431
-				return 0;
432
-			}
433
-
434
-			if (memcmp(client_id, my_client_id, 20)) {
435
-				*out_buf_p = 0;
436
-				return 0;
437
-			}
438
-		}
439 382
 	}
440 383
 
441 384
 	msg_type = get_dhcp_msg_type(new_buf);
@@ -515,8 +458,9 @@ static int ipoib_handle_rcv(void *buf, void **out_buf_p,
515 458
 		rc = handle_ipv4_packet(buf, out_buf_p, new_size_p, is_bcast_p);
516 459
 		return rc;
517 460
 	}
518
-	eprintf("prot=0x%x", prot_type);
519
-	return -1;
461
+	tprintf("prot=0x%x", prot_type);
462
+    *out_buf_p = NULL;
463
+	return 0;
520 464
 }
521 465
 
522 466
 static int is_null_mac(const __u8 * mac)

+ 3
- 3
src/drivers/net/mlx_ipoib/mt23108.c View File

@@ -15,9 +15,9 @@ Skeleton NIC driver for Etherboot
15 15
 /* to get the interface to the body of the program */
16 16
 #include "nic.h"
17 17
 /* to get the PCI support functions, if this is a PCI NIC */
18
-#include <gpxe/pci.h>
18
+#include "pci.h"
19 19
 /* to get the ISA support functions, if this is an ISA NIC */
20
-#include <gpxe/isa.h>
20
+#include "isa.h"
21 21
 
22 22
 #include "mt_version.c"
23 23
 #include "mt23108_imp.c"
@@ -235,7 +235,7 @@ static struct pci_id tavor_nics[] = {
235 235
 	PCI_ROM(0x15b3, 0x6278, "MT25208", "MT25208 HCA driver"),
236 236
 };
237 237
 
238
-struct pci_driver tavor_driver __pci_driver = {
238
+static struct pci_driver tavor_driver __pci_driver = {
239 239
 	.type = NIC_DRIVER,
240 240
 	.name = "MT23108/MT25208",
241 241
 	.probe = tavor_probe,

+ 3
- 3
src/drivers/net/mlx_ipoib/mt25218.c View File

@@ -15,9 +15,9 @@ Skeleton NIC driver for Etherboot
15 15
 /* to get the interface to the body of the program */
16 16
 #include "nic.h"
17 17
 /* to get the PCI support functions, if this is a PCI NIC */
18
-#include <gpxe/pci.h>
18
+#include "pci.h"
19 19
 /* to get the ISA support functions, if this is an ISA NIC */
20
-#include <gpxe/isa.h>
20
+#include "isa.h"
21 21
 
22 22
 #include "mt_version.c"
23 23
 #include "mt25218_imp.c"
@@ -235,7 +235,7 @@ static struct pci_id mt25218_nics[] = {
235 235
 	PCI_ROM(0x15b3, 0x6274, "MT25204", "MT25204 HCA driver"),
236 236
 };
237 237
 
238
-struct pci_driver mt25218_driver __pci_driver = {
238
+static struct pci_driver mt25218_driver __pci_driver = {
239 239
 	.type = NIC_DRIVER,
240 240
 	.name = "MT25218",
241 241
 	.probe = mt25218_probe,

+ 2
- 0
src/drivers/net/mlx_ipoib/mt25218.h View File

@@ -26,7 +26,9 @@
26 26
 #define MEMFREE_CMD_RUN_FW			0xff6
27 27
 #define MEMFREE_CMD_SET_ICM_SIZE	0xffd
28 28
 #define MEMFREE_CMD_MAP_ICM_AUX		0xffc
29
+#define MEMFREE_CMD_UNMAP_ICM_AUX		0xffb
29 30
 #define MEMFREE_CMD_MAP_ICM			0xffa
31
+#define MEMFREE_CMD_UNMAP_ICM			0xff9
30 32
 #define MEMFREE_CMD_QUERY_DEV_LIM   0x003
31 33
 
32 34
 /*

+ 1
- 1
src/drivers/net/mlx_ipoib/mt_version.c View File

@@ -20,4 +20,4 @@
20 20
 */
21 21
 
22 22
 /* definition of the build version goes here */
23
-const char *build_revision= "113";
23
+const char *build_revision= "191";

+ 4
- 14
src/drivers/net/mlx_ipoib/patches/dhcpd.patch View File

@@ -1,17 +1,7 @@
1
-diff -ru ../../orig/dhcp-3.0.4b2/common/options.c ./common/options.c
2
---- ../../orig/dhcp-3.0.4b2/common/options.c	2005-11-02 01:19:03.000000000 +0200
3
-+++ ./common/options.c	2005-12-06 14:38:17.000000000 +0200
4
-@@ -537,6 +537,7 @@
5
- 	priority_list [priority_len++] = DHO_DHCP_LEASE_TIME;
6
- 	priority_list [priority_len++] = DHO_DHCP_MESSAGE;
7
- 	priority_list [priority_len++] = DHO_DHCP_REQUESTED_ADDRESS;
8
-+	priority_list [priority_len++] = DHO_DHCP_CLIENT_IDENTIFIER;
9
- 	priority_list [priority_len++] = DHO_FQDN;
10
- 
11
- 	if (prl && prl -> len > 0) {
12
-diff -ru ../../orig/dhcp-3.0.4b2/includes/site.h ./includes/site.h
13
---- ../../orig/dhcp-3.0.4b2/includes/site.h	2002-03-12 20:33:39.000000000 +0200
14
-+++ ./includes/site.h	2005-12-06 14:36:55.000000000 +0200
1
+Index: dhcp-3.0.4b3/includes/site.h
2
+===================================================================
3
+--- dhcp-3.0.4b3.orig/includes/site.h	2002-03-12 20:33:39.000000000 +0200
4
++++ dhcp-3.0.4b3/includes/site.h	2006-03-15 12:50:00.000000000 +0200
15 5
 @@ -135,7 +135,7 @@
16 6
     the aforementioned problems do not matter to you, or if no other
17 7
     API is supported for your system, you may want to go with it. */

Loading…
Cancel
Save