svn commit: r290108 - in projects/release-install-debug/sys: cam/ctl cam/scsi dev/sfxge/common
Glen Barber
gjb at FreeBSD.org
Wed Oct 28 14:15:58 UTC 2015
Author: gjb
Date: Wed Oct 28 14:15:56 2015
New Revision: 290108
URL: https://svnweb.freebsd.org/changeset/base/290108
Log:
MFH missing revisions:
r278550, r278584, r278709, r278965, r278967, r279076
Sponsored by: The FreeBSD Foundation
Modified:
projects/release-install-debug/sys/cam/ctl/ctl.c
projects/release-install-debug/sys/cam/ctl/ctl.h
projects/release-install-debug/sys/cam/ctl/ctl_private.h
projects/release-install-debug/sys/cam/scsi/scsi_all.h
projects/release-install-debug/sys/dev/sfxge/common/efx.h
projects/release-install-debug/sys/dev/sfxge/common/efx_mon.c
Directory Properties:
projects/release-install-debug/ (props changed)
projects/release-install-debug/sys/ (props changed)
Modified: projects/release-install-debug/sys/cam/ctl/ctl.c
==============================================================================
--- projects/release-install-debug/sys/cam/ctl/ctl.c Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/cam/ctl/ctl.c Wed Oct 28 14:15:56 2015 (r290108)
@@ -4483,6 +4483,8 @@ ctl_init_log_page_index(struct ctl_lun *
lun->log_pages.index[1].page_len = k * 2;
lun->log_pages.index[2].page_data = &lun->log_pages.lbp_page[0];
lun->log_pages.index[2].page_len = 12*CTL_NUM_LBP_PARAMS;
+ lun->log_pages.index[3].page_data = (uint8_t *)&lun->log_pages.stat_page;
+ lun->log_pages.index[3].page_len = sizeof(lun->log_pages.stat_page);
return (CTL_RETVAL_COMPLETE);
}
@@ -4720,6 +4722,9 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft
lun->serseq = CTL_LUN_SERSEQ_OFF;
lun->ctl_softc = ctl_softc;
+#ifdef CTL_TIME_IO
+ lun->last_busy = getsbinuptime();
+#endif
TAILQ_INIT(&lun->ooa_queue);
TAILQ_INIT(&lun->blocked_queue);
STAILQ_INIT(&lun->error_list);
@@ -7085,6 +7090,67 @@ ctl_lbp_log_sense_handler(struct ctl_scs
}
int
+ctl_sap_log_sense_handler(struct ctl_scsiio *ctsio,
+ struct ctl_page_index *page_index,
+ int pc)
+{
+ struct ctl_lun *lun;
+ struct stat_page *data;
+ uint64_t rn, wn, rb, wb;
+ struct bintime rt, wt;
+ int i;
+
+ lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr;
+ data = (struct stat_page *)page_index->page_data;
+
+ scsi_ulto2b(SLP_SAP, data->sap.hdr.param_code);
+ data->sap.hdr.param_control = SLP_LBIN;
+ data->sap.hdr.param_len = sizeof(struct scsi_log_stat_and_perf) -
+ sizeof(struct scsi_log_param_header);
+ rn = wn = rb = wb = 0;
+ bintime_clear(&rt);
+ bintime_clear(&wt);
+ for (i = 0; i < CTL_MAX_PORTS; i++) {
+ rn += lun->stats.ports[i].operations[CTL_STATS_READ];
+ wn += lun->stats.ports[i].operations[CTL_STATS_WRITE];
+ rb += lun->stats.ports[i].bytes[CTL_STATS_READ];
+ wb += lun->stats.ports[i].bytes[CTL_STATS_WRITE];
+ bintime_add(&rt, &lun->stats.ports[i].time[CTL_STATS_READ]);
+ bintime_add(&wt, &lun->stats.ports[i].time[CTL_STATS_WRITE]);
+ }
+ scsi_u64to8b(rn, data->sap.read_num);
+ scsi_u64to8b(wn, data->sap.write_num);
+ if (lun->stats.blocksize > 0) {
+ scsi_u64to8b(wb / lun->stats.blocksize,
+ data->sap.recvieved_lba);
+ scsi_u64to8b(rb / lun->stats.blocksize,
+ data->sap.transmitted_lba);
+ }
+ scsi_u64to8b((uint64_t)rt.sec * 1000 + rt.frac / (UINT64_MAX / 1000),
+ data->sap.read_int);
+ scsi_u64to8b((uint64_t)wt.sec * 1000 + wt.frac / (UINT64_MAX / 1000),
+ data->sap.write_int);
+ scsi_u64to8b(0, data->sap.weighted_num);
+ scsi_u64to8b(0, data->sap.weighted_int);
+ scsi_ulto2b(SLP_IT, data->it.hdr.param_code);
+ data->it.hdr.param_control = SLP_LBIN;
+ data->it.hdr.param_len = sizeof(struct scsi_log_idle_time) -
+ sizeof(struct scsi_log_param_header);
+#ifdef CTL_TIME_IO
+ scsi_u64to8b(lun->idle_time / SBT_1MS, data->it.idle_int);
+#endif
+ scsi_ulto2b(SLP_TI, data->ti.hdr.param_code);
+ data->it.hdr.param_control = SLP_LBIN;
+ data->ti.hdr.param_len = sizeof(struct scsi_log_time_interval) -
+ sizeof(struct scsi_log_param_header);
+ scsi_ulto4b(3, data->ti.exponent);
+ scsi_ulto4b(1, data->ti.integer);
+
+ page_index->page_len = sizeof(*data);
+ return (0);
+}
+
+int
ctl_log_sense(struct ctl_scsiio *ctsio)
{
struct ctl_lun *lun;
@@ -11690,6 +11756,12 @@ ctl_scsiio_precheck(struct ctl_softc *so
* Every I/O goes into the OOA queue for a
* particular LUN, and stays there until completion.
*/
+#ifdef CTL_TIME_IO
+ if (TAILQ_EMPTY(&lun->ooa_queue)) {
+ lun->idle_time += getsbinuptime() -
+ lun->last_busy;
+ }
+#endif
TAILQ_INSERT_TAIL(&lun->ooa_queue, &ctsio->io_hdr,
ooa_links);
}
@@ -13730,6 +13802,10 @@ ctl_process_done(union ctl_io *io)
* Remove this from the OOA queue.
*/
TAILQ_REMOVE(&lun->ooa_queue, &io->io_hdr, ooa_links);
+#ifdef CTL_TIME_IO
+ if (TAILQ_EMPTY(&lun->ooa_queue))
+ lun->last_busy = getsbinuptime();
+#endif
/*
* Run through the blocked queue on this LUN and see if anything
Modified: projects/release-install-debug/sys/cam/ctl/ctl.h
==============================================================================
--- projects/release-install-debug/sys/cam/ctl/ctl.h Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/cam/ctl/ctl.h Wed Oct 28 14:15:56 2015 (r290108)
@@ -181,6 +181,9 @@ int ctl_debugconf_sp_select_handler(stru
int ctl_lbp_log_sense_handler(struct ctl_scsiio *ctsio,
struct ctl_page_index *page_index,
int pc);
+int ctl_sap_log_sense_handler(struct ctl_scsiio *ctsio,
+ struct ctl_page_index *page_index,
+ int pc);
int ctl_config_move_done(union ctl_io *io);
void ctl_datamove(union ctl_io *io);
void ctl_done(union ctl_io *io);
Modified: projects/release-install-debug/sys/cam/ctl/ctl_private.h
==============================================================================
--- projects/release-install-debug/sys/cam/ctl/ctl_private.h Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/cam/ctl/ctl_private.h Wed Oct 28 14:15:56 2015 (r290108)
@@ -342,6 +342,8 @@ static const struct ctl_page_index log_p
CTL_PAGE_FLAG_NONE, NULL, NULL},
{SLS_LOGICAL_BLOCK_PROVISIONING, 0, 0, NULL,
CTL_PAGE_FLAG_NONE, ctl_lbp_log_sense_handler, NULL},
+ {SLS_STAT_AND_PERF, 0, 0, NULL,
+ CTL_PAGE_FLAG_NONE, ctl_sap_log_sense_handler, NULL},
};
#define CTL_NUM_LOG_PAGES sizeof(log_page_index_template)/ \
@@ -351,6 +353,11 @@ struct ctl_log_pages {
uint8_t pages_page[CTL_NUM_LOG_PAGES];
uint8_t subpages_page[CTL_NUM_LOG_PAGES * 2];
uint8_t lbp_page[12*CTL_NUM_LBP_PARAMS];
+ struct stat_page {
+ struct scsi_log_stat_and_perf sap;
+ struct scsi_log_idle_time it;
+ struct scsi_log_time_interval ti;
+ } stat_page;
struct ctl_page_index index[CTL_NUM_LOG_PAGES];
};
@@ -403,6 +410,10 @@ struct ctl_lun {
struct ctl_lun_delay_info delay_info;
int sync_interval;
int sync_count;
+#ifdef CTL_TIME_IO
+ sbintime_t idle_time;
+ sbintime_t last_busy;
+#endif
TAILQ_HEAD(ctl_ooaq, ctl_io_hdr) ooa_queue;
TAILQ_HEAD(ctl_blockq,ctl_io_hdr) blocked_queue;
STAILQ_ENTRY(ctl_lun) links;
Modified: projects/release-install-debug/sys/cam/scsi/scsi_all.h
==============================================================================
--- projects/release-install-debug/sys/cam/scsi/scsi_all.h Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/cam/scsi/scsi_all.h Wed Oct 28 14:15:56 2015 (r290108)
@@ -561,6 +561,7 @@ struct scsi_log_sense
#define SLS_ERROR_LASTN_PAGE 0x07
#define SLS_LOGICAL_BLOCK_PROVISIONING 0x0c
#define SLS_SELF_TEST_PAGE 0x10
+#define SLS_STAT_AND_PERF 0x19
#define SLS_IE_PAGE 0x2f
#define SLS_PAGE_CTRL_MASK 0xC0
#define SLS_PAGE_CTRL_THRESHOLD 0x00
@@ -619,6 +620,45 @@ struct scsi_log_param_header {
u_int8_t param_len;
};
+struct scsi_log_stat_and_perf {
+ struct scsi_log_param_header hdr;
+#define SLP_SAP 0x0001
+ uint8_t read_num[8];
+ uint8_t write_num[8];
+ uint8_t recvieved_lba[8];
+ uint8_t transmitted_lba[8];
+ uint8_t read_int[8];
+ uint8_t write_int[8];
+ uint8_t weighted_num[8];
+ uint8_t weighted_int[8];
+};
+
+struct scsi_log_idle_time {
+ struct scsi_log_param_header hdr;
+#define SLP_IT 0x0002
+ uint8_t idle_int[8];
+};
+
+struct scsi_log_time_interval {
+ struct scsi_log_param_header hdr;
+#define SLP_TI 0x0003
+ uint8_t exponent[4];
+ uint8_t integer[4];
+};
+
+struct scsi_log_fua_stat_and_perf {
+ struct scsi_log_param_header hdr;
+#define SLP_FUA_SAP 0x0004
+ uint8_t fua_read_num[8];
+ uint8_t fua_write_num[8];
+ uint8_t fuanv_read_num[8];
+ uint8_t fuanv_write_num[8];
+ uint8_t fua_read_int[8];
+ uint8_t fua_write_int[8];
+ uint8_t fuanv_read_int[8];
+ uint8_t fuanv_write_int[8];
+};
+
struct scsi_control_page {
u_int8_t page_code;
u_int8_t page_length;
Modified: projects/release-install-debug/sys/dev/sfxge/common/efx.h
==============================================================================
--- projects/release-install-debug/sys/dev/sfxge/common/efx.h Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/dev/sfxge/common/efx.h Wed Oct 28 14:15:56 2015 (r290108)
@@ -459,7 +459,7 @@ efx_mon_init(
#define EFX_MON_STATS_SIZE 0x100
-/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 16a14e61aa4f8d80 */
+/* START MKCONFIG GENERATED MonitorHeaderStatsBlock 58706a378332aeee */
typedef enum efx_mon_stat_e {
EFX_MON_STAT_2_5V,
EFX_MON_STAT_VCCP1,
@@ -477,6 +477,20 @@ typedef enum efx_mon_stat_e {
EFX_MON_STAT_1_2V,
EFX_MON_STAT_1_8V,
EFX_MON_STAT_3_3V,
+ EFX_MON_STAT_1_2VA,
+ EFX_MON_STAT_VREF,
+ EFX_MON_STAT_VAOE,
+ EFX_MON_STAT_AOE_TEMP,
+ EFX_MON_STAT_PSU_AOE_TEMP,
+ EFX_MON_STAT_PSU_TEMP,
+ EFX_MON_STAT_FAN0,
+ EFX_MON_STAT_FAN1,
+ EFX_MON_STAT_FAN2,
+ EFX_MON_STAT_FAN3,
+ EFX_MON_STAT_FAN4,
+ EFX_MON_STAT_VAOE_IN,
+ EFX_MON_STAT_IAOE,
+ EFX_MON_STAT_IAOE_IN,
EFX_MON_NSTATS
} efx_mon_stat_t;
Modified: projects/release-install-debug/sys/dev/sfxge/common/efx_mon.c
==============================================================================
--- projects/release-install-debug/sys/dev/sfxge/common/efx_mon.c Wed Oct 28 13:30:14 2015 (r290107)
+++ projects/release-install-debug/sys/dev/sfxge/common/efx_mon.c Wed Oct 28 14:15:56 2015 (r290108)
@@ -195,7 +195,7 @@ fail1:
#if EFSYS_OPT_NAMES
-/* START MKCONFIG GENERATED MonitorStatNamesBlock 08518fd1fb4e2612 */
+/* START MKCONFIG GENERATED MonitorStatNamesBlock 89ff37f1d74ad8b3 */
static const char __cs * __cs __mon_stat_name[] = {
"value_2_5v",
"value_vccp1",
@@ -213,6 +213,20 @@ static const char __cs * __cs __mon_sta
"1_2v",
"1_8v",
"3_3v",
+ "1_2va",
+ "vref",
+ "vaoe",
+ "aoe_temperature",
+ "psu_aoe_temperature",
+ "psu_temperature",
+ "fan0",
+ "fan1",
+ "fan2",
+ "fan3",
+ "fan4",
+ "vaoe_in",
+ "iaoe",
+ "iaoe_in",
};
/* END MKCONFIG GENERATED MonitorStatNamesBlock */
More information about the svn-src-projects
mailing list