On Mon, Nov 25, 2019 at 02:10:37PM +0000, Beata Michalska wrote: > On Mon, 25 Nov 2019 at 06:21, Klaus Birkelund <i...@irrelevant.dk> wrote: > > > > On Tue, Nov 12, 2019 at 03:25:18PM +0000, Beata Michalska wrote: > > > Hi Klaus, > > > > > > On Tue, 15 Oct 2019 at 11:57, Klaus Jensen <i...@irrelevant.dk> wrote: > > > > > > > > +#define NVME_CMD_FLAGS_FUSE(flags) (flags & 0x3) > > > > +#define NVME_CMD_FLAGS_PSDT(flags) ((flags >> 6) & 0x3) > > > Minor: This one is slightly misleading - as per the naming and it's usage: > > > the PSDT is a field name and as such does not imply using SGLs > > > and it is being used to verify if given command is actually using > > > SGLs. > > > > > > > Ah, is this because I do > > > > if (NVME_CMD_FLAGS_PSDT(cmd->flags)) { > > > > in the code? That is, just checks for it not being zero? The value of > > the PRP or SGL for Data Transfer (PSDT) field *does* specify if the > > command uses SGLs or not. 0x0: PRPs, 0x1 SGL for data, 0x10: SGLs for > > both data and metadata. Would you prefer the condition was more > > explicit? > > > Yeah, it is just not obvious( at least to me) without referencing the spec > that non-zero value implies SGL usage. Guess a comment would be helpful > but that is not major. > Nah. Thats a good point. I have changed it to use a switch on the value. This technically also fixes a bug because the above would accept 0x3 as a valid value and interpret it as SGL use.
Klaus