[ofw] RE: port send fix for 2008

Smith, Stan stan.smith at intel.com
Wed Oct 15 08:34:00 PDT 2008


Has this patch been tested on 32 & 64 architectures?
Also tested on XP 32 & 64 + Server 2003?

If not, please do so prior to commit.

thank you,

Stan.

________________________________
From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Slava Strebkov
Sent: Wednesday, October 15, 2008 1:03 AM
To: ofw at lists.openfabrics.org
Subject: [ofw] port send fix for 2008

In 2008 server ethernet and IP headers are often coming in one ndis buffer, which is opposite to 2003.
So 2008 failed to get next buffer in ipoib_port_send  (NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );
Skipping the line
p_eth_hdr->dst.addr[1] = ((unsigned char*)&p_ip_hdr->dst_ip)[0] & 0x0f;

results in a wrong MCAST mac, so multicast group opened on IB switch is invalid.


Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c   (revision 1648)
+++ ulp/ipoib/kernel/ipoib_port.c (working copy)
@@ -4075,20 +4075,28 @@
                                    UINT                                         ip_hdr_buf_len;

                                    // Extract the ip hdr
-                                   NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );
-                                   if( !p_ip_hdr_buf )
+                                  if(buf_len >= sizeof(ip_hdr_t)+ sizeof(eth_hdr_t))
                                    {
-                                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
-                                                           ("Failed to get IP header buffer.\n") );
-                                               goto h_end;
+                                              p_ip_hdr = (ip_hdr_t*)(p_eth_hdr + 1);
+                                              ip_hdr_buf_len = sizeof(ip_hdr_t);
                                    }
-
-                                   NdisQueryBufferSafe( p_ip_hdr_buf, &p_ip_hdr, &ip_hdr_buf_len, NormalPagePriority );
-                                   if( !p_ip_hdr )
+                                  else
                                    {
-                                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
-                                                           ("Failed to query IP header buffer.\n") );
-                                               goto h_end;
+                                              NdisGetNextBuffer( p_buf, &p_ip_hdr_buf );
+                                              if( !p_ip_hdr_buf )
+                                              {
+                                                          IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
+                                                                      ("Failed to get IP header buffer.\n") );
+                                                          goto h_end;
+                                              }
+
+                                              NdisQueryBufferSafe( p_ip_hdr_buf, &p_ip_hdr, &ip_hdr_buf_len, NormalPagePriority );
+                                              if( !p_ip_hdr )
+                                              {
+                                                          IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
+                                                                      ("Failed to query IP header buffer.\n") );
+                                                          goto h_end;
+                                              }
                                    }

                                    if( ip_hdr_buf_len < sizeof(ip_hdr_t) )

Slava

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081015/c92cf86f/attachment.html>


More information about the ofw mailing list