@@ -714,58 +714,16 @@ static void rdma_read_complete(struct svc_rqst *rqstp,
714
714
rqstp -> rq_arg .buflen = head -> rc_arg .buflen ;
715
715
}
716
716
717
- static void svc_rdma_send_error (struct svcxprt_rdma * xprt ,
717
+ static void svc_rdma_send_error (struct svcxprt_rdma * rdma ,
718
718
struct svc_rdma_recv_ctxt * rctxt ,
719
719
int status )
720
720
{
721
- __be32 * p , * rdma_argp = rctxt -> rc_recv_buf ;
722
- struct svc_rdma_send_ctxt * ctxt ;
723
- int ret ;
721
+ struct svc_rdma_send_ctxt * sctxt ;
724
722
725
- ctxt = svc_rdma_send_ctxt_get (xprt );
726
- if (!ctxt )
723
+ sctxt = svc_rdma_send_ctxt_get (rdma );
724
+ if (!sctxt )
727
725
return ;
728
-
729
- p = xdr_reserve_space (& ctxt -> sc_stream ,
730
- rpcrdma_fixed_maxsz * sizeof (* p ));
731
- if (!p )
732
- goto put_ctxt ;
733
-
734
- * p ++ = * rdma_argp ;
735
- * p ++ = * (rdma_argp + 1 );
736
- * p ++ = xprt -> sc_fc_credits ;
737
- * p = rdma_error ;
738
-
739
- switch (status ) {
740
- case - EPROTONOSUPPORT :
741
- p = xdr_reserve_space (& ctxt -> sc_stream , 3 * sizeof (* p ));
742
- if (!p )
743
- goto put_ctxt ;
744
-
745
- * p ++ = err_vers ;
746
- * p ++ = rpcrdma_version ;
747
- * p = rpcrdma_version ;
748
- trace_svcrdma_err_vers (* rdma_argp );
749
- break ;
750
- default :
751
- p = xdr_reserve_space (& ctxt -> sc_stream , sizeof (* p ));
752
- if (!p )
753
- goto put_ctxt ;
754
-
755
- * p = err_chunk ;
756
- trace_svcrdma_err_chunk (* rdma_argp );
757
- }
758
-
759
- ctxt -> sc_send_wr .num_sge = 1 ;
760
- ctxt -> sc_send_wr .opcode = IB_WR_SEND ;
761
- ctxt -> sc_sges [0 ].length = ctxt -> sc_hdrbuf .len ;
762
- ret = svc_rdma_send (xprt , & ctxt -> sc_send_wr );
763
- if (ret )
764
- goto put_ctxt ;
765
- return ;
766
-
767
- put_ctxt :
768
- svc_rdma_send_ctxt_put (xprt , ctxt );
726
+ svc_rdma_send_error_msg (rdma , sctxt , rctxt , status );
769
727
}
770
728
771
729
/* By convention, backchannel calls arrive via rdma_msg type
0 commit comments