[ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets
Tzachi Dar
tzachid at mellanox.co.il
Tue Jan 27 03:19:41 PST 2009
Applied in version 1891.
Thanks
Tzachi
________________________________
From: Alex Naslednikov
Sent: Monday, January 26, 2009 12:11 PM
To: Alex Naslednikov; ofw at lists.openfabrics.org
Cc: Tzachi Dar; Alex Estrin
Subject: RE: [ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets
The following patch is a more correct solution for IPoIB stack
(not IPoIB_CM)
Tzachi, please review
Index: ipoib_port.c
===================================================================
--- ipoib_port.c (revision 3777)
+++ ipoib_port.c (working copy)
@@ -3403,6 +3403,18 @@
IPOIB_ENTER( IPOIB_DBG_SEND );
+ if (p_ip_hdr->offset > 0) {
+ /* This is a fragmented part of UDP packet
+ * Only first packet will contain UDP header in such case
+ * So, return if offset > 0
+ */
+ cl_perf_start( SendUdp );
+ status = __send_gen( p_port, p_desc,0 );
+ cl_perf_stop( &p_port->p_adapter->perf, SendUdp );
+ IPOIB_EXIT( IPOIB_DBG_SEND );
+ return status;
+ }
+
if( !buf_len )
{
cl_perf_start( QueryUdp );
@@ -3426,16 +3438,8 @@
{
p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);
}
+
/* Get the UDP header and check the destination port numbers.
*/
-
- if (p_ip_hdr->offset > 0) {
- /* This is a fragmented part of UDP packet
- * Only first packet will contain UDP header in such case
- * So, return if offset > 0
- */
- return NDIS_STATUS_PENDING;
- }
-
if( buf_len < sizeof(udp_hdr_t) )
{
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR
________________________________
From: Alex Naslednikov
Sent: Sunday, January 18, 2009 4:37 PM
To: ofw at lists.openfabrics.org
Cc: Tzachi Dar; Alex Estrin
Subject: [ofw] [IPoIB, IPoIB_CM] Bugfix for UDP packets
Several test were failed on sending UDP packets with
MTU-like sizes.
Fragmented UDP packets do not contain UDP header, except
the first one.
So, appropriate check was inserted.
This bug was shown rarely (only when the last fragment
was less than 8 bytes), because the following check always worked (by
mistake):
if( (p_udp_hdr->src_port != DHCP_PORT_CLIENT ||
p_udp_hdr->dst_port != DHCP_PORT_SERVER) &&
(p_udp_hdr->src_port != DHCP_PORT_SERVER ||
p_udp_hdr->dst_port != DHCP_PORT_CLIENT) )
{
/* Not a DHCP packet. */
return NDIS_STATUS_PENDING;
}
Index: ipoib_port.c
===================================================================
--- ipoib_port.c (revision 3752)
+++ ipoib_port.c (working copy)
@@ -3763,6 +3763,15 @@
p_udp_hdr = (udp_hdr_t*)GetIpPayloadPtr(p_ip_hdr);
}
/* Get the UDP header and check the destination port
numbers. */
+
+ if (p_ip_hdr->offset > 0) {
+ /* This is a fragmented part of UDP packet
+ * Only first packet will contain UDP header in such
case
+ * So, return if offset > 0
+ */
+ return NDIS_STATUS_PENDING;
+ }
+
if( buf_len < sizeof(udp_hdr_t) )
{
IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20090127/3d2a9268/attachment.html>
More information about the ofw
mailing list