aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl/ctl_backend.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2017-01-09 18:18:15 +0000
committerAlexander Motin <mav@FreeBSD.org>2017-01-09 18:18:15 +0000
commitbb8f9017b30a4631b323bc30e08aa97756c4094e (patch)
tree2020db09bc9e3a4045e64b66128e9125bb3514d1 /sys/cam/ctl/ctl_backend.h
parentb8bf08b1fa2b230bbbc1b1d1ec68d27ad4e21b65 (diff)
downloadsrc-bb8f9017b30a4631b323bc30e08aa97756c4094e.tar.gz
src-bb8f9017b30a4631b323bc30e08aa97756c4094e.zip
Rewrite CTL statistics in more simple and scalable way.
Instead of collecting statistics for each combination of ports and logical units, that consumed ~45KB per LU with present number of ports, collect separate statistics for every port and every logical unit separately, that consume only 176 bytes per each single LU/port. This reduces struct ctl_lun size down to just 6KB. Also new IOCTL API/ABI does not hardcode number of LUs/ports, and should allow handling of very large quantities. MFC after: 2 weeks (probably keeping old API enabled for some time)
Notes
Notes: svn path=/head/; revision=311804
Diffstat (limited to 'sys/cam/ctl/ctl_backend.h')
-rw-r--r--sys/cam/ctl/ctl_backend.h51
1 files changed, 2 insertions, 49 deletions
diff --git a/sys/cam/ctl/ctl_backend.h b/sys/cam/ctl/ctl_backend.h
index 4177e2d0eba0..d8ada8377738 100644
--- a/sys/cam/ctl/ctl_backend.h
+++ b/sys/cam/ctl/ctl_backend.h
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2003 Silicon Graphics International Corp.
- * Copyright (c) 2014-2015 Alexander Motin <mav@FreeBSD.org>
+ * Copyright (c) 2014-2017 Alexander Motin <mav@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -40,54 +40,7 @@
#ifndef _CTL_BACKEND_H_
#define _CTL_BACKEND_H_
-/*
- * XXX KDM move this to another header file?
- */
-#define CTL_BE_NAME_LEN 32
-
-/*
- * The ID_REQ flag is used to say that the caller has requested a
- * particular LUN ID in the req_lun_id field. If we cannot allocate that
- * LUN ID, the ctl_add_lun() call will fail.
- *
- * The STOPPED flag tells us that the LUN should default to the powered
- * off state. It will return 0x04,0x02 until it is powered up. ("Logical
- * unit not ready, initializing command required.")
- *
- * The NO_MEDIA flag tells us that the LUN has no media inserted.
- *
- * The PRIMARY flag tells us that this LUN is registered as a Primary LUN
- * which is accessible via the Master shelf controller in an HA. This flag
- * being set indicates a Primary LUN. This flag being reset represents a
- * Secondary LUN controlled by the Secondary controller in an HA
- * configuration. Flag is applicable at this time to T_DIRECT types.
- *
- * The SERIAL_NUM flag tells us that the serial_num field is filled in and
- * valid for use in SCSI INQUIRY VPD page 0x80.
- *
- * The DEVID flag tells us that the device_id field is filled in and
- * valid for use in SCSI INQUIRY VPD page 0x83.
- *
- * The DEV_TYPE flag tells us that the device_type field is filled in.
- *
- * The EJECTED flag tells us that the removable LUN has tray open.
- *
- * The UNMAP flag tells us that this LUN supports UNMAP.
- *
- * The OFFLINE flag tells us that this LUN can not access backing store.
- */
-typedef enum {
- CTL_LUN_FLAG_ID_REQ = 0x01,
- CTL_LUN_FLAG_STOPPED = 0x02,
- CTL_LUN_FLAG_NO_MEDIA = 0x04,
- CTL_LUN_FLAG_PRIMARY = 0x08,
- CTL_LUN_FLAG_SERIAL_NUM = 0x10,
- CTL_LUN_FLAG_DEVID = 0x20,
- CTL_LUN_FLAG_DEV_TYPE = 0x40,
- CTL_LUN_FLAG_UNMAP = 0x80,
- CTL_LUN_FLAG_EJECTED = 0x100,
- CTL_LUN_FLAG_READONLY = 0x200
-} ctl_backend_lun_flags;
+#include <cam/ctl/ctl_ioctl.h>
typedef enum {
CTL_LUN_SERSEQ_OFF,