[ofw] [Patch] [IPoIB_NDIS6_CM] Calling receive statistics twice

Alex Naslednikov xalex at mellanox.co.il
Sun Jan 10 01:14:43 PST 2010


This patch fixes the same problem
when reporting the statistic twice
for IPoIB based on NDIS 5.3

Index: ipoib_port.c
===================================================================
--- ipoib_port.c	(revision 5436)
+++ ipoib_port.c	(working copy)
@@ -2136,7 +2136,6 @@
 		}
 		else
 		{
-			ip_stat_sel_t		    ip_stat;
 			p_desc->len =
 				len + sizeof(eth_hdr_t) -
sizeof(ipoib_hdr_t);
 			if( p_dst->h_mcast)
@@ -2147,22 +2146,18 @@
 
p_dst->dgid.multicast.raw_group_id[13] == 0xFF )
 				{
 					p_desc->type = PKT_TYPE_BCAST;
-					ip_stat = IP_STAT_BCAST_BYTES;
 				}
 				else
 				{
 					p_desc->type = PKT_TYPE_MCAST;
-					ip_stat = IP_STAT_MCAST_BYTES;
 				}
 			}
 			else
 			{
 				p_desc->type = PKT_TYPE_UCAST;
-				ip_stat = IP_STAT_UCAST_BYTES;
 				
 			}
 			cl_qlist_insert_tail( p_done_list,
&p_desc->item.list_item );
-			ipoib_inc_recv_stat( p_port->p_adapter,ip_stat ,
p_desc->len );  
 		}
 	}
 

-----Original Message-----
From: Alex Naslednikov 
Sent: Monday, January 04, 2010 1:02 PM
To: ofw at lists.openfabrics.org
Cc: Tzachi Dar
Subject: [ofw] [Patch] [IPoIB_NDIS6_CM] Calling receive statistics twice

This patch fixes the problem when IPoIB increments the receive
statistics twice Signed-off by: Tzachi Dar (tzachid at mellanox.co.il)
Index:
D:/windows/MLNX_WinOF_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
===================================================================
--- D:/windows/MLNX_WinOF_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp
(revision 5415)
+++ D:/windows/MLNX_WinOF_trunk/ulp/ipoib_NDIS6_CM/kernel/ipoib_port.cpp

+++ (revision 5416)
@@ -2958,7 +2958,6 @@
 {
  NDIS_STATUS       status;
  uint32_t       pkt_filter;
- ip_stat_sel_t      type;
  //NDIS60
  NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO  chksum;
  //NDIS_TCP_IP_CHECKSUM_PACKET_INFO chksum; @@ -2980,14 +2979,12 @@
    pkt_filter & NDIS_PACKET_TYPE_DIRECTED )
   {
    /* OK to report. */
-   type = IP_STAT_UCAST_BYTES;
    status = NDIS_STATUS_SUCCESS;
    IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_ERROR,
    ("Received UCAST PKT.\n"));
   }
   else
   {
-   type = IP_STAT_DROPPED;
    status = NDIS_STATUS_FAILURE;
    IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
     ("Received UCAST PKT with ERROR !!!!\n")); @@ -2998,14 +2995,12 @@
    pkt_filter & NDIS_PACKET_TYPE_BROADCAST )
   {
    /* OK to report. */
-   type = IP_STAT_BCAST_BYTES;
    status = NDIS_STATUS_SUCCESS;
    IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_RECV,
    ("Received BCAST PKT.\n"));
   }
   else
   {
-   type = IP_STAT_DROPPED;
    status = NDIS_STATUS_FAILURE;
    IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
    ("Received BCAST PKT with ERROR !!!!\n")); @@ -3017,14 +3012,12 @@
    pkt_filter & NDIS_PACKET_TYPE_MULTICAST )
   {
    /* OK to report. */
-   type = IP_STAT_MCAST_BYTES;
    status = NDIS_STATUS_SUCCESS;
    IPOIB_PRINT( TRACE_LEVEL_VERBOSE, IPOIB_DBG_RECV,
    ("Received UCAST PKT.\n"));
   }
   else
   {
-   type = IP_STAT_DROPPED;
    status = NDIS_STATUS_FAILURE;
    IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
    ("Received MCAST PKT with ERROR !!!!\n")); @@ -3034,7 +3027,6 @@
 
  if( status != NDIS_STATUS_SUCCESS )
  {
-  ipoib_inc_recv_stat( p_port->p_adapter, type, 0, 0 );
   /* Return the receive descriptor to the pool. */
   __buf_mgr_put_recv( p_port, p_desc, NULL );
   IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, @@ -3088,7
+3080,6 @@
   (void*)(uintn_t)chksum.Value;
   break;
  }
- ipoib_inc_recv_stat( p_port->p_adapter, type, p_desc->len, 1 );
 
  IPOIB_EXIT( IPOIB_DBG_RECV );
  return IB_SUCCESS;




More information about the ofw mailing list