[ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets

Alex Naslednikov xalex at mellanox.co.il
Mon Jan 26 02:11:01 PST 2009


The following patch is a more correct solution for IPoIB stack (not
IPoIB_CM)
Tzachi, please review
Index: ipoib_port.c
===================================================================
--- ipoib_port.c (revision 3777)
+++ ipoib_port.c (working copy)
@@ -3403,6 +3403,18 @@
 
  IPOIB_ENTER( IPOIB_DBG_SEND );
 
+ if (p_ip_hdr->offset > 0) {
+  /* This is a fragmented part of UDP packet
+   * Only first packet will contain UDP header in such case
+   * So, return if offset > 0
+   */
+  cl_perf_start( SendUdp );
+  status = __send_gen( p_port, p_desc,0 );
+  cl_perf_stop( &p_port->p_adapter->perf, SendUdp );
+  IPOIB_EXIT( IPOIB_DBG_SEND );
+  return status;
+ }
+ 
  if( !buf_len )
  {
   cl_perf_start( QueryUdp );
@@ -3426,16 +3438,8 @@
  {
   p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);
  }
+ 
  /* Get the UDP header and check the destination port numbers. */
- 
- if (p_ip_hdr->offset > 0) {
-  /* This is a fragmented part of UDP packet
-   * Only first packet will contain UDP header in such case
-   * So, return if offset > 0
-   */
-   return NDIS_STATUS_PENDING;
- }
- 
  if( buf_len < sizeof(udp_hdr_t) )
  {
   IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR


________________________________

	From: Alex Naslednikov 
	Sent: Sunday, January 18, 2009 4:37 PM
	To: ofw at lists.openfabrics.org
	Cc: Tzachi Dar; Alex Estrin
	Subject: [ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets
	
	
	Several test were failed on sending UDP packets with MTU-like
sizes.
	Fragmented UDP packets do not contain UDP header, except the
first one.
	So, appropriate check was inserted.
	 
	This bug was shown rarely (only when the last fragment was less
than 8 bytes), because the following check always worked (by mistake):
	 
	if( (p_udp_hdr->src_port != DHCP_PORT_CLIENT ||
	  p_udp_hdr->dst_port != DHCP_PORT_SERVER) &&
	  (p_udp_hdr->src_port != DHCP_PORT_SERVER ||
	  p_udp_hdr->dst_port != DHCP_PORT_CLIENT) )
	 {
	  /* Not a DHCP packet. */
	  return NDIS_STATUS_PENDING;
	 }
	 
	Index: ipoib_port.c
	
===================================================================
	--- ipoib_port.c (revision 3752)
	+++ ipoib_port.c (working copy)
	@@ -3763,6 +3763,15 @@
	   p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);
	  }
	  /* Get the UDP header and check the destination port numbers.
*/
	+ 
	+ if (p_ip_hdr->offset > 0) {
	+  /* This is a fragmented part of UDP packet
	+   * Only first packet will contain UDP header in such case
	+   * So, return if offset > 0
	+   */
	+   return NDIS_STATUS_PENDING;
	+ }
	+   
	  if( buf_len < sizeof(udp_hdr_t) )
	  {
	   IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090126/6721b406/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_cm_ud_mtu_for_IPOIB.patch
Type: application/octet-stream
Size: 1134 bytes
Desc: ipoib_cm_ud_mtu_for_IPOIB.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090126/6721b406/attachment.obj>


More information about the ofw mailing list