From: aestrin Date: Fri, 5 Sep 2008 15:57:43 +0000 (+0000) Subject: [ipoib] here are the changes mistakenly made in the trunk rev. 1547-1549 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=60a19fbc57c5be9eae8f7ff9d06324ef643ee4f2;p=~shefty%2Frdma-win.git [ipoib] here are the changes mistakenly made in the trunk rev. 1547-1549 git-svn-id: svn://openib.tc.cornell.edu/gen1@1552 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/ipoib_cm/kernel/ipoib_driver.h b/branches/ipoib_cm/kernel/ipoib_driver.h index 81f17f88..0660f593 100644 --- a/branches/ipoib_cm/kernel/ipoib_driver.h +++ b/branches/ipoib_cm/kernel/ipoib_driver.h @@ -47,8 +47,8 @@ */ #define MAX_BUNDLE_ID_LENGTH 32 - -#define IB_MTU 2048 +/* MLX4 supports 4K MTU */ +#define IB_MTU 4096 /* * Header length as defined by IPoIB spec: * http://www.ietf.org/internet-drafts/draft-ietf-ipoib-ip-over-infiniband-04.txt @@ -143,4 +143,13 @@ void ipoib_resume_oids( IN ipoib_adapter_t* const p_adapter ); +#define IPOIB_OFFSET(field) ((UINT)FIELD_OFFSET(ipoib_params_t,field)) +#define IPOIB_SIZE(field) sizeof(((ipoib_params_t*)0)->field) +#define IPOIB_INIT_NDIS_STRING(str) \ + (str)->Length = 0; \ + (str)->MaximumLength = 0; \ + (str)->Buffer = NULL; + + + #endif /* _IPOIB_DRIVER_H_ */ diff --git a/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h b/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h index 435894a3..e4775814 100644 --- a/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h +++ b/branches/ipoib_cm/kernel/ipoib_xfr_mgr.h @@ -47,6 +47,7 @@ #include "ip_stats.h" #include + #include /****s* IPoIB Driver/ipoib_hw_addr_t * NAME @@ -218,19 +219,22 @@ ipoib_mac_from_mlx_guid( { const uint8_t *p_guid = (const uint8_t*)&port_guid; uint32_t low24; + net16_t guid_middle; /* Port guid is in network byte order. OUI is in lower 3 bytes. */ ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x02 && p_guid[2] == 0xc9 ); - if( (port_guid & CL_HTON64( 0x000000ffff000000 )) != - CL_HTON64(0x0000000200000000)) - { + guid_middle = (net16_t)((port_guid & CL_HTON64( 0x000000ffff000000 )) >>24); + + if (guid_middle == 2) { + p_mac_addr->addr[0] = 0; + } else if (guid_middle == 3) { + p_mac_addr->addr[0] = 2; + } else { return IB_INVALID_GUID; } - low24 = ((uint32_t)cl_ntoh64( port_guid ) & 0x00FFFFFF); - p_mac_addr->addr[0] = p_guid[0]; p_mac_addr->addr[1] = p_guid[1]; p_mac_addr->addr[2] = p_guid[2]; p_mac_addr->addr[3] = (uint8_t)(low24 >> 16); @@ -348,6 +352,34 @@ ipoib_mac_from_cisco_guid( return IB_SUCCESS; } +/****f* IPOIB/ipoib_mac_from_hp_guid +* NAME +* ipoib_mac_from_hp_guid +* +* DESCRIPTION +* Generates an ethernet MAC address given a HP port GUID. +* +* SYNOPSIS +*/ +static inline ib_api_status_t +ipoib_mac_from_hp_guid( + IN const net64_t port_guid, + OUT mac_addr_t* const p_mac_addr ) +{ + const uint8_t *p_guid = (const uint8_t*)&port_guid; + + /* Port guid is in network byte order. OUI is in lower 3 bytes. */ + ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x1a && p_guid[2] == 0x4b); + + p_mac_addr->addr[0] = 0; + p_mac_addr->addr[1] = 0x1a; + p_mac_addr->addr[2] = 0x4b; + p_mac_addr->addr[3] = p_guid[5]; + p_mac_addr->addr[4] = p_guid[6]; + p_mac_addr->addr[5] = p_guid[7]; + + return IB_SUCCESS; +} /* * PARAMETERS @@ -418,8 +450,14 @@ ipoib_mac_from_guid( if( status == IB_SUCCESS ) return IB_SUCCESS; } - + else if( p_guid[1] == 0x1a && p_guid[2] == 0x4b ) + { + status = ipoib_mac_from_hp_guid( port_guid, p_mac_addr ); + if( status == IB_SUCCESS ) + return IB_SUCCESS; + } } + /* Value of zero is reserved. */ laa = cl_atomic_inc( &g_ipoib.laa_idx ); @@ -616,6 +654,7 @@ ipoib_is_voltaire_router_gid( sizeof(VOLTAIRE_GUID_PREFIX) ); } + #ifdef __cplusplus } #endif