From: ftillier Date: Wed, 30 Nov 2005 19:38:04 +0000 (+0000) Subject: [IPoIB] Fix send and receive counters. X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=8ae8aa281cacc23d9b55a2d87c33fda9e9026967;p=~shefty%2Frdma-win.git [IPoIB] Fix send and receive counters. Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il) Signed-off-by: Fab Tillier (ftillier@silverstorm.com) git-svn-id: svn://openib.tc.cornell.edu/gen1@193 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/ulp/ipoib/kernel/ipoib_port.c b/trunk/ulp/ipoib/kernel/ipoib_port.c index 8f01cc91..9ab1a415 100644 --- a/trunk/ulp/ipoib/kernel/ipoib_port.c +++ b/trunk/ulp/ipoib/kernel/ipoib_port.c @@ -1740,9 +1740,9 @@ __recv_mgr_filter( continue; } - len = p_wc->length; + len = p_wc->length - sizeof(ib_grh_t); - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t)) ) + if( len < sizeof(ipoib_hdr_t) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received ETH packet < min size\n") ); @@ -1782,8 +1782,7 @@ __recv_mgr_filter( switch( p_ipoib->hdr.type ) { case ETH_PROT_TYPE_IP: - if( len < - (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t)) ) + if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t)) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received IP packet < min size\n") ); @@ -1802,8 +1801,8 @@ __recv_mgr_filter( } /* First packet of a UDP transfer. */ - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + - sizeof(ip_hdr_t) + sizeof(udp_hdr_t)) ) + if( len < + (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) + sizeof(udp_hdr_t)) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received UDP packet < min size\n") ); @@ -1817,8 +1816,8 @@ __recv_mgr_filter( (p_ipoib->type.ip.prot.udp.hdr.dst_port == DHCP_PORT_CLIENT && p_ipoib->type.ip.prot.udp.hdr.src_port == DHCP_PORT_SERVER) ) { - if( len < (sizeof(ib_grh_t) + sizeof(ipoib_hdr_t) + - sizeof(ip_hdr_t) + sizeof(udp_hdr_t) + DHCP_MIN_SIZE )) + if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) + + sizeof(udp_hdr_t) + DHCP_MIN_SIZE) ) { IPOIB_TRACE( IPOIB_DBG_ERROR, ("Received DHCP < min size\n") ); @@ -1872,7 +1871,7 @@ __recv_mgr_filter( { p_desc->len = len + sizeof(eth_hdr_t) - sizeof(ipoib_hdr_t); - if( p_dst ) + if( p_dst->h_mcast) { if( p_dst->dgid.multicast.raw_group_id[10] == 0xFF && p_dst->dgid.multicast.raw_group_id[11] == 0xFF && @@ -3651,6 +3650,7 @@ __send_cb( ib_wc_t wc[MAX_SEND_WC], *p_wc, *p_free; cl_qlist_t done_list; NDIS_PACKET *p_packet; + uint32_t length; ipoib_endpt_t *p_endpt; send_buf_t *p_send_buf; ip_stat_sel_t type; @@ -3720,8 +3720,8 @@ __send_cb( { type = IP_STAT_UCAST_BYTES; } - ipoib_inc_send_stat( p_port->p_adapter, type, - p_wc->length - sizeof(ipoib_hdr_t) + sizeof(eth_hdr_t) ); + NdisQueryPacketLength( p_packet, &length ); + ipoib_inc_send_stat( p_port->p_adapter, type, length ); NdisMSendComplete( p_port->p_adapter->h_adapter, p_packet, NDIS_STATUS_SUCCESS ); break;