Browse Source

Can now both send and receive packets. LL header format not yet

fixed; still using a quick hack-up just to be able to pass through
data.
tags/v0.9.3
Michael Brown 17 years ago
parent
commit
30a19c3f1c

+ 2
- 0
src/drivers/net/mlx_ipoib/ib_mt25218.c View File

1587
 	}
1587
 	}
1588
 	snd_wqe->mpointer[0].byte_count = cpu_to_be32(len);
1588
 	snd_wqe->mpointer[0].byte_count = cpu_to_be32(len);
1589
 
1589
 
1590
+#if 0
1590
 	DBG ( "prep_send_wqe_buf()\n" );
1591
 	DBG ( "prep_send_wqe_buf()\n" );
1591
 	DBG ( "snd_wqe:\n" );
1592
 	DBG ( "snd_wqe:\n" );
1592
 	DBG_HD ( snd_wqe, sizeof ( *snd_wqe ) );
1593
 	DBG_HD ( snd_wqe, sizeof ( *snd_wqe ) );
1593
 	DBG ( "packet:\n" );
1594
 	DBG ( "packet:\n" );
1594
 	DBG_HD ( bus_to_virt(be32_to_cpu(snd_wqe->mpointer[0].local_addr_l)),
1595
 	DBG_HD ( bus_to_virt(be32_to_cpu(snd_wqe->mpointer[0].local_addr_l)),
1595
 		 len );
1596
 		 len );
1597
+#endif
1596
 }
1598
 }
1597
 
1599
 
1598
 static void *alloc_ud_av(void)
1600
 static void *alloc_ud_av(void)

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

248
 	}
248
 	}
249
 	buf = get_rcv_wqe_buf(ib_cqe.wqe, 1);
249
 	buf = get_rcv_wqe_buf(ib_cqe.wqe, 1);
250
 	memcpy ( iob_put ( iobuf, len ), buf, len );
250
 	memcpy ( iob_put ( iobuf, len ), buf, len );
251
-	DBG ( "Received packet header:\n" );
252
-	struct recv_wqe_st *rcv_wqe = ib_cqe.wqe;
253
-	DBG_HD ( get_rcv_wqe_buf(ib_cqe.wqe, 0),
254
-		 be32_to_cpu(rcv_wqe->mpointer[0].byte_count) );
251
+	//	DBG ( "Received packet header:\n" );
252
+	//	struct recv_wqe_st *rcv_wqe = ib_cqe.wqe;
253
+	//	DBG_HD ( get_rcv_wqe_buf(ib_cqe.wqe, 0),
254
+	//		 be32_to_cpu(rcv_wqe->mpointer[0].byte_count) );
255
 		 
255
 		 
256
-	DBG ( "Received packet:\n" );
257
-	DBG_HD ( iobuf->data, iob_len ( iobuf ) );
256
+	//	DBG ( "Received packet:\n" );
257
+	//	DBG_HD ( iobuf->data, iob_len ( iobuf ) );
258
 
258
 
259
 	netdev_rx ( netdev, iobuf );
259
 	netdev_rx ( netdev, iobuf );
260
 
260
 
392
 		       const struct pci_device_id *id __unused ) {
392
 		       const struct pci_device_id *id __unused ) {
393
 	struct net_device *netdev;
393
 	struct net_device *netdev;
394
 	struct mlx_nic *mlx;
394
 	struct mlx_nic *mlx;
395
+	struct ib_mac *mac;
395
 	int rc;
396
 	int rc;
396
 
397
 
397
 	/* Allocate net device */
398
 	/* Allocate net device */
410
 	/* Initialise hardware */
411
 	/* Initialise hardware */
411
 	if ( ( rc = ipoib_init ( pci ) ) != 0 )
412
 	if ( ( rc = ipoib_init ( pci ) ) != 0 )
412
 		goto err_ipoib_init;
413
 		goto err_ipoib_init;
413
-	memcpy ( netdev->ll_addr, ipoib_data.port_gid_raw, IB_ALEN );
414
+	mac = ( ( struct ib_mac * ) netdev->ll_addr );
415
+	mac->qpn = htonl ( ipoib_data.ipoib_qpn );
416
+	memcpy ( &mac->gid, ipoib_data.port_gid_raw, sizeof ( mac->gid ) );
414
 
417
 
415
 	/* Register network device */
418
 	/* Register network device */
416
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )
419
 	if ( ( rc = register_netdev ( netdev ) ) != 0 )

+ 37
- 0
src/include/gpxe/infiniband.h View File

14
 #define IB_ALEN 20
14
 #define IB_ALEN 20
15
 #define IB_HLEN 24
15
 #define IB_HLEN 24
16
 
16
 
17
+/** An Infiniband Global Identifier */
18
+struct ib_gid {
19
+	uint8_t bytes[16];
20
+};
21
+
22
+/** An Infiniband Global Route Header */
23
+struct ib_global_route_header {
24
+	/** IP version, traffic class, and flow label
25
+	 *
26
+	 *  4 bits : Version of the GRH
27
+	 *  8 bits : Traffic class
28
+	 * 20 bits : Flow label
29
+	 */
30
+	uint32_t ipver_tclass_flowlabel;
31
+	/** Payload length */
32
+	uint16_t paylen;
33
+	/** Next header */
34
+	uint8_t nxthdr;
35
+	/** Hop limit */
36
+	uint8_t hoplmt;
37
+	/** Source GID */
38
+	struct ib_gid sgid;
39
+	/** Destiniation GID */
40
+	struct ib_gid dgid;
41
+} __attribute__ (( packed ));
42
+
43
+/** An Infiniband MAC address */
44
+struct ib_mac {
45
+	/** Queue pair number
46
+	 *
47
+	 * MSB must be zero; QPNs are only 24-bit.
48
+	 */
49
+	uint32_t qpn;
50
+	/** Port GID */
51
+	struct ib_gid gid;
52
+} __attribute__ (( packed ));
53
+
17
 /** An Infiniband header
54
 /** An Infiniband header
18
  *
55
  *
19
  * This data structure doesn't represent the on-wire format, but does
56
  * This data structure doesn't represent the on-wire format, but does

+ 11
- 0
src/net/infiniband.c View File

70
  * network-layer protocol.
70
  * network-layer protocol.
71
  */
71
  */
72
 static int ib_rx ( struct io_buffer *iobuf, struct net_device *netdev ) {
72
 static int ib_rx ( struct io_buffer *iobuf, struct net_device *netdev ) {
73
+
74
+	struct {
75
+		uint16_t proto;
76
+		uint16_t reserved;
77
+	} * header = iobuf->data;
78
+
79
+	iob_pull ( iobuf, sizeof ( *header ) );
80
+	return net_rx ( iobuf, netdev, header->proto, NULL );
81
+
82
+
83
+
73
 	struct ibhdr *ibhdr = iobuf->data;
84
 	struct ibhdr *ibhdr = iobuf->data;
74
 
85
 
75
 	/* Sanity check */
86
 	/* Sanity check */

Loading…
Cancel
Save