[ofw] port send fix for 2008

Slava Strebkov slavas at voltaire.com
Wed Oct 15 01:03:18 PDT 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/61771fcb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2008_mcast_send.diff
Type: application/octet-stream
Size: 1448 bytes
Desc: 2008_mcast_send.diff
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20081015/61771fcb/attachment.obj>


More information about the ofw mailing list