Re: svn commit: r357849 - head/sys/cam/scsi

2020-02-13 Thread Slawa Olhovchenkov
On Thu, Feb 13, 2020 at 08:36:08AM -0700, Warner Losh wrote:

> On Thu, Feb 13, 2020 at 7:05 AM Slawa Olhovchenkov  wrote:
> 
> > On Thu, Feb 13, 2020 at 01:23:45AM +, Warner Losh wrote:
> >
> > > Author: imp
> > > Date: Thu Feb 13 01:23:44 2020
> > > New Revision: 357849
> > > URL: https://svnweb.freebsd.org/changeset/base/357849
> > >
> > > Log:
> > >   Convert rotating and unmapped_io to a DA flag
> > >
> > >   Rotating and unmapped_io are really da flags. Convert them to a flag
> > so it will
> > >   be reported with the other flags for the device. Deprecate the
> > .rotating and
> > >   .unmapped_io sysctls in FreeBSD 14 and remove the softc ints.
> >
> > Can you clarification this deprecate?
> >
> 
> The functionality has moved into the new .flags sysctl. I plan on keeping

Thanks!
___
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: r357849 - head/sys/cam/scsi

2020-02-13 Thread Warner Losh
On Thu, Feb 13, 2020 at 7:05 AM Slawa Olhovchenkov  wrote:

> On Thu, Feb 13, 2020 at 01:23:45AM +, Warner Losh wrote:
>
> > Author: imp
> > Date: Thu Feb 13 01:23:44 2020
> > New Revision: 357849
> > URL: https://svnweb.freebsd.org/changeset/base/357849
> >
> > Log:
> >   Convert rotating and unmapped_io to a DA flag
> >
> >   Rotating and unmapped_io are really da flags. Convert them to a flag
> so it will
> >   be reported with the other flags for the device. Deprecate the
> .rotating and
> >   .unmapped_io sysctls in FreeBSD 14 and remove the softc ints.
>
> Can you clarification this deprecate?
>

The functionality has moved into the new .flags sysctl. I plan on keeping
the old sysctls through 13, but remove them in 14 sometime. This will
also give us  time to ensure things are the same for all CAM devices, etc.
The plans are somewhere between preliminary and firm and could change for
good reasons.

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: r357849 - head/sys/cam/scsi

2020-02-13 Thread Slawa Olhovchenkov
On Thu, Feb 13, 2020 at 01:23:45AM +, Warner Losh wrote:

> Author: imp
> Date: Thu Feb 13 01:23:44 2020
> New Revision: 357849
> URL: https://svnweb.freebsd.org/changeset/base/357849
> 
> Log:
>   Convert rotating and unmapped_io to a DA flag
>   
>   Rotating and unmapped_io are really da flags. Convert them to a flag so it 
> will
>   be reported with the other flags for the device. Deprecate the .rotating and
>   .unmapped_io sysctls in FreeBSD 14 and remove the softc ints.

Can you clarification this deprecate?
___
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: r357849 - head/sys/cam/scsi

2020-02-12 Thread Warner Losh
Author: imp
Date: Thu Feb 13 01:23:44 2020
New Revision: 357849
URL: https://svnweb.freebsd.org/changeset/base/357849

Log:
  Convert rotating and unmapped_io to a DA flag
  
  Rotating and unmapped_io are really da flags. Convert them to a flag so it 
will
  be reported with the other flags for the device. Deprecate the .rotating and
  .unmapped_io sysctls in FreeBSD 14 and remove the softc ints.
  
  Differential Revision: https://reviews.freebsd.org/D23417

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Feb 13 01:23:32 2020(r357848)
+++ head/sys/cam/scsi/scsi_da.c Thu Feb 13 01:23:44 2020(r357849)
@@ -106,6 +106,7 @@ typedef enum {
DA_FLAG_NEW_PACK= 0x02,
DA_FLAG_PACK_LOCKED = 0x04,
DA_FLAG_PACK_REMOVABLE  = 0x08,
+   DA_FLAG_ROTATING= 0x10,
DA_FLAG_NEED_OTAG   = 0x20,
DA_FLAG_WAS_OTAG= 0x40,
DA_FLAG_RETRY_UA= 0x80,
@@ -120,7 +121,8 @@ typedef enum {
DA_FLAG_CAN_ATA_IDLOG   = 0x01,
DA_FLAG_CAN_ATA_SUPCAP  = 0x02,
DA_FLAG_CAN_ATA_ZONE= 0x04,
-   DA_FLAG_TUR_PENDING = 0x08
+   DA_FLAG_TUR_PENDING = 0x08,
+   DA_FLAG_UNMAPPEDIO  = 0x10
 } da_flags;
 #define DA_FLAG_STRING \
"\020"  \
@@ -128,7 +130,7 @@ typedef enum {
"\002NEW_PACK"  \
"\003PACK_LOCKED"   \
"\004PACK_REMOVABLE"\
-   "\005UNUSED"\
+   "\005ROTATING"  \
"\006NEED_OTAG" \
"\007WAS_OTAG"  \
"\010RETRY_UA"  \
@@ -143,7 +145,8 @@ typedef enum {
"\021CAN_ATA_IDLOG" \
"\022CAN_ATA_SUPACP"\
"\023CAN_ATA_ZONE"  \
-   "\024TUR_PENDING"
+   "\024TUR_PENDING"   \
+   "\025UNMAPPEDIO"
 
 typedef enum {
DA_Q_NONE   = 0x00,
@@ -367,8 +370,6 @@ struct da_softc {
da_delete_methods   delete_method_pref;
da_delete_methods   delete_method;
da_delete_func_t*delete_func;
-   int unmappedio;
-   int rotating;
int p_type;
struct   disk_params params;
struct   disk *disk;
@@ -1464,6 +1465,7 @@ staticvoiddasysctlinit(void *context, int 
pending);
 static int dasysctlsofttimeout(SYSCTL_HANDLER_ARGS);
 static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS);
 static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS);
+static int dabitsysctl(SYSCTL_HANDLER_ARGS);
 static int daflagssysctl(SYSCTL_HANDLER_ARGS);
 static int dazonemodesysctl(SYSCTL_HANDLER_ARGS);
 static int dazonesupsysctl(SYSCTL_HANDLER_ARGS);
@@ -2315,24 +2317,6 @@ dasysctlinit(void *context, int pending)
SYSCTL_ADD_INT(&softc->sysctl_ctx,
   SYSCTL_CHILDREN(softc->sysctl_tree),
   OID_AUTO,
-  "unmapped_io",
-  CTLFLAG_RD,
-  &softc->unmappedio,
-  0,
-  "Unmapped I/O support");
-
-   SYSCTL_ADD_INT(&softc->sysctl_ctx,
-  SYSCTL_CHILDREN(softc->sysctl_tree),
-  OID_AUTO,
-  "rotating",
-  CTLFLAG_RD,
-  &softc->rotating,
-  0,
-  "Rotating media");
-
-   SYSCTL_ADD_INT(&softc->sysctl_ctx,
-  SYSCTL_CHILDREN(softc->sysctl_tree),
-  OID_AUTO,
   "p_type",
   CTLFLAG_RD,
   &softc->p_type,
@@ -2343,6 +2327,14 @@ dasysctlinit(void *context, int pending)
OID_AUTO, "flags", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
softc, 0, daflagssysctl, "A",
"Flags for drive");
+   SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
+   OID_AUTO, "rotating", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
+   &softc->flags, DA_FLAG_ROTATING, dabitsysctl, "I",
+   "Rotating media *DEPRECATED* gone in FreeBSD 14");
+   SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
+   OID_AUTO, "unmapped_io", CTLTYPE_STRING | CTLFLAG_RD | 
CTLFLAG_MPSAFE,
+   &softc->flags, DA_FLAG_UNMAPPEDIO, dabitsysctl, "I",
+   "Unmapped I/O support *DEPRECATED* gone in FreeBSD 14");
 
 #ifdef CAM_TEST_FAILURE
SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
@@ -2619,6 +2611,21 @@ dadeletemethodchoose(struct da_softc *softc, da_delete
 }
 
 static int
+dabitsysctl(SYSCTL_HANDLER_ARGS)
+{
+   int flags = (in