Page MenuHomeFreeBSD

mpr/mps device mapper override
ClosedPublic

Authored by scottl on Oct 31 2016, 8:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 20, 11:51 PM
Unknown Object (File)
Thu, Nov 20, 11:45 PM
Unknown Object (File)
Thu, Nov 20, 11:45 PM
Unknown Object (File)
Thu, Nov 20, 11:42 PM
Unknown Object (File)
Thu, Nov 13, 6:16 AM
Unknown Object (File)
Tue, Nov 11, 7:42 PM
Unknown Object (File)
Nov 10 2025, 12:47 PM
Unknown Object (File)
Nov 9 2025, 3:11 AM
Subscribers
None

Details

Reviewers
ken
slm
imp
smh
Summary

Create a new sysctl and tunable to help ensure sane numbering of devices.
There are cases where the device_mapper code fails to generating mappings
between device handles and target numbers, or persistent mappings create
unpredictable holes in the numbering. This knob allows the driver to
fall back to a simple phy number mapping if the device mapper fails, or
allows the operator to override the device mapper entirely.

dev.mps.0.use_phy_num
hw.mps.use_phy_num
dev.mpr.0.use_phy_num
hw.mpr.0.use_phy_num

1 - use the PhyNum field as a fallback to the mapping logic
0 - never use the PhyNum field
-1 - only use the PhyNum field

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5805
Build 6097: arc lint + arc unit

Event Timeline

scottl retitled this revision from to mpr/mps device mapper override.
scottl updated this object.
scottl edited the test plan for this revision. (Show Details)
scottl added reviewers: imp, ken, smh.
smh requested changes to this revision.Oct 31 2016, 11:10 PM
smh edited edge metadata.

Wouldn't it be better to have 0 (the default) be "use the PhyNum field as a fallback to the mapping logic" as that way at least the device would initialise when mpX_mapping_get_sas_id fails?

sys/dev/mpr/mpr.c
1522

typo: enumeration

sys/dev/mpr/mprvar.h
374

use a int8_t?

sys/dev/mps/mps.c
1507

typo

sys/dev/mps/mpsvar.h
387

use a int8_t?

This revision now requires changes to proceed.Oct 31 2016, 11:10 PM

I'll set the default to 1 in the next revision.

sys/dev/mpr/mprvar.h
374

An int is required in order to be type compatible with TUNABLE_INT_FETCH and SYSCTL_ADD_INT. I could work around this with some accessor procedures, but I'm not sure it's worth the extra complication.

scottl edited edge metadata.

Address string typo and move a structure field around to a more logical spot.

Last comment might have been lost. I've set the default to 1.

smh edited edge metadata.
smh added inline comments.
sys/dev/mpr/mprvar.h
374

Ahh not worth the hassle then.

This revision is now accepted and ready to land.Nov 2 2016, 9:28 AM
commit 4ab1cdc5ad89d8da84985c674268f09545823e6d
Author: Scott Long <scottl@FreeBSD.org>
Date:   Wed Nov 2 15:13:25 2016 +0000

  Add a fallback to the device mapper logic.  We've seen systems in the field
  that are apparently misconfigured by the manufacturer and cause the mapping
  logic to fail.  The fallback allows drive numbers to be assigned based on the
  PHY number that they're attached to.  Add sysctls and tunables to overrid
  this new behavior, but they should be considered only necessary for debugging.

  Reviewed by:     imp, smh
  Obtained from:  Netflix
  MFC after:      3 days
  Sponsored by:   D8403