[Stgt-devel] [PATCH 15/20] iser rounding

Pete Wyckoff pw
Fri Dec 7 18:09:27 CET 2007


fujita.tomonori at lab.ntt.co.jp wrote on Thu, 15 Nov 2007 11:20 +0900:
> On Tue, 16 Oct 2007 11:21:23 -0400
> Pete Wyckoff <pw at osc.edu> wrote:
> 
> > RDMA data packets are not padded up to 4 byte boundaries, unlike TCP.
> > Reasons for this can be found in doc/README.iser.
> > 
> > Signed-off-by: Pete Wyckoff <pw at osc.edu>
> > ---
> >  usr/iscsi/iscsid.c |   24 +++++++++++++++++-------
> >  1 files changed, 17 insertions(+), 7 deletions(-)
> > 
> > diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
> > index 8b7b48e..6d5471e 100644
> > --- a/usr/iscsi/iscsid.c
> > +++ b/usr/iscsi/iscsid.c
> > @@ -1157,7 +1157,9 @@ static int iscsi_target_cmd_queue(struct iscsi_task *task)
> >  			uint32_t len;
> >  			void *buf;
> >  
> > -			len = roundup(task->read_len, 4);
> > +			len = task->read_len;
> > +			if (!conn->tp->rdma)
> > +				len = roundup(len, 4);
> 
> I want to avoid doing something like this:
> 
> if (conn->tp->rdma)
> 	do iser
> else
> 	do tcp
> 
> 
> Can you add 'pad_len' to iscsi_transport struct and do something like:
> 
> len = roundup(task->read_len, conn->tp->pad_len);
> 
> tcp sets it to PAD_WORD_LEN and iser sets it to 1.

Good suggestion.  I called it "data_padding" though as other
segments are rounded even for RDMA (e.g. AHS).

		-- Pete



More information about the stgt mailing list