[Openib-windows] [PATCH] 2c_addresschange WHQL test

Yossi Leybovich sleybo at mellanox.co.il
Tue May 9 07:28:39 PDT 2006


Fab 
 
This patch enable our IPoIB to read and configure current address from
registry.
Still the send/recv test to the new programmed address failed.
This is because the IPoIB architecture, IPoIB does not use the Eth MAC
it send the IPoIB MAC (GID+QPN).

We need to figure out (with MS ) how we can change the test so IPoIB
will pass it.
We have some ideas to change IPoIB in order to pass this (generate
special ARP to resolve MAC to IPOIB MAC)
But it will better if MS will change the test.

But still this is the first step and it reduce the number of failures
from 9 to 6. 
I think we should commit it and cont. to negotiate with MS.
 
What do you think ?

10x
Yossi 
 
Singed-off-by: Yossi Leybovich (sleybo at mellanox.co.il)
 
Index: ip_packet.h
===================================================================
--- ip_packet.h (revision 1322)
+++ ip_packet.h (working copy)
@@ -47,6 +47,9 @@
 #define ETH_PROT_TYPE_ARP CL_HTON16(0x806)
 
 
+#define ETH_IS_LOCALLY_ADMINISTERED(addr) \
+ (BOOLEAN)(((PUCHAR)(addr))[0] & ((UCHAR)0x02))
+
 #include <complib/cl_packon.h>
 /****s* IB Network Drivers/mac_addr_t
 * NAME
Index: kernel/ipoib_adapter.h
===================================================================
--- kernel/ipoib_adapter.h (revision 1322)
+++ kernel/ipoib_adapter.h (working copy)
@@ -71,6 +71,7 @@
  uint32_t sa_retry_cnt;
  uint32_t recv_pool_ratio;
  boolean_t recv_growth;
+ mac_addr_t conf_mac;
 } ipoib_params_t;
 /*
 * FIELDS
Index: kernel/ipoib_driver.c
===================================================================
--- kernel/ipoib_driver.c (revision 1322)
+++ kernel/ipoib_driver.c (working copy)
@@ -393,13 +393,15 @@
 NDIS_STATUS
 ipoib_get_adapter_params(
  IN    NDIS_HANDLE* const   wrapper_config_context,
-  OUT   ipoib_params_t* const  p_params )
+ OUT   ipoib_params_t* const  p_params )
 {
  NDIS_STATUS      status;
  NDIS_HANDLE      h_config;
  NDIS_CONFIGURATION_PARAMETER *p_param;
  NDIS_STRING      keyword;
-
+ PUCHAR       mac;
+ UINT       len;
+ 
  IPOIB_ENTER( IPOIB_DBG_INIT );
 
  NdisOpenConfiguration( &status, &h_config, wrapper_config_context );
@@ -518,6 +520,30 @@
  else
   p_params->recv_growth = (p_param->ParameterData.IntegerData != 0);
 
+ NdisReadNetworkAddress(
+  &status,
+  &mac,
+  &len,
+  h_config);
+
+ // If there is a NetworkAddress override in registry, use it 
+ if ((status == NDIS_STATUS_SUCCESS) && (len == HW_ADDR_LEN))
+ {
+  if ((ETH_IS_MULTICAST(mac) 
+   || ETH_IS_BROADCAST(mac))
+   || !ETH_IS_LOCALLY_ADMINISTERED (mac))
+  {
+   IPOIB_PRINT(TRACE_LEVEL_ERROR,IPOIB_DBG_INIT, 
+   ("Overriding NetworkAddress is invalid -
%02x-%02x-%02x-%02x-%02x-%02x\n", 
+   mac[0], mac[1], mac[2],
+   mac[3], mac[4], mac[5]));
+  }
+  else
+  {
+   ETH_COPY_NETWORK_ADDRESS(p_params->conf_mac.addr, mac);
+  }
+ }
+
  NdisCloseConfiguration( h_config );
 
  IPOIB_EXIT( IPOIB_DBG_INIT );
@@ -1148,23 +1174,19 @@
 
  /* Required Ethernet operational characteristics */
  case OID_802_3_PERMANENT_ADDRESS:
- case OID_802_3_CURRENT_ADDRESS:
-#if defined( _DEBUG_ )
-  if( oid == OID_802_3_PERMANENT_ADDRESS )
-  {
-   IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
-    ("Port %d received query for OID_802_3_PERMANENT_ADDRESS\n",
port_num) );
-  }
-  else
-  {
-   IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
-    ("Port %d received query for OID_802_3_CURRENT_ADDRESS\n",
port_num) );
-  }
-#endif /* defined( _DEBUG_ )*/
+  IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
+   ("Port %d received query for OID_802_3_PERMANENT_ADDRESS\n",
port_num) );
   src_buf = &p_adapter->mac;
   buf_len = sizeof(p_adapter->mac);
   break;
 
+ case OID_802_3_CURRENT_ADDRESS:
+  IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
+   ("Port %d received query for OID_802_3_CURRENT_ADDRESS\n", port_num)
);
+  src_buf = &p_adapter->params.conf_mac;
+  buf_len = sizeof(p_adapter->params.conf_mac);
+  break;
+
  case OID_802_3_MULTICAST_LIST:
   IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,
    ("Port %d received query for OID_802_3_MULTICAST_LIST\n", port_num)
);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2c_addresschange.patch
Type: application/octet-stream
Size: 3446 bytes
Desc: 2c_addresschange.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060509/8c21f050/attachment.obj>


More information about the ofw mailing list