[ofw] [PATCH 1/3] IBAL (checksum): restoring vendor_specific field

Alex Estrin alex.estrin at qlogic.com
Tue Sep 9 09:27:34 PDT 2008


Proposed patch utilizes WC receive options field for IPOIB checksum
bits.
Please review.

Index: hw/mlx4/kernel/bus/ib/cq.c
===================================================================
--- hw/mlx4/kernel/bus/ib/cq.c	(revision 1573)
+++ hw/mlx4/kernel/bus/ib/cq.c	(working copy)
@@ -338,10 +338,10 @@
 	wc->vendor_specific = cqe->vendor_err_syndrome;
 }
 
-static uint8_t mlx4_ib_ipoib_csum_ok(__be32 status, __be16 checksum) {
+static uint32_t mlx4_ib_ipoib_csum_ok(__be32 status, __be16 checksum) {
 	
 	#define CSUM_VALID_NUM 0xffff
-	uint8_t res = 0;
+	uint32_t res = 0;
 
 	// Verify that IP_OK bit is set and the packet is pure IPv4
packet
 	if ((status & cpu_to_be32(MLX4_CQE_IPOIB_STATUS_IPV4
|
@@ -361,7 +361,7 @@
 				ASSERT( status &
cpu_to_be32(MLX4_CQE_IPOIB_STATUS_TCP | MLX4_CQE_IPOIB_STATUS_UDP));
 		}
 	}
-	return res;
+	return (( res << 8 ) & IB_RECV_OPT_CSUM_MASK );
 }
 
 static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
@@ -498,7 +498,7 @@
 		wc->recv.ud.path_bits		=
(u8)(cqe->g_mlpath_rqpn & 0x7f);
 		wc->recv.ud.recv_opt		|= cqe->g_mlpath_rqpn &
0x080 ? IB_RECV_OPT_GRH_VALID : 0;
 		wc->recv.ud.pkey_index	=
(u16)(be32_to_cpu(cqe->immed_rss_invalid)  & 0x7f);
-		wc->recv.ud.csum_ok =
mlx4_ib_ipoib_csum_ok(cqe->ipoib_status,cqe->checksum);
+		wc->recv.ud.recv_opt |=
mlx4_ib_ipoib_csum_ok(cqe->ipoib_status,cqe->checksum);
 	}
 	if (!is_send && cqe->rlid == 0){
 		MLX4_PRINT(TRACE_LEVEL_INFORMATION,MLX4_DBG_CQ,("found
rlid == 0 \n "));
Index: hw/mthca/kernel/mthca_cq.c
===================================================================
--- hw/mthca/kernel/mthca_cq.c	(revision 1573)
+++ hw/mthca/kernel/mthca_cq.c	(working copy)
@@ -445,10 +445,10 @@
 	*free_cqe = 0;
 }
 
-static inline uint8_t mthca_ib_ipoib_csum_ok(u16 checksum, u8 ip_ok) {
+static inline uint32_t mthca_ib_ipoib_csum_ok(u16 checksum, u8 ip_ok) {
 	
 	#define CSUM_VALID_NUM 0xffff
-	uint8_t res = 0;
+	uint32_t res = 0;
 	
 	// Verify that IP_OK bit is set and the packet is pure IPv4
packet
 	if (ip_ok)
@@ -461,7 +461,7 @@
 
MTHCA_NdisPacketTcpChecksumSucceeded );
 		}
 	}
-	return res;
+	return ( ( res << 8 ) & IB_RECV_OPT_CSUM_MASK );
 }
 
 static inline int mthca_poll_one(struct mthca_dev *dev,
@@ -610,7 +610,7 @@
 		entry->recv.ud.recv_opt   |= cqe->g_mlpath & 0x80 ?
IB_RECV_OPT_GRH_VALID : 0;
 		checksum = (u16)((cl_ntoh32(cqe->rqpn) >> 24) |
 				((cl_ntoh32(cqe->my_ee) >> 16) &
0xff00));
-		entry->recv.ud.csum_ok =
mthca_ib_ipoib_csum_ok(checksum, cqe->sl_ipok & 1);
+		entry->recv.ud.recv_opt  |=
mthca_ib_ipoib_csum_ok(checksum, cqe->sl_ipok & 1);
 	}
 	if (!is_send && cqe->rlid == 0){
 		HCA_PRINT(TRACE_LEVEL_INFORMATION,HCA_DBG_CQ,("found
rlid == 0 \n "));
Index: inc/iba/ib_types.h
===================================================================
--- inc/iba/ib_types.h	(revision 1573)
+++ inc/iba/ib_types.h	(working copy)
@@ -10609,6 +10609,7 @@
 #define IB_RECV_OPT_FORWARD			0x00000002
 #define IB_RECV_OPT_GRH_VALID		0x00000004
 #define IB_RECV_OPT_VEND_MASK		0xFFFF0000
+#define IB_RECV_OPT_CSUM_MASK		0x0000FF00
 /*
 * VALUES
 *	IB_RECV_OPT_IMMEDIATE
@@ -10665,7 +10666,6 @@
 			ib_net16_t		remote_lid;
 			uint8_t			remote_sl;
 			uint8_t			path_bits;
-			uint8_t 		csum_ok;
 
 		}	ud;
 
Index: ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- ulp/ipoib/kernel/ipoib_port.c	(revision 1573)
+++ ulp/ipoib/kernel/ipoib_port.c	(working copy)
@@ -1978,7 +1978,7 @@
 			
 		}
 		/* Successful completion.  Get the receive information.
*/
-		p_desc->ndis_csum.Value = (ULONG) p_wc->recv.ud.csum_ok;
+		p_desc->ndis_csum.Value = ( (p_wc->recv.ud.recv_opt &
IB_RECV_OPT_CSUM_MASK ) >> 8 );
 		cl_perf_start( GetRecvEndpts );
 		__recv_get_endpts( p_port, p_desc, p_wc, &p_src, &p_dst
);
 		cl_perf_stop( &p_port->p_adapter->perf, GetRecvEndpts );


> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Smith, Stan
> Sent: Tuesday, September 09, 2008 11:54 AM
> To: Alex Naslednikov; Fab Tillier; Tzachi Dar; 
> ofw at lists.openfabrics.org
> Subject: RE: [ofw] [PATCH 1/3] IBAL (checksum): restoring 
> vendor_specific field
> 
> Alex Naslednikov wrote:
> > Hello Fab,
> > I received you proposal after the patch was implemented. During the
> > testing, we found a lot of additional issues and we were 
> motivated to
> > finish the testing it time in order to allow our changes to 
> be placed
> > in
> > 2.0.0 branch.
> > Each additional change (even the smallest one) requires us to check
> > again all the flow on : 2-3 types of Windows x 2 types of 
> architecture
> > (x64, x86) x 3 types of HCAs (at least) x 3 types of option values.
> > Of course, your proposal to use receive_opt field make sense and we
> > are totally agree with it.
> > So we will insert it into trunk as soon as possible and 
> will carefully
> > check it on all the platforms.
> Hello,
> 
> Understanding the amount of testing required, it would be 
> good to include this in WinOF 2.0.
> Do you foresee that happening?
> If so, perhaps this week or next week (RC2)?
> 
> Thanks,
> 
> Stan.
> 
> >
> > Thanks,
> > XaleX
> >
> > -----Original Message-----
> > From: Fab Tillier [mailto:ftillier at windows.microsoft.com]
> > Sent: Monday, September 08, 2008 7:14 PM
> > To: Tzachi Dar; Alex Naslednikov; ofw at lists.openfabrics.org
> > Subject: RE: [ofw] [PATCH 1/3] IBAL (checksum): restoring
> > vendor_specific field
> >
> >> Applied to trunk and branch.
> >
> > I guess this means that the checksum values aren't going to 
> be encoded
> > in the existing receive options field?
> >
> > It would be really nice to get some feedback on comments made to the
> > list.  Just posting patches, waiting a week or so without responding
> > to questions, and then checking in doesn't foster a sense of
> > community and cooperation.
> >
> > -Fab
> >
> >>
> >> Thanks
> >> Tzachi
> >>
> >>> -----Original Message-----
> >>> From: Alex Naslednikov
> >>> Sent: Thursday, September 04, 2008 7:34 PM
> >>> To: Tzachi Dar; ofw at lists.openfabrics.org
> >>> Cc: Ishai Rabinovitz
> >>> Subject: [ofw] [PATCH 1/3] IBAL (checksum): restoring
> >>> vendor_specific
> >
> >>> field
> >>>
> >>> Signed-off by: xalex (Alexander Naslednikov)
> >>> Index:
> >>> D:/Windows/MLNX_WINOF_CSUM_ARBEL/ulp/opensm/user/include/iba/i
> >>> b_types_extended.h
> >>> 
> ===================================================================
> >>> --- D:/Windows/MLNX_WINOF_CSUM_ARBEL/ulp/opensm/user/include/iba/i
> >>> b_types_extended.h    (revision 3104) +++
> >>> D:/Windows/MLNX_WINOF_CSUM_ARBEL/ulp/opensm/user/include/iba/i
> >>> b_types_extended.h    (revision 3105)
> >>> @@ -2096,12 +2096,7 @@
> >>>       ib_wc_type_t                    wc_type;
> >>>
> >>>       uint32_t                                length;
> >>> -     struct {
> >>> -             uint8_t                         vendor_specific;
> >>> -             uint8_t                         csum_ok;
> >>> -             uint16_t                        vendor_specific2;
> >>> -             uint32_t                        vendor_specific3;
> >>> -     };
> >>> +     uint64_t                                vendor_specific;
> >>>       ib_wc_status_t                  status;
> >>>
> >>>       union _wc_recv
> >>> @@ -2122,6 +2117,7 @@
> >>>                       ib_net16_t              remote_lid;
> >>>                       uint8_t                 remote_sl;
> >>>                       uint8_t                 path_bits;
> >>> +                     uint8_t                 csum_ok;
> >>>
> >>>               }       ud;
> >>>
> >>> Index: D:/Windows/MLNX_WINOF_CSUM_ARBEL/inc/iba/ib_types.h
> >>> 
> ===================================================================
> >>> --- D:/Windows/MLNX_WINOF_CSUM_ARBEL/inc/iba/ib_types.h (revision
> >>> 3104) +++ D:/Windows/MLNX_WINOF_CSUM_ARBEL/inc/iba/ib_types.h
> >>> (revision 3105) @@ -10644,12 +10644,7 @@
> >>>       ib_wc_type_t                    wc_type;
> >>>
> >>>       uint32_t                                length;
> >>> -     struct {
> >>> -             uint8_t                         vendor_specific;
> >>> -             uint8_t                         csum_ok;
> >>> -             uint16_t                        vendor_specific2;
> >>> -             uint32_t                        vendor_specific3;
> >>> -     };
> >>> +     uint64_t                                vendor_specific;
> >>>       ib_wc_status_t                  status;
> >>>
> >>>       union _wc_recv
> >>> @@ -10670,6 +10665,7 @@
> >>>                       ib_net16_t              remote_lid;
> >>>                       uint8_t                 remote_sl;
> >>>                       uint8_t                 path_bits;
> >>> +                     uint8_t                 csum_ok;
> >>>
> >>>               }       ud;
> >>>
> >> _______________________________________________
> >> ofw mailing list
> >> ofw at lists.openfabrics.org
> >> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> > _______________________________________________
> > ofw mailing list
> > ofw at lists.openfabrics.org
> > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: chksum_recv_opts.patch
Type: application/octet-stream
Size: 3858 bytes
Desc: chksum_recv_opts.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080909/609c10d0/attachment.obj>


More information about the ofw mailing list