Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Warner Losh
On Thu, Feb 22, 2018 at 9:49 AM, Wojciech Macek  wrote:

> Yes, I'm doing that right now. So far it seems everything is there, but
> will confirm to be 100% sure.
>
> Warner, I'm very sorry for not waiting for your comments. The review was
> dead for few days and I thought that all was already said, but maybe
> should have waited a little longer...
> Let me know what to do now. If you see any issues, I'll be more than happy
> to fix them. Also, if you insist, we can revert it, but if no drastic
> changes are required, I'd prefer to leave it as is and make iterational
> fixes to this part.
>

I agree. Unless something surfaces that's utterly broken, that's the best
path forward. So far the actual driver is coping well with the load I'm
giving it and it wasn't too disruptive to other things I had going on I
understand things get pushed in more quickly than reviews would like
sometimes, so I'll look over the changes and see if all of the things I had
issues with in the original patches were addressed. I know most of them
have, but wanted to make sure before a final sign off is all... If there is
stuff, I think it will be minor.

Warner


> Regards,
> Wojtek
> wma@
>
> 2018-02-22 17:34 GMT+01:00 Warner Losh :
>
>> I know all about losing things during the rebase
>>
>> I'd be a lot happier if you could confirm that nothing else was lost.
>> It's a large patch, which makes it impossible for others to do it...  It
>> seems to build, and seems to be working in the light testing I've done this
>> morning...
>>
>> Warner
>>
>>
>> On Thu, Feb 22, 2018 at 9:31 AM, Wojciech Macek  wrote:
>>
>>> Thanks and sorry for troubles!
>>> These lines must have got lost somewhere during rebase as we run
>>> tinderbox with this patch yesterday.
>>>
>>> Regards,
>>> Wojtek
>>> wma@
>>>
>>> 2018-02-22 17:22 GMT+01:00 Alan Somers :
>>>
 On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:

> On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers 
> wrote:
> > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek 
> wrote:
> >
> >> Author: wma
> >> Date: Thu Feb 22 13:32:31 2018
> >> New Revision: 329824
> >> URL: https://svnweb.freebsd.org/changeset/base/329824
> >>
> >> Log:
> >>   NVMe: Add big-endian support
> >>
> >>   Remove bitfields from defined structures as they are not portable.
> >>   Instead use shift and mask macros in the driver and nvmecontrol
> >> application.
> >>
> >>   NVMe is now working on powerpc64 host.
> >>
> >>   Submitted by:  Michal Stanek 
> >>   Obtained from: Semihalf
> >>   Reviewed by:   imp, wma
> >>   Sponsored by:  IBM, QCM Technologies
> >>   Differential revision: https://reviews.freebsd.org/D13916
> >>
> >
> > It looks like this change broke the build with Clang:
> >
>
> Fixed in r329827... all little endian arch's broken, not so great. =(
>

 Fast work, Kyle.  Thanks a bundle.
 -Alan

>>>
>>>
>>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Wojciech Macek
Yes, I'm doing that right now. So far it seems everything is there, but
will confirm to be 100% sure.

Warner, I'm very sorry for not waiting for your comments. The review was
dead for few days and I thought that all was already said, but maybe should
have waited a little longer...
Let me know what to do now. If you see any issues, I'll be more than happy
to fix them. Also, if you insist, we can revert it, but if no drastic
changes are required, I'd prefer to leave it as is and make iterational
fixes to this part.

Regards,
Wojtek
wma@

2018-02-22 17:34 GMT+01:00 Warner Losh :

> I know all about losing things during the rebase
>
> I'd be a lot happier if you could confirm that nothing else was lost. It's
> a large patch, which makes it impossible for others to do it...  It seems
> to build, and seems to be working in the light testing I've done this
> morning...
>
> Warner
>
>
> On Thu, Feb 22, 2018 at 9:31 AM, Wojciech Macek  wrote:
>
>> Thanks and sorry for troubles!
>> These lines must have got lost somewhere during rebase as we run
>> tinderbox with this patch yesterday.
>>
>> Regards,
>> Wojtek
>> wma@
>>
>> 2018-02-22 17:22 GMT+01:00 Alan Somers :
>>
>>> On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:
>>>
 On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers 
 wrote:
 > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek 
 wrote:
 >
 >> Author: wma
 >> Date: Thu Feb 22 13:32:31 2018
 >> New Revision: 329824
 >> URL: https://svnweb.freebsd.org/changeset/base/329824
 >>
 >> Log:
 >>   NVMe: Add big-endian support
 >>
 >>   Remove bitfields from defined structures as they are not portable.
 >>   Instead use shift and mask macros in the driver and nvmecontrol
 >> application.
 >>
 >>   NVMe is now working on powerpc64 host.
 >>
 >>   Submitted by:  Michal Stanek 
 >>   Obtained from: Semihalf
 >>   Reviewed by:   imp, wma
 >>   Sponsored by:  IBM, QCM Technologies
 >>   Differential revision: https://reviews.freebsd.org/D13916
 >>
 >
 > It looks like this change broke the build with Clang:
 >

 Fixed in r329827... all little endian arch's broken, not so great. =(

>>>
>>> Fast work, Kyle.  Thanks a bundle.
>>> -Alan
>>>
>>
>>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Warner Losh
I know all about losing things during the rebase

I'd be a lot happier if you could confirm that nothing else was lost. It's
a large patch, which makes it impossible for others to do it...  It seems
to build, and seems to be working in the light testing I've done this
morning...

Warner

On Thu, Feb 22, 2018 at 9:31 AM, Wojciech Macek  wrote:

> Thanks and sorry for troubles!
> These lines must have got lost somewhere during rebase as we run tinderbox
> with this patch yesterday.
>
> Regards,
> Wojtek
> wma@
>
> 2018-02-22 17:22 GMT+01:00 Alan Somers :
>
>> On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:
>>
>>> On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers 
>>> wrote:
>>> > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek 
>>> wrote:
>>> >
>>> >> Author: wma
>>> >> Date: Thu Feb 22 13:32:31 2018
>>> >> New Revision: 329824
>>> >> URL: https://svnweb.freebsd.org/changeset/base/329824
>>> >>
>>> >> Log:
>>> >>   NVMe: Add big-endian support
>>> >>
>>> >>   Remove bitfields from defined structures as they are not portable.
>>> >>   Instead use shift and mask macros in the driver and nvmecontrol
>>> >> application.
>>> >>
>>> >>   NVMe is now working on powerpc64 host.
>>> >>
>>> >>   Submitted by:  Michal Stanek 
>>> >>   Obtained from: Semihalf
>>> >>   Reviewed by:   imp, wma
>>> >>   Sponsored by:  IBM, QCM Technologies
>>> >>   Differential revision: https://reviews.freebsd.org/D13916
>>> >>
>>> >
>>> > It looks like this change broke the build with Clang:
>>> >
>>>
>>> Fixed in r329827... all little endian arch's broken, not so great. =(
>>>
>>
>> Fast work, Kyle.  Thanks a bundle.
>> -Alan
>>
>
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Wojciech Macek
Thanks and sorry for troubles!
These lines must have got lost somewhere during rebase as we run tinderbox
with this patch yesterday.

Regards,
Wojtek
wma@

2018-02-22 17:22 GMT+01:00 Alan Somers :

> On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:
>
>> On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers 
>> wrote:
>> > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek 
>> wrote:
>> >
>> >> Author: wma
>> >> Date: Thu Feb 22 13:32:31 2018
>> >> New Revision: 329824
>> >> URL: https://svnweb.freebsd.org/changeset/base/329824
>> >>
>> >> Log:
>> >>   NVMe: Add big-endian support
>> >>
>> >>   Remove bitfields from defined structures as they are not portable.
>> >>   Instead use shift and mask macros in the driver and nvmecontrol
>> >> application.
>> >>
>> >>   NVMe is now working on powerpc64 host.
>> >>
>> >>   Submitted by:  Michal Stanek 
>> >>   Obtained from: Semihalf
>> >>   Reviewed by:   imp, wma
>> >>   Sponsored by:  IBM, QCM Technologies
>> >>   Differential revision: https://reviews.freebsd.org/D13916
>> >>
>> >
>> > It looks like this change broke the build with Clang:
>> >
>>
>> Fixed in r329827... all little endian arch's broken, not so great. =(
>>
>
> Fast work, Kyle.  Thanks a bundle.
> -Alan
>
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Warner Losh
On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:

> On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers  wrote:
> > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek  wrote:
> >
> >> Author: wma
> >> Date: Thu Feb 22 13:32:31 2018
> >> New Revision: 329824
> >> URL: https://svnweb.freebsd.org/changeset/base/329824
> >>
> >> Log:
> >>   NVMe: Add big-endian support
> >>
> >>   Remove bitfields from defined structures as they are not portable.
> >>   Instead use shift and mask macros in the driver and nvmecontrol
> >> application.
> >>
> >>   NVMe is now working on powerpc64 host.
> >>
> >>   Submitted by:  Michal Stanek 
> >>   Obtained from: Semihalf
> >>   Reviewed by:   imp, wma
> >>   Sponsored by:  IBM, QCM Technologies
> >>   Differential revision: https://reviews.freebsd.org/D13916
> >>
> >
> > It looks like this change broke the build with Clang:
> >
>
> Fixed in r329827... all little endian arch's broken, not so great. =(
>

At least the kernel is passing my tests this morning... I didn't think this
was ready and hasn't yet lifted my objections in the review... Not sure I
want to get grumpy about it yet, but I'm not pleased to see this.

Warner
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Alan Somers
On Thu, Feb 22, 2018 at 9:20 AM, Kyle Evans  wrote:

> On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers  wrote:
> > On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek  wrote:
> >
> >> Author: wma
> >> Date: Thu Feb 22 13:32:31 2018
> >> New Revision: 329824
> >> URL: https://svnweb.freebsd.org/changeset/base/329824
> >>
> >> Log:
> >>   NVMe: Add big-endian support
> >>
> >>   Remove bitfields from defined structures as they are not portable.
> >>   Instead use shift and mask macros in the driver and nvmecontrol
> >> application.
> >>
> >>   NVMe is now working on powerpc64 host.
> >>
> >>   Submitted by:  Michal Stanek 
> >>   Obtained from: Semihalf
> >>   Reviewed by:   imp, wma
> >>   Sponsored by:  IBM, QCM Technologies
> >>   Differential revision: https://reviews.freebsd.org/D13916
> >>
> >
> > It looks like this change broke the build with Clang:
> >
>
> Fixed in r329827... all little endian arch's broken, not so great. =(
>

Fast work, Kyle.  Thanks a bundle.
-Alan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Kyle Evans
On Thu, Feb 22, 2018 at 10:19 AM, Alan Somers  wrote:
> On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek  wrote:
>
>> Author: wma
>> Date: Thu Feb 22 13:32:31 2018
>> New Revision: 329824
>> URL: https://svnweb.freebsd.org/changeset/base/329824
>>
>> Log:
>>   NVMe: Add big-endian support
>>
>>   Remove bitfields from defined structures as they are not portable.
>>   Instead use shift and mask macros in the driver and nvmecontrol
>> application.
>>
>>   NVMe is now working on powerpc64 host.
>>
>>   Submitted by:  Michal Stanek 
>>   Obtained from: Semihalf
>>   Reviewed by:   imp, wma
>>   Sponsored by:  IBM, QCM Technologies
>>   Differential revision: https://reviews.freebsd.org/D13916
>>
>
> It looks like this change broke the build with Clang:
>

Fixed in r329827... all little endian arch's broken, not so great. =(
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Alan Somers
On Thu, Feb 22, 2018 at 6:32 AM, Wojciech Macek  wrote:

> Author: wma
> Date: Thu Feb 22 13:32:31 2018
> New Revision: 329824
> URL: https://svnweb.freebsd.org/changeset/base/329824
>
> Log:
>   NVMe: Add big-endian support
>
>   Remove bitfields from defined structures as they are not portable.
>   Instead use shift and mask macros in the driver and nvmecontrol
> application.
>
>   NVMe is now working on powerpc64 host.
>
>   Submitted by:  Michal Stanek 
>   Obtained from: Semihalf
>   Reviewed by:   imp, wma
>   Sponsored by:  IBM, QCM Technologies
>   Differential revision: https://reviews.freebsd.org/D13916
>

It looks like this change broke the build with Clang:

--- ioctl.pico ---
In file included from ioctl.c:32:
In file included from
/usr/home/alans/freebsd/head/sys/cam/scsi/scsi_pass.h:35:
In file included from /usr/home/alans/freebsd/head/sys/cam/cam_ccb.h:46:
In file included from
/usr/home/alans/freebsd/head/sys/cam/nvme/nvme_all.h:34:
/usr/home/alans/freebsd/head/sys/dev/nvme/nvme.h:1187:26: error: unused
parameter 'p' [-Werror,-Wunused-parameter]
voidnvme_le128toh(void *p)

-Alan
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r329824 - in head: sbin/nvmecontrol sys/cam/nvme sys/conf sys/dev/mpr sys/dev/nvme

2018-02-22 Thread Wojciech Macek
Author: wma
Date: Thu Feb 22 13:32:31 2018
New Revision: 329824
URL: https://svnweb.freebsd.org/changeset/base/329824

Log:
  NVMe: Add big-endian support
  
  Remove bitfields from defined structures as they are not portable.
  Instead use shift and mask macros in the driver and nvmecontrol application.
  
  NVMe is now working on powerpc64 host.
  
  Submitted by:  Michal Stanek 
  Obtained from: Semihalf
  Reviewed by:   imp, wma
  Sponsored by:  IBM, QCM Technologies
  Differential revision: https://reviews.freebsd.org/D13916

Modified:
  head/sbin/nvmecontrol/devlist.c
  head/sbin/nvmecontrol/firmware.c
  head/sbin/nvmecontrol/identify.c
  head/sbin/nvmecontrol/logpage.c
  head/sbin/nvmecontrol/nvmecontrol.c
  head/sbin/nvmecontrol/perftest.c
  head/sbin/nvmecontrol/power.c
  head/sbin/nvmecontrol/wdc.c
  head/sys/cam/nvme/nvme_all.c
  head/sys/cam/nvme/nvme_da.c
  head/sys/conf/files
  head/sys/dev/mpr/mpr_sas.c
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme.h
  head/sys/dev/nvme/nvme_ctrlr.c
  head/sys/dev/nvme/nvme_ctrlr_cmd.c
  head/sys/dev/nvme/nvme_ns.c
  head/sys/dev/nvme/nvme_ns_cmd.c
  head/sys/dev/nvme/nvme_private.h
  head/sys/dev/nvme/nvme_qpair.c

Modified: head/sbin/nvmecontrol/devlist.c
==
--- head/sbin/nvmecontrol/devlist.c Thu Feb 22 13:06:27 2018
(r329823)
+++ head/sbin/nvmecontrol/devlist.c Thu Feb 22 13:32:31 2018
(r329824)
@@ -54,8 +54,14 @@ devlist_usage(void)
 static inline uint32_t
 ns_get_sector_size(struct nvme_namespace_data *nsdata)
 {
+   uint8_t flbas_fmt, lbads;
 
-   return (1 << nsdata->lbaf[nsdata->flbas.format].lbads);
+   flbas_fmt = (nsdata->flbas >> NVME_NS_DATA_FLBAS_FORMAT_SHIFT) &
+   NVME_NS_DATA_FLBAS_FORMAT_MASK;
+   lbads = (nsdata->lbaf[flbas_fmt] >> NVME_NS_DATA_LBAF_LBADS_SHIFT) &
+   NVME_NS_DATA_LBAF_LBADS_MASK;
+
+   return (1 << lbads);
 }
 
 void

Modified: head/sbin/nvmecontrol/firmware.c
==
--- head/sbin/nvmecontrol/firmware.cThu Feb 22 13:06:27 2018
(r329823)
+++ head/sbin/nvmecontrol/firmware.cThu Feb 22 13:32:31 2018
(r329824)
@@ -125,9 +125,9 @@ update_firmware(int fd, uint8_t *payload, int32_t payl
memcpy(chunk, payload + off, size);
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc = NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD;
-   pt.cmd.cdw10 = (size / sizeof(uint32_t)) - 1;
-   pt.cmd.cdw11 = (off / sizeof(uint32_t));
+   pt.cmd.opc_fuse = 
NVME_CMD_SET_OPC(NVME_OPC_FIRMWARE_IMAGE_DOWNLOAD);
+   pt.cmd.cdw10 = htole32((size / sizeof(uint32_t)) - 1);
+   pt.cmd.cdw11 = htole32(off / sizeof(uint32_t));
pt.buf = chunk;
pt.len = size;
pt.is_read = 0;
@@ -147,17 +147,21 @@ static int
 activate_firmware(int fd, int slot, int activate_action)
 {
struct nvme_pt_command  pt;
+   uint16_t sct, sc;
 
memset(, 0, sizeof(pt));
-   pt.cmd.opc = NVME_OPC_FIRMWARE_ACTIVATE;
-   pt.cmd.cdw10 = (activate_action << 3) | slot;
+   pt.cmd.opc_fuse = NVME_CMD_SET_OPC(NVME_OPC_FIRMWARE_ACTIVATE);
+   pt.cmd.cdw10 = htole32((activate_action << 3) | slot);
pt.is_read = 0;
 
if (ioctl(fd, NVME_PASSTHROUGH_CMD, ) < 0)
err(1, "firmware activate request failed");
 
-   if (pt.cpl.status.sct == NVME_SCT_COMMAND_SPECIFIC &&
-   pt.cpl.status.sc == NVME_SC_FIRMWARE_REQUIRES_RESET)
+   sct = NVME_STATUS_GET_SCT(pt.cpl.status);
+   sc = NVME_STATUS_GET_SC(pt.cpl.status);
+
+   if (sct == NVME_SCT_COMMAND_SPECIFIC &&
+   sc == NVME_SC_FIRMWARE_REQUIRES_RESET)
return 1;
 
if (nvme_completion_is_error())
@@ -180,16 +184,19 @@ firmware(int argc, char *argv[])
int fd = -1, slot = 0;
int a_flag, s_flag, f_flag;
int activate_action, reboot_required;
-   charch, *p, *image = NULL;
+   int opt;
+   char*p, *image = NULL;
char*controller = NULL, prompt[64];
void*buf = NULL;
int32_t size = 0;
+   uint16_toacs_fw;
+   uint8_t fw_slot1_ro, fw_num_slots;
struct nvme_controller_data cdata;
 
a_flag = s_flag = f_flag = false;
 
-   while ((ch = getopt(argc, argv, "af:s:")) != -1) {
-   switch (ch) {
+   while ((opt = getopt(argc, argv, "af:s:")) != -1) {
+   switch (opt) {
case 'a':
a_flag =