[ofw] [PATCH] 2 of 6 ipoib_ndis6_cm - conditionalize and move debug code to debug file

Smith, Stan stan.smith at intel.com
Tue Jun 28 14:36:16 PDT 2011


Migrate debug code into ipoib_debug.cpp and make conditional on EXTRA_DEBUG==1; trim the default compilation base.
When exceeding Hardware SQ depth, announce current SQ depth.

Signed-off-by: stan smith <stan.smith at intel.com>

--- C:/Users/scsmith/AppData/Local/Temp/ipoib_port.cpp-revBASE.svn000.tmp.cpp	Tue Jun 28 14:11:46 2011
+++ C:/Users/scsmith/Documents/openIB-windows/SVN/gen1/trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp	Tue Jun 28 11:00:21 2011
@@ -4068,106 +4068,6 @@
 	IPOIB_EXIT( IPOIB_DBG_SEND );
 }
 
-#if 0
-
-static char *get_ipv6_nxt_hdr_str(UINT8 NH)
-{
-	static char what[28];
-
-	switch( NH )
-	{
-	  case IPPROTO_HOPOPTS:
-		return "Hop-by-Hop";
-
-	  case IPPROTO_ICMP:
-		return "ICMP";
-
-	  case IPPROTO_IGMP:
-		return "IGMP";
-
-	  case IPPROTO_GGP:
-		return "GGP";
-
-	  case IPPROTO_IPV4:
-		return "IPV4";
-
-	  case IPPROTO_ST:
-		return "ST";
-
-	  case IPPROTO_TCP:
-		return "TCP";
-
-	  case IPPROTO_CBT:
-		return "CBT";
-
-	  case IPPROTO_EGP:
-		return "EGP";
-
-	  case IPPROTO_IGP:
-		return "IGP";
-
-	  case IPPROTO_PUP:
-		return "PUP";
-
-	  case IPPROTO_UDP:
-		return "UDP";
-
-	  case IPPROTO_IDP:
-		return "IDP";
-
-	  case IPPROTO_RDP:
-		return "RDP";
-
-	  case IPPROTO_IPV6:
-		return "IPV6";
-
-	  case IPPROTO_ROUTING:
-		return "ROUTING";
-
-	  case IPPROTO_FRAGMENT:
-		return "FRAGMENT";
-
-	  case IPPROTO_ESP:
-		return "ESP";
-
-	  case IPPROTO_AH:
-		return "AH";
-
-	  case IPPROTO_ICMPV6:
-		return "ICMPV6";
-
-	  case IPPROTO_NONE:
-		return "NONE";
-
-	  case IPPROTO_DSTOPTS:
-		return "DSTOPTS";
-
-	  case IPPROTO_ND:
-		return "ND";
-
-	  case IPPROTO_ICLFXBM:
-		return "ICLFXBM";
-
-	  case IPPROTO_PIM:
-		return "PIM";
-
-	  case IPPROTO_PGM:
-		return "PGM";
-
-	  case IPPROTO_L2TP:
-		return "L2TP";
-
-	  case IPPROTO_SCTP:
-		return "SCTP";
-
-	  default:
-		break;
-	}
-	StringCchPrintf(what,sizeof(what),"Unknown Proto %u",NH);
-	return what;
-}
-#endif // DBG
-
 
 static NDIS_STATUS
 __send_mgr_filter(
@@ -4375,80 +4275,6 @@
 }
 
 
-char *get_eth_packet_type_str(net16_t pkt_type)
-{
-	static char what[28];
-
-	switch( pkt_type )
-	{
-	  case ETH_PROT_TYPE_IP:  
-		return "ETH_PROT_IP";
-
-	  case ETH_PROT_TYPE_IPV6:  
-		return "ETH_PROT_IPV6";
-
-	  case ETH_PROT_TYPE_ARP:  
-		return "ETH_PROT_ARP";
-
-	  case ETH_PROT_TYPE_RARP:  
-		return "ETH_PROT_RARP";
-
-	  case ETH_PROT_VLAN_TAG:  
-		return "ETH_PROT_VLAN_TAG";
-
-	  default:
-		break;
-	}
-	StringCchPrintf(what,sizeof(what),"Unknown Eth packet type 0x%x",pkt_type);
-	return what;
-}
-
-char *get_IP_protocol_str(uint8_t proto)
-{
-	static char what[28];
-
-	switch( proto )
-	{
-	  case IPPROTO_HOPOPTS:
-		return "IPPROTO_HOPOPTS";
-
-	  case IPPROTO_IPV4:
-		return "IPPROTO_IP";
-
-	  case IPPROTO_IPV6:
-		return "IPPROTO_ICMP";
-
-	  case IPPROTO_TCP:  
-		return "IPPROTO_TCP";
-
-	  case IPPROTO_UDP:
-		return "IPPROTO_UDP";
-
-	  case IPPROTO_IGMP:
-		return "IPPROTO_IGMP";
-
-	  case IPPROTO_ICMP:
-		return "IPPROTO_ICMP";
-
-	  case IPPROTO_ICMPV6:
-		return "IPPROTO_ICMPV6";
-
-	  case IPPROTO_NONE:
-		return "IPPROTO_NONE";
-
-	  case IPPROTO_DSTOPTS:
-		return "IPPROTO_DSTOPTS";
-
-	  case IPPROTO_SCTP:
-		return "IPPROTO_SCTP";
-
-	  default:
-		break;
-	}
-	StringCchPrintf(what,sizeof(what),"Unknown IP protocol %d",proto);
-	return what;
-}
-
 static inline NDIS_STATUS
 __send_mgr_get_eth_hdr(
 	IN				PNET_BUFFER					p_net_buffer,
@@ -4482,11 +4308,13 @@
 
 	*pp_eth_hdr = (eth_hdr_t*)(p_head + MdlDataOffset);
 
+#if EXTRA_DBG
 	IPOIB_PRINT_EXIT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_SEND,
 		("Ethernet header:\n\tsrc MAC: %s\n\tdst MAC: %s\n\tprotocol: %s\n",
 		mk_mac_str(&(*pp_eth_hdr)->src),
 		mk_mac_str2(&(*pp_eth_hdr)->dst),
 		get_eth_packet_type_str((*pp_eth_hdr)->type)) );
+#endif
 
 	return NDIS_STATUS_SUCCESS;
 }
@@ -6123,7 +5951,8 @@
 	if( p_port->send_mgr.depth == p_port->p_adapter->params.sq_depth )
 	{
 		IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ALL,
-			("HW SQ is full No available WQEs.\n") );
+			("HW SQ is full No available WQEs (sq_depth %d)\n",
+				p_port->send_mgr.depth) );
 		return NDIS_STATUS_PENDING;
 	}
 




More information about the ofw mailing list