Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-05 Thread Sagi Grimberg
On 6/4/2014 1:18 AM, Martin K. Petersen wrote: "Mike" == Mike Christie writes: Mike> On 06/01/2014 11:19 AM, Sagi Grimberg wrote: +/* + * data integrity helpers + */ +static inline unsigned +iscsi_prot_len(unsigned data_len, unsigned sector_size) +{ + switch (sector_size) { + case 512: + retur

Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-05 Thread Sagi Grimberg
On 6/3/2014 7:11 PM, Mike Christie wrote: On 06/01/2014 11:19 AM, Sagi Grimberg wrote: /** + * iscsi_adjust_dl - Adjust SCSI data length to include PI + * @sc: scsi command. + * @data_length: command data length. + * + * Adjust the data length to account for how much data + * is actually on th

Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-03 Thread Martin K. Petersen
> "Mike" == Mike Christie writes: Mike> On 06/01/2014 11:19 AM, Sagi Grimberg wrote: >> >> +/* >> + * data integrity helpers >> + */ >> +static inline unsigned +iscsi_prot_len(unsigned data_len, unsigned >> sector_size) +{ >> + switch (sector_size) { >> + case 512: >> + return (data_len >> 9

Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-03 Thread Mike Christie
On 06/01/2014 11:19 AM, Sagi Grimberg wrote: > /** > + * iscsi_adjust_dl - Adjust SCSI data length to include PI > + * @sc: scsi command. > + * @data_length: command data length. > + * > + * Adjust the data length to account for how much data > + * is actually on the wire. > + * > + * returns the

Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-03 Thread Mike Christie
On 06/01/2014 11:19 AM, Sagi Grimberg wrote: > > +/* > + * data integrity helpers > + */ > +static inline unsigned > +iscsi_prot_len(unsigned data_len, unsigned sector_size) > +{ > + switch (sector_size) { > + case 512: > + return (data_len >> 9) * 8; > + case 1024: > +

[PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

2014-06-01 Thread Sagi Grimberg
In case protection information exists over the wire iscsi header data_length field is required to include it. Also remove iser transfer length checks for each task as they are not always true and somewhat redundant anyway. Signed-off-by: Sagi Grimberg --- drivers/infiniband/ulp/iser/iser_initia