FreeBSD Bugzilla – Attachment 214328 Details for
Bug 246279
ciss device driver not allowing more than 48 drives to be detected by the CAM layer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Patch to fix support for more than 48 drives in HBA mode
ciss-hba.patch (text/plain), 3.60 KB, created by
Peter Eriksson
on 2020-05-09 23:19:10 UTC
(
hide
)
Description:
Patch to fix support for more than 48 drives in HBA mode
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2020-05-09 23:19:10 UTC
Size:
3.60 KB
patch
obsolete
># This patch fixes the handling of many drives in JBOD (HBA) mode ># Without the following fixes this the current code fails to handle ># more than 48 drives per controller (depending on controller model, ># but for a HP H241 which supports 64 logical volumes this is true) ># ># Author: Peter Eriksson <pen@lysator.liu.se> ># Date: 2020-05-10 ># >diff -u -r sys/dev/ciss.ORIG/ciss.c sys/dev/ciss/ciss.c >--- sys/dev/ciss.ORIG/ciss.c 2020-05-10 00:04:24.383068000 +0200 >+++ sys/dev/ciss/ciss.c 2020-05-10 00:17:05.276302000 +0200 >@@ -1414,6 +1414,10 @@ > > /* sanity-check reply */ > ndrives = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); >+ >+ ciss_printf(sc, "%d logical drive%s\n", >+ ndrives, (ndrives > 1 || ndrives == 0) ? "s" : ""); >+ > if ((ndrives < 0) || (ndrives > sc->ciss_cfg->max_logical_supported)) { > ciss_printf(sc, "adapter claims to report absurd number of logical drives (%d > %d)\n", > ndrives, sc->ciss_cfg->max_logical_supported); >@@ -1424,10 +1428,6 @@ > /* > * Save logical drive information. > */ >- if (bootverbose) { >- ciss_printf(sc, "%d logical drive%s\n", >- ndrives, (ndrives > 1 || ndrives == 0) ? "s" : ""); >- } > > sc->ciss_logical = > malloc(sc->ciss_max_logical_bus * sizeof(struct ciss_ldrive *), >@@ -1502,11 +1502,12 @@ > > nphys = (ntohl(cll->list_size) / sizeof(union ciss_device_address)); > >- if (bootverbose) { >- ciss_printf(sc, "%d physical device%s\n", >+ ciss_printf(sc, "%d physical device%s\n", > nphys, (nphys > 1 || nphys == 0) ? "s" : ""); >- } > >+ /* Per-controller highest target number seen */ >+ sc->ciss_max_physical_target = 0; >+ > /* > * Figure out the bus mapping. > * Logical buses include both the local logical bus for local arrays and >@@ -1589,6 +1590,7 @@ > } > > ciss_filter_physical(sc, cll); >+ ciss_printf(sc, "max physical target id: %d\n", sc->ciss_max_physical_target); > > out: > if (cll != NULL) >@@ -1638,6 +1640,9 @@ > target = CISS_EXTRA_TARGET2(ea); > sc->ciss_physical[bus][target].cp_address = cll->lun[i]; > sc->ciss_physical[bus][target].cp_online = 1; >+ >+ if (target > sc->ciss_max_physical_target) >+ sc->ciss_max_physical_target = target; > } > > return (0); >@@ -3028,9 +3033,13 @@ > cpi->hba_inquiry = PI_TAG_ABLE; /* XXX is this correct? */ > cpi->target_sprt = 0; > cpi->hba_misc = 0; >- cpi->max_target = sc->ciss_cfg->max_logical_supported; >+ /* make sure max_target is the highest of max_logical_supported or the detected ciss_max_targets */ >+ cpi->max_target = (sc->ciss_max_physical_target > sc->ciss_cfg->max_logical_supported ? >+ sc->ciss_max_physical_target : sc->ciss_cfg->max_logical_supported); > cpi->max_lun = 0; /* 'logical drive' channel only */ >- cpi->initiator_id = sc->ciss_cfg->max_logical_supported; >+ /* make sure the initiator_id is outside the range of used targets */ >+ cpi->initiator_id = (sc->ciss_cfg->max_logical_supported <= sc->ciss_max_physical_target ? >+ sc->ciss_max_physical_target+1 : sc->ciss_cfg->max_logical_supported); > strlcpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); > strlcpy(cpi->hba_vid, "CISS", HBA_IDLEN); > strlcpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); >diff -u -r sys/dev/ciss.ORIG/cissvar.h sys/dev/ciss/cissvar.h >--- sys/dev/ciss.ORIG/cissvar.h 2020-05-10 00:04:24.383383000 +0200 >+++ sys/dev/ciss/cissvar.h 2020-05-10 00:14:31.633145000 +0200 >@@ -238,6 +238,7 @@ > int ciss_max_bus_number; /* maximum bus number */ > int ciss_max_logical_bus; > int ciss_max_physical_bus; >+ int ciss_max_physical_target; /* highest physical target number */ > > struct cam_devq *ciss_cam_devq; > struct cam_sim **ciss_cam_sim;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 246279
:
214288
|
214289
|
214315
| 214328