summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2017-03-25 11:44:34 +0000
committermav <mav@FreeBSD.org>2017-03-25 11:44:34 +0000
commit0b10ebd54d6b8ed544d5acb5cac43e6d89c7ebc3 (patch)
tree6894741a0748223cc32035ef82c3ab0c47d651bf /sys/cam
parentc3e84c14c1a886f8b4880e7343c03095cc2fe2ce (diff)
downloadFreeBSD-src-0b10ebd54d6b8ed544d5acb5cac43e6d89c7ebc3.zip
FreeBSD-src-0b10ebd54d6b8ed544d5acb5cac43e6d89c7ebc3.tar.gz
MFC r315084: Increase device openings to tagged maximum.
Some SIMs report much less untagged device openings then tagged ones. Target mode devices are not handled by regular probing routines, and so there is nothing to increase queue size for them to the SIM's maximum. To fix that resize the queue explicitly on ctl periph registration. This radically improves performance of mpt(4) in target mode. Also fetch and report device queue statistics in `ctladm dumpstructs`, since regular way of `camcontrol tags` is not usable in target mode.
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/ctl/scsi_ctl.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/sys/cam/ctl/scsi_ctl.c b/sys/cam/ctl/scsi_ctl.c
index 97a4d19..95d4c7c 100644
--- a/sys/cam/ctl/scsi_ctl.c
+++ b/sys/cam/ctl/scsi_ctl.c
@@ -457,6 +457,16 @@ ctlferegister(struct cam_periph *periph, void *arg)
softc->periph = periph;
periph->softc = softc;
+ /* Increase device openings to maximum for the SIM. */
+ if (bus_softc->sim->max_tagged_dev_openings >
+ bus_softc->sim->max_dev_openings) {
+ cam_release_devq(periph->path,
+ /*relsim_flags*/RELSIM_ADJUST_OPENINGS,
+ /*openings*/bus_softc->sim->max_tagged_dev_openings,
+ /*timeout*/0,
+ /*getcount_only*/1);
+ }
+
xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NONE);
ccb.ccb_h.func_code = XPT_EN_LUN;
ccb.cel.grp6_len = 0;
@@ -1816,9 +1826,9 @@ static void
ctlfe_dump_sim(struct cam_sim *sim)
{
- printf("%s%d: max tagged openings: %d, max dev openings: %d\n",
- sim->sim_name, sim->unit_number,
- sim->max_tagged_dev_openings, sim->max_dev_openings);
+ printf("%s%d: max dev openings: %d, max tagged dev openings: %d\n",
+ sim->sim_name, sim->unit_number, sim->max_dev_openings,
+ sim->max_tagged_dev_openings);
}
/*
@@ -1827,11 +1837,21 @@ ctlfe_dump_sim(struct cam_sim *sim)
static void
ctlfe_dump_queue(struct ctlfe_lun_softc *softc)
{
+ struct cam_periph *periph = softc->periph;
struct ccb_hdr *hdr;
- struct cam_periph *periph;
+ struct ccb_getdevstats cgds;
int num_items;
- periph = softc->periph;
+ xpt_setup_ccb(&cgds.ccb_h, periph->path, CAM_PRIORITY_NORMAL);
+ cgds.ccb_h.func_code = XPT_GDEV_STATS;
+ xpt_action((union ccb *)&cgds);
+ if ((cgds.ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+ xpt_print(periph->path, "devq: openings %d, active %d, "
+ "allocated %d, queued %d, held %d\n",
+ cgds.dev_openings, cgds.dev_active, cgds.allocated,
+ cgds.queued, cgds.held);
+ }
+
num_items = 0;
STAILQ_FOREACH(hdr, &softc->work_queue, periph_links.stqe) {
OpenPOWER on IntegriCloud