Re: [PATCH v2 04/12] Target/sbc: don't return from sbc_check for non prot_sg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/14/2014 10:08 PM, Martin K. Petersen wrote:
"Sagi" == Sagi Grimberg <sagig@xxxxxxxxxxxxxxxxxx> writes:
AFAICT for the two READ_10s that come down with prot_op ==
READ_STRIP, there is no associated scsi_prot_sglist() or
scsi_prot_sg_count(), so from vhost-scsi's perspective, the virtio
header will signal no protection SGLs are available, and that the
operation should function like a normal unprotected operation.
Sagi> In my opinion that is a miss-interpretation. READ_STRIP means
Sagi> "validate protection and strip it".  Is WRITE_GENERATE also a
Sagi> normal unprotected operation?

In the WRITE_INSERT case the target is doing the checking.

Sagi> As MKP said, it's a matter of how pedantic we want to be. we can
Sagi> just say that for vhost_scsi/loopback LLDs there is no real
Sagi> justification of doing these operations, but the meaning is that
Sagi> we are performing a violation.  Probably a minor one, but still a
Sagi> violation.

I still don't get the violation thing.

For the kernel to issue any command with a prot_op > 0, both initiator
and target need to signal support for the relevant DIF type. The SCSI
midlayer is not going to issue a READ_STRIP or WRITE_INSERT unless both
initiator and target support DIF.

Yes.

This has nothing to do with whether automatic protection is enabled in
the block layer (which is really a DIX thing and technically only covers
communication between block layer and HBA).

  - If the block layer sends you a command with no prot sgl, and both
    initiator and target support DIF Type N, then you'll see READ_STRIP
    or WRITE_INSERT.

OK - here is what we are talking about - what do you expect vhost-scsi/tcm_loop to do in this case? At the moment, they just execute a normal unprotected READ/WRITE. There is no support for generating protection or validating and stripping protection (perhaps it's really redundant).

  - If the block layer sends you a command with a prot sgl (which means
    the initiator supports DIX Type N), and initiator and target support
    DIF Type N, then you'll see READ_PASS / WRITE_PASS.

Yes - this is the case for tcm_loop & vhost-scsi.

  - If the block layer sends you a command with a prot sgl (which means
    the initiator supports DIX Type N), and the initiator and/or targer
    do not support DIF Type N, then you'll see READ_INSERT or
    WRITE_STRIP.

This is also not supported in vhost-scsi/tcm_loop - should they?

You should never ignore the prot_op. But it is important to report the
initiator driver's prot_caps and the target's p_type correctly.

Understood.



--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux