[ofw] [Patch][IPoIB_NDIS6_CM] [1/2] DHCP bug fix

Alex Naslednikov xalex at mellanox.co.il
Wed Dec 22 02:24:11 PST 2010


Now with the file attached

-----Original Message-----
From: Alex Naslednikov 
Sent: Wednesday, December 22, 2010 12:15 PM
To: ofw at lists.openfabrics.org
Subject: [ofw][Patch][IPoIB_NDIS6_CM] [1/2] DHCP bug fix 

DHCP bug fix caused by IPv6 commit
Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)

Index: inc/kernel/ip_packet.h
===================================================================
--- inc/kernel/ip_packet.h	(revision 3031)
+++ inc/kernel/ip_packet.h	(working copy)
@@ -604,11 +604,8 @@
 
 typedef struct _ip_pkt
 {
-	union
-	{
-		ip_hdr_t		hdr;
-		ipv6_hdr_t		hdr_ipv6;
-	} PACK_SUFFIX ;
+	ip_hdr_t		hdr;
+	
 	union _ip_payload
 	{
 		tcp_hdr_t	tcp;
@@ -618,6 +615,20 @@
 
 }	PACK_SUFFIX ip_pkt_t;
 
+typedef struct _ipv6_pkt
+{
+	ipv6_hdr_t		hdr;
+	
+	union _ip_payload
+	{
+		tcp_hdr_t	tcp;
+		udp_pkt_t	udp;
+
+	}	PACK_SUFFIX prot;
+
+}	PACK_SUFFIX ipv6_pkt_t;
+
+
 typedef struct _eth_pkt
 {
 	eth_hdr_t	hdr;
Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(revision 3033)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	(working copy)
@@ -2555,7 +2555,7 @@
 				break;
 			}
 			
-			if( p_ipoib->type.ip.hdr_ipv6.next_header != IP_PROT_UDP )
+			if( p_ipoib->type.ipv6.hdr.next_header != IP_PROT_UDP )
 			{
 				/* Unfiltered.  Setup the ethernet header and report. */
 				cl_perf_start( RecvTcp );
@@ -2563,7 +2563,7 @@
 				cl_perf_stop( &p_port->p_adapter->perf, RecvTcp );
 				break;
 			}
-			//ASSERT( p_ipoib->type.ip.hdr_ipv6.payload_length == sizeof(ipv6_hdr_t) );
+			//ASSERT( p_ipoib->type.ipv6.hdr.payload_length == sizeof(ipv6_hdr_t) );
 
 			/* First packet of a UDP transfer. */
 			if( len <
@@ -2576,10 +2576,10 @@
 			}
 
 			/* Check if DHCP conversion is required. */
-			if( (p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_IPV6_PORT_SERVER_OR_AGENT&&
-				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_IPV6_PORT_CLIENT) ||
-				(p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_IPV6_PORT_CLIENT &&
-				p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_IPV6_PORT_SERVER_OR_AGENT))
+			if( (p_ipoib->type.ipv6.prot.udp.hdr.dst_port == DHCP_IPV6_PORT_SERVER_OR_AGENT&&
+				p_ipoib->type.ipv6.prot.udp.hdr.src_port == DHCP_IPV6_PORT_CLIENT) ||
+				(p_ipoib->type.ipv6.prot.udp.hdr.dst_port == DHCP_IPV6_PORT_CLIENT &&
+				p_ipoib->type.ipv6.prot.udp.hdr.src_port == DHCP_IPV6_PORT_SERVER_OR_AGENT))
 			{
 				//TODO should be DHCP IPv6
 				if( len < (sizeof(ipoib_hdr_t) + sizeof(ipv6_hdr_t) +
@@ -4766,7 +4766,7 @@
 	//TODO: in this case we limited IP size to 20, but it can be bigger, according to GetIpPayloadPtr
 	if ( prot == ETH_PROT_TYPE_IPV6 ) 
 	{
-		cl_memcpy( &s_buf->p_send_buf->ip.hdr_ipv6, p_ip_hdr , sizeof(ipv6_hdr_t) );
+		cl_memcpy( &s_buf->p_send_buf->ipv6.hdr, p_ip_hdr , sizeof(ipv6_hdr_t) );
 	}
 	else
 	{
Index: ulp/ipoib_NDIS6_CM/kernel/ipoib_port.h
===================================================================
--- ulp/ipoib_NDIS6_CM/kernel/ipoib_port.h	(revision 3031)
+++ ulp/ipoib_NDIS6_CM/kernel/ipoib_port.h	(working copy)
@@ -212,6 +212,7 @@
 		uint8_t			data[MAX_UD_PAYLOAD_MTU];
 		ipoib_arp_pkt_t	arp;
 		ip_pkt_t		ip;
+		ipv6_pkt_t		ipv6;
 
 	}	PACK_SUFFIX type;
 
@@ -299,6 +300,7 @@
 	uint8_t			data[MAX_LSO_PAYLOAD_MTU];
 	ipoib_arp_pkt_t	arp;
 	ip_pkt_t		ip;
+	ipv6_pkt_t		ipv6;
 
 }	PACK_SUFFIX send_buf_t;
 /*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DHCP_ipv6_ofw_1.patch
Type: application/octet-stream
Size: 3220 bytes
Desc: DHCP_ipv6_ofw_1.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20101222/8f4dd0b7/attachment.obj>


More information about the ofw mailing list