git: 39c37df826a7 - stable/12 - pms(4): Limit maximum I/O size to 256KB instead of 1MB.
Alexander Motin
mav at FreeBSD.org
Fri Apr 23 01:09:18 UTC 2021
The branch stable/12 has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=39c37df826a73a8dd4d2d3e5909102969291170e
commit 39c37df826a73a8dd4d2d3e5909102969291170e
Author: Alexander Motin <mav at FreeBSD.org>
AuthorDate: 2021-04-16 19:39:01 +0000
Commit: Alexander Motin <mav at FreeBSD.org>
CommitDate: 2021-04-23 01:09:07 +0000
pms(4): Limit maximum I/O size to 256KB instead of 1MB.
There is a weird limit of AGTIAPI_MAX_DMA_SEGS (128) S/G segments per
I/O since the initial driver import. I don't know why it was added,
can only guess some hardware limitation, but in worst case it means
maximum I/O size of 508KB. Respect it to be safe, rounding to 256KB.
MFC after: 1 week
Sponsored by: iXsystems, Inc.
(cherry picked from commit 3e347834200b5d91a33384e696793e4ac20a44d4)
---
sys/dev/pms/freebsd/driver/ini/src/agdef.h | 2 +-
sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/sys/dev/pms/freebsd/driver/ini/src/agdef.h b/sys/dev/pms/freebsd/driver/ini/src/agdef.h
index fea7563c8b04..20d5d93690d3 100644
--- a/sys/dev/pms/freebsd/driver/ini/src/agdef.h
+++ b/sys/dev/pms/freebsd/driver/ini/src/agdef.h
@@ -62,7 +62,7 @@ EW 09-17-2004 1.0.0 Constant definitions
#define AGTIAPI_MAX_DEVICE_7H 256 /*Max devices per channel in 7H */
#define AGTIAPI_MAX_DEVICE_8H 512 /*Max devices per channel in 8H*/
#define AGTIAPI_MAX_CAM_Q_DEPTH 1024
-#define AGTIAPI_NSEGS (btoc(MAXPHYS) + 1)
+#define AGTIAPI_NSEGS (MIN(btoc(MAXPHYS), 64) + 1)
/*
** Adapter specific defines
*/
diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
index 711fb027f59e..79de3f6961d3 100644
--- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
+++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c
@@ -1834,7 +1834,7 @@ static void agtiapi_cam_action( struct cam_sim *sim, union ccb * ccb )
cpi->max_target = maxTargets - 1;
cpi->max_lun = AGTIAPI_MAX_LUN;
/* Max supported I/O size, in bytes. */
- cpi->maxio = ulmin(1024 * 1024, MAXPHYS);
+ cpi->maxio = ctob(AGTIAPI_NSEGS - 1);
cpi->initiator_id = 255;
strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
strlcpy(cpi->hba_vid, "PMC", HBA_IDLEN);
More information about the dev-commits-src-branches
mailing list