Line data Source code
1 0 : case FD_VINYL_REQ_TYPE_TEST: { 2 : 3 0 : ulong const * req_val_gaddr = MAP_REQ_GADDR( req->val_gaddr_gaddr, ulong, 2UL*batch_cnt ); 4 0 : schar * req_err = MAP_REQ_GADDR( req->err_gaddr, schar, batch_cnt ); 5 : 6 0 : if( FD_UNLIKELY( (!!batch_cnt) & ((!req_val_gaddr) | (!req_err)) ) ) { 7 0 : comp_err = FD_VINYL_ERR_INVAL; 8 0 : break; 9 0 : } 10 : 11 0 : ulong const * req_try = req_val_gaddr + batch_cnt; 12 : 13 0 : for( ulong batch_idx=0UL; batch_idx<batch_cnt; batch_idx++ ) { 14 : 15 : /* Get the line index and version of the try. The line index is 16 : invalid or has a different version than the try, tell the 17 : client the corresponding try failed (with INVAL and CORRUPT 18 : respectively). Otherwise, tell the client the try succeeded. */ 19 : 20 0 : ulong try = req_try[ batch_idx ]; 21 : 22 0 : ulong ver = try >> 32; 23 0 : ulong line_idx = try & FD_VINYL_LINE_MAX; 24 : 25 0 : int err = FD_UNLIKELY( line_idx>=line_cnt ) ? FD_VINYL_ERR_INVAL 26 0 : : FD_UNLIKELY( fd_vinyl_line_ctl_ver( line[ line_idx ].ctl )!=ver ) ? FD_VINYL_ERR_CORRUPT 27 0 : : FD_VINYL_SUCCESS; 28 : 29 0 : FD_COMPILER_MFENCE(); 30 0 : req_err[ batch_idx ] = (schar)err; 31 0 : FD_COMPILER_MFENCE(); 32 : 33 0 : fail_cnt += (ulong)!!err; 34 : 35 0 : } 36 : 37 0 : comp_err = FD_VINYL_SUCCESS; 38 0 : break; 39 0 : }