Skip to content

Commit e923016

Browse files
brandon-paupore-sndkigaw
authored andcommitted
types: Support Phy Rx Eye Opening Measurement Log
This implements support for TP4119a, adding various fields and functions to enable better handling of the new Physical Receiver Eye Opening Measurement log page. Signed-off-by: Brandon Paupore <[email protected]>
1 parent 9797fd2 commit e923016

3 files changed

Lines changed: 200 additions & 0 deletions

File tree

src/nvme/ioctl.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,41 @@ static inline int nvme_get_log_boot_partition(int fd, bool rae,
19281928
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
19291929
}
19301930

1931+
/**
1932+
* nvme_get_log_phy_rx_eom() - Retrieve Physical Interface Receiver Eye Opening Measurement Log
1933+
* @fd: File descriptor of nvme device
1934+
* @lsp: Log specific, controls action and measurement quality
1935+
* @controller: Target controller ID
1936+
* @len: The allocated size, minimum
1937+
* struct nvme_phy_rx_eom_log
1938+
* @log: User address to store the log page
1939+
*
1940+
* Return: The nvme command status if a response was received (see
1941+
* &enum nvme_status_field) or -1 with errno set otherwise
1942+
*/
1943+
static inline int nvme_get_log_phy_rx_eom(int fd, __u8 lsp, __u16 controller,
1944+
__u32 len, struct nvme_phy_rx_eom_log *log)
1945+
{
1946+
struct nvme_get_log_args args = {
1947+
.lpo = 0,
1948+
.result = NULL,
1949+
.log = log,
1950+
.args_size = sizeof(args),
1951+
.fd = fd,
1952+
.timeout = NVME_DEFAULT_IOCTL_TIMEOUT,
1953+
.lid = NVME_LOG_LID_PHY_RX_EOM,
1954+
.len = len,
1955+
.nsid = NVME_NSID_NONE,
1956+
.csi = NVME_CSI_NVM,
1957+
.lsi = controller,
1958+
.lsp = lsp,
1959+
.uuidx = NVME_UUID_NONE,
1960+
.rae = false,
1961+
.ot = false,
1962+
};
1963+
return nvme_get_log_page(fd, NVME_LOG_PAGE_PDU_SIZE, &args);
1964+
}
1965+
19311966
/**
19321967
* nvme_get_log_discovery() - Retrieve Discovery log page
19331968
* @fd: File descriptor of nvme device

src/nvme/mi.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2106,6 +2106,41 @@ static inline int nvme_mi_admin_get_log_boot_partition(nvme_mi_ctrl_t ctrl,
21062106
return nvme_mi_admin_get_log(ctrl, &args);
21072107
}
21082108

2109+
/**
2110+
* nvme_mi_admin_get_log_phy_rx_eom() - Retrieve Physical Interface Receiver Eye Opening Measurement Log
2111+
* @ctrl: Controller to query
2112+
* @lsp: Log specific, controls action and measurement quality
2113+
* @controller: Target controller ID
2114+
* @len: The allocated size, minimum
2115+
* struct nvme_phy_rx_eom_log
2116+
* @log: User address to store the log page
2117+
*
2118+
* Return: The nvme command status if a response was received (see
2119+
* &enum nvme_status_field) or -1 with errno set otherwise
2120+
*/
2121+
static inline int nvme_mi_admin_get_log_phy_rx_eom(nvme_mi_ctrl_t ctrl,
2122+
__u8 lsp, __u16 controller,
2123+
__u32 len,
2124+
struct nvme_phy_rx_eom_log *log)
2125+
{
2126+
struct nvme_get_log_args args = {
2127+
.lpo = 0,
2128+
.result = NULL,
2129+
.log = log,
2130+
.args_size = sizeof(args),
2131+
.lid = NVME_LOG_LID_PHY_RX_EOM,
2132+
.len = len,
2133+
.nsid = NVME_NSID_NONE,
2134+
.csi = NVME_CSI_NVM,
2135+
.lsi = controller,
2136+
.lsp = lsp,
2137+
.uuidx = NVME_UUID_NONE,
2138+
.rae = false,
2139+
.ot = false,
2140+
};
2141+
return nvme_mi_admin_get_log(ctrl, &args);
2142+
}
2143+
21092144
/**
21102145
* nvme_mi_admin_get_log_discovery() - Retrieve Discovery log page
21112146
* @ctrl: Controller to query

src/nvme/types.h

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,6 +3721,110 @@ struct nvme_boot_partition {
37213721
__u8 boot_partition_data[];
37223722
};
37233723

3724+
/**
3725+
* struct nvme_eom_lane_desc - EOM Lane Descriptor
3726+
* @rsvd0: Reserved
3727+
* @mstatus: Measurement Status
3728+
* @lane: Lane number
3729+
* @eye: Eye number
3730+
* @top: Absolute number of rows from center to top edge of eye
3731+
* @bottom: Absolute number of rows from center to bottom edge of eye
3732+
* @left: Absolute number of rows from center to left edge of eye
3733+
* @right: Absolute number of rows from center to right edge of eye
3734+
* @nrows: Number of Rows
3735+
* @ncols: Number of Columns
3736+
* @edlen: Eye Data Length
3737+
* @rsvd18: Reserved
3738+
* @eye_desc: Printable Eye, Eye Data, and any Padding
3739+
*/
3740+
struct nvme_eom_lane_desc {
3741+
__u8 rsvd0;
3742+
__u8 mstatus;
3743+
__u8 lane;
3744+
__u8 eye;
3745+
__le16 top;
3746+
__le16 bottom;
3747+
__le16 left;
3748+
__le16 right;
3749+
__le16 nrows;
3750+
__le16 ncols;
3751+
__le16 edlen;
3752+
__u8 rsvd18[14];
3753+
__u8 eye_desc[];
3754+
};
3755+
3756+
/**
3757+
* struct nvme_phy_rx_eom_log - Physical Interface Receiver Eye Opening Measurement Log
3758+
* @lid: Log Identifier
3759+
* @eomip: EOM In Progress
3760+
* @hsize: Header Size
3761+
* @rsize: Result Size
3762+
* @eomdgn: EOM Data Generation Number
3763+
* @lr: Log Revision
3764+
* @odp: Optional Data Present
3765+
* @lanes: Number of lanes configured for this port
3766+
* @epl: Eyes Per Lane
3767+
* @lspfc: Log Specific Parameter Field Copy
3768+
* @li: Link Information
3769+
* @rsvd15: Reserved
3770+
* @lsic: Log Specific Identifier Copy
3771+
* @dsize: Descriptor Size
3772+
* @nd: Number of Descriptors
3773+
* @maxtb: Maximum Top Bottom
3774+
* @maxlr: Maximum Left Right
3775+
* @etgood: Estimated Time for Good Quality
3776+
* @etbetter: Estimated Time for Better Quality
3777+
* @etbest: Estimated Time for Best Quality
3778+
* @rsvd36: Reserved
3779+
* @descs: EOM Lane Descriptors
3780+
*/
3781+
struct nvme_phy_rx_eom_log {
3782+
__u8 lid;
3783+
__u8 eomip;
3784+
__le16 hsize;
3785+
__le32 rsize;
3786+
__u8 eomdgn;
3787+
__u8 lr;
3788+
__u8 odp;
3789+
__u8 lanes;
3790+
__u8 epl;
3791+
__u8 lspfc;
3792+
__u8 li;
3793+
__u8 rsvd15[3];
3794+
__le16 lsic;
3795+
__le32 dsize;
3796+
__le16 nd;
3797+
__le16 maxtb;
3798+
__le16 maxlr;
3799+
__le16 etgood;
3800+
__le16 etbetter;
3801+
__le16 etbest;
3802+
__u8 rsvd36[28];
3803+
struct nvme_eom_lane_desc descs[];
3804+
};
3805+
3806+
/**
3807+
* enum nvme_eom_optional_data - EOM Optional Data Present Fields
3808+
* @NVME_EOM_EYE_DATA_PRESENT: Eye Data Present
3809+
* @NVME_EOM_PRINTABLE_EYE_PRESENT: Printable Eye Present
3810+
*/
3811+
enum nvme_eom_optional_data {
3812+
NVME_EOM_EYE_DATA_PRESENT = 1,
3813+
NVME_EOM_PRINTABLE_EYE_PRESENT = 1 << 1,
3814+
};
3815+
3816+
/**
3817+
* enum nvme_phy_rx_eom_progress - EOM In Progress Values
3818+
* @NVME_PHY_RX_EOM_NOT_STARTED: EOM Not Started
3819+
* @NVME_PHY_RX_EOM_IN_PROGRESS: EOM In Progress
3820+
* @NVME_PHY_RX_EOM_COMPLETED: EOM Completed
3821+
*/
3822+
enum nvme_phy_rx_eom_progress {
3823+
NVME_PHY_RX_EOM_NOT_STARTED = 0,
3824+
NVME_PHY_RX_EOM_IN_PROGRESS = 1,
3825+
NVME_PHY_RX_EOM_COMPLETED = 2,
3826+
};
3827+
37243828
/**
37253829
* struct nvme_media_unit_stat_desc - Media Unit Status Descriptor
37263830
* @muid: Media Unit Identifier
@@ -6700,6 +6804,7 @@ enum nvme_identify_cns {
67006804
* @NVME_LOG_LID_FID_SUPPORTED_EFFECTS: Feature Identifiers Supported and Effects
67016805
* @NVME_LOG_LID_MI_CMD_SUPPORTED_EFFECTS: NVMe-MI Commands Supported and Effects
67026806
* @NVME_LOG_LID_BOOT_PARTITION: Boot Partition
6807+
* @NVME_LOG_LID_PHY_RX_EOM: Physical Interface Receiver Eye Opening Measurement
67036808
* @NVME_LOG_LID_FDP_CONFIGS: FDP Configurations
67046809
* @NVME_LOG_LID_FDP_RUH_USAGE: Reclaim Unit Handle Usage
67056810
* @NVME_LOG_LID_FDP_STATS: FDP Statistics
@@ -6731,6 +6836,7 @@ enum nvme_cmd_get_log_lid {
67316836
NVME_LOG_LID_FID_SUPPORTED_EFFECTS = 0x12,
67326837
NVME_LOG_LID_MI_CMD_SUPPORTED_EFFECTS = 0x13,
67336838
NVME_LOG_LID_BOOT_PARTITION = 0x15,
6839+
NVME_LOG_LID_PHY_RX_EOM = 0x19,
67346840
NVME_LOG_LID_FDP_CONFIGS = 0x20,
67356841
NVME_LOG_LID_FDP_RUH_USAGE = 0x21,
67366842
NVME_LOG_LID_FDP_STATS = 0x22,
@@ -7284,6 +7390,30 @@ enum nvme_log_ana_lsp {
72847390
NVME_LOG_ANA_LSP_RGO_GROUPS_ONLY = 1,
72857391
};
72867392

7393+
/**
7394+
* enum nvme_log_phy_rx_eom_action - Physical Interface Receiver Eye Opening Measurement Action
7395+
* @NVME_LOG_PHY_RX_EOM_READ: Read Log Data
7396+
* @NVME_LOG_PHY_RX_EOM_START_READ: Start Measurement and Read Log Data
7397+
* @NVME_LOG_PHY_RX_EOM_ABORT_CLEAR: Abort Measurement and Clear Log Data
7398+
*/
7399+
enum nvme_log_phy_rx_eom_action {
7400+
NVME_LOG_PHY_RX_EOM_READ = 0,
7401+
NVME_LOG_PHY_RX_EOM_START_READ = 1,
7402+
NVME_LOG_PHY_RX_EOM_ABORT_CLEAR = 2,
7403+
};
7404+
7405+
/**
7406+
* enum nvme_log_phy_rx_eom_quality - Physical Interface Receiver Eye Opening Measurement Quality
7407+
* @NVME_LOG_PHY_RX_EOM_GOOD: <= Better Quality
7408+
* @NVME_LOG_PHY_RX_EOM_BETTER: <= Best Quality, >= Good Quality
7409+
* @NVME_LOG_PHY_RX_EOM_BEST: >= Better Quality
7410+
*/
7411+
enum nvme_log_phy_rx_eom_quality {
7412+
NVME_LOG_PHY_RX_EOM_GOOD = 0,
7413+
NVME_LOG_PHY_RX_EOM_BETTER = 1,
7414+
NVME_LOG_PHY_RX_EOM_BEST = 2,
7415+
};
7416+
72877417
/**
72887418
* enum nvme_pevent_log_action - Persistent Event Log - Action
72897419
* @NVME_PEVENT_LOG_READ: Read Log Data

0 commit comments

Comments
 (0)