[ofw] [IPoIB CM]Patch handling of Non IP packets

Alex Estrin alex.estrin at qlogic.com
Fri Feb 27 06:20:38 PST 2009


Hello,

Redirection of non-IP packets wasn't set properly. This patch fixes it.
However there is a problem for large raw packets - 
if destination endpoint is not connected that packets should be dropped. I'm not sure yet if there is another way to handle this.

Thanks,
Alex. 


Index: ipoib_port.c
===================================================================
--- ipoib_port.c	(revision 1979)
+++ ipoib_port.c	(working copy)
@@ -3149,8 +3149,23 @@
 		 * The IPoIB spec doesn't define how to send non IP or ARP packets.
 		 * Just send the payload and hope for the best.
 		 */
+		if( endpt_cm_get_state( p_desc->p_endpt ) != IPOIB_CM_CONNECTED )
+		{
+			UINT	packet_length;
+			NdisQueryPacketLength( p_desc->p_pkt, &packet_length );
+			if( ( packet_length - sizeof(eth_hdr_t) ) > MAX_UD_PAYLOAD_MTU )
+			{
+				IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_ERROR,
+					("Send failed for raw packet length %d\n", packet_length ) );
+				return NDIS_STATUS_INVALID_LENGTH;
+			}
+			p_desc->send_dir = SEND_UD_QP;
+		}
+		else
+		{
+			p_desc->send_dir = SEND_RC_QP;
+		}
 
-		p_desc->send_dir = SEND_UD_QP;
 		cl_perf_start( SendGen );
 		status = __send_gen( p_port, p_desc, 0 );
 		cl_perf_stop( &p_port->p_adapter->perf, SendGen );
@@ -4647,6 +4662,10 @@
 				ipoib_endpt_deref( p_desc->p_endpt );
 				break;
 			}
+			if( status == NDIS_STATUS_INVALID_LENGTH )
+			{
+				status = NDIS_STATUS_SUCCESS;
+			}
 			cl_perf_start( ProcessFailedSends );
 			__process_failed_send( p_port, p_desc, status );
 			cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );
@@ -4791,6 +4810,10 @@
 				ipoib_endpt_deref( p_desc->p_endpt );
 				break;
 			}
+			if( status == NDIS_STATUS_INVALID_LENGTH )
+			{
+				status = NDIS_STATUS_SUCCESS;
+			}
 			cl_perf_start( ProcessFailedSends );
 			__process_failed_send( p_port, p_desc, status );
 			cl_perf_stop( &p_port->p_adapter->perf, ProcessFailedSends );



More information about the ofw mailing list