Re: [PATCH v13 8/9] nvmet-passthru: Add enable/disable helpers

From: Logan Gunthorpe
Date: Thu Jun 11 2020 - 19:24:45 EST




On 2020-06-11 5:13 p.m., Chaitanya Kulkarni wrote:
> On 5/14/20 10:23 AM, Logan Gunthorpe wrote:
>> + if (subsys->ver < NVME_VS(1, 2, 1)) {
>> + pr_warn("nvme controller version is too old: %d.%d.%d, advertising 1.2.1\n",
> Is it more than 80 char ? can it be ?
> pr_warn("nvme controller version is too old: ");
> pr_warn("%d.%d.%d, advertising 1.2.1\n",

Splitting printks is a bad idea because they won't necessarily end up in
dmesg right next to each other -- other prints can be interleaved.
Moreover, it breaks any tools that are dealing with kernel logs as
single records (ie through /dev/kmsg). Continuations (or printks without
a trailing "\n") would require using pr_cont() and generally that's
discouraged.

>> + (int)NVME_MAJOR(subsys->ver),
>> + (int)NVME_MINOR(subsys->ver),
>> + (int)NVME_TERTIARY(subsys->ver));
>> + subsys->ver = NVME_VS(1, 2, 1);
>> + }
>
> NVMe blktests are running on QEMU based controller. This will generate
> warning every-time.

Yup.

> Also, I didn't understand int type cast, I wonder under what condition
> all these macros will return -ve values since ver of type u64 ?

Yes, I'm not sure what I was thinking when I put in the cast. Probably
better just to prints "%llu". I'll fix this for the next revision.

Thanks,

Logan