Adaptive replay of packets in a peripheral interface link
Systems, methods, and circuits for adaptive replay of data link packets in a peripheral interface are described. The data link layer according to a peripheral interface protocol may include a replay buffer memory to support both sequential and selective replay in response to packet errors. Responsive to detecting a packet in error, the receiver may determine an adaptive threshold for selecting a replay mode based on a set of link operating parameters and then select between selective and sequential replay modes by comparing the fill level of the replay buffer to the adaptive threshold determined for that packet error.
1 . A device comprising a peripheral interface configured to connect to a host system using a peripheral interface protocol, wherein:
the peripheral interface protocol comprises a data link layer configured to transmit and receive data link packets; and
the peripheral interface comprises:
a replay buffer memory configured to store received data link packets following a packet in error to support a selective replay mode; and
a replay logic circuit configured to:
determine an error in a data link packet received through the peripheral interface;
dynamically determine an adaptive threshold for selecting a replay mode based on a set of link operating parameters;
select, based on comparing a fill level of the replay buffer memory to the adaptive threshold, a replay mode selected from:
the selective replay mode for requesting retransmission of only the data link packet in error; and
a sequential replay mode for requesting retransmission of the data link packet in error and subsequent data link packets sent after the data link packet in error; and
send, based on the selected replay mode, a replay request to the host system.
2 . The device of claim 1 , wherein the replay logic circuit is further configured to:
responsive to the selective replay mode:
store, in the replay buffer memory, sequential data link packets without errors received after the data link packet in error;
sequentially send, responsive to receiving an error-free version of the data link packet in error from the host system, transaction layer content from the error-free version of the data link packet in error and the sequential data link packets without errors in the replay buffer memory; and
clear the sequential data link packets without errors from the replay buffer memory; and
responsive to the sequential replay mode:
discard sequential data link packets received after the data link packet in error; and
sequentially send, responsive to receiving the error-free version of the data link packet in error and resent sequential data link packets received after the error-free version of the data link packet in error, transaction layer content from the error-free version of the data link packet in error and the resent sequential data link packets.
3 . The device of claim 1 , wherein:
the replay buffer memory has a buffer size corresponding to a total number of data link packets that can be stored in the replay buffer memory at a time;
the fill level corresponds to a current number of data link packets stored in the replay buffer memory for pending selective replay requests;
the adaptive threshold corresponds to a maximum fill level that is less than the buffer size of the replay buffer memory; and
the replay logic circuit is further configured to periodically determine the adaptive threshold from a plurality of maximum fill levels based on the set of link operating parameters.
4 . The device of claim 3 , wherein:
the peripheral interface protocol supports a flow control mode configured to vary a memory size and format of the data link packets; and
the replay logic circuit is further configured to:
determine that the flow control mode is active;
determine the fill level of the replay buffer memory based on the memory size and format of the data link packets in the flow control mode; and
dynamically determine the adaptive threshold based on the flow control mode.
5 . The device of claim 1 , wherein the replay logic circuit is further configured to, responsive to each detection of a data link packet in error, recalculate the adaptive threshold based on a current set of link operating parameters to dynamically determine the adaptive threshold for that data link packet in error.
6 . The device of claim 1 , wherein the replay logic circuit is further configured to dynamically determine the adaptive threshold by processing the set of link operating parameters through a statistical model comprised of the set of link operating parameters and corresponding weighting factors configured to balance a likelihood of successfully recovering the data link packet in error with data link layer latency.
7 . The device of claim 1 , wherein the set of link operating parameters comprises at least one link connection parameter selected from:
current link speed;
number of lanes; and
bit error rate for the current link speed and number of lanes.
8 . The device of claim 1 , wherein the set of link operating parameters comprises at least one link workload parameter selected from:
a current data link packet workload volume;
a host system historical workload volume; and
a predictive workload volume.
9 . The device of claim 1 , wherein:
the peripheral interface protocol supports a skip ordered set mode configured to periodically resynchronize the data link layer by introducing idle time between fixed periods of transaction layer packet processing;
the link set of operating parameters comprises a counter for the fixed periods of transaction layer packet processing; and
responsive to the skip ordered set mode, dynamically determining the adaptive threshold includes compensation for predicted idle time based on the counter.
10 . The device of claim 1 , wherein the device is a data storage device further comprising:
a non-volatile storage medium configured to store data for the host system; and
a peripheral interface connector configured to connect to a peripheral interface bus for storage communication with the host system using the peripheral interface protocol.
11 . A computer-implemented method, comprising:
receiving, by a peripheral interface circuit, data link packets from a host system through a peripheral interface using a peripheral interface protocol;
determining, by the peripheral interface circuit, an error in a data link packet received through the peripheral interface;
dynamically determining, by the peripheral interface circuit, an adaptive threshold for selecting a replay mode based on a set of link operating parameters;
selecting, by the peripheral interface circuit and based on comparing a fill level of a replay buffer memory to the adaptive threshold, a replay mode selected from:
a selective replay mode for requesting retransmission of only the data link packet in error; and
a sequential replay mode for requesting retransmission of the data link packet in error and subsequent data link packets sent after the data link packet in error; and
sending, by the peripheral interface circuit and based on the selected replay mode, a replay request to the host system.
12 . The computer-implemented method of claim 11 , further comprising:
responsive to the selective replay mode:
storing, by the peripheral interface circuit and in the replay buffer memory, sequential data link packets without errors received after the data link packet in error;
sequentially sending, by the peripheral interface circuit and responsive to receiving an error-free version of the data link packet in error from the host system, transaction layer content from the error-free version of the data link packet in error and the sequential data link packets without errors in the replay buffer memory; and
clearing, by the peripheral interface circuit, the sequential data link packets without errors from the replay buffer memory; and
responsive to the sequential replay mode:
discarding, by the peripheral interface circuit, sequential data link packets received after the data link packet in error; and
sequentially sending, by the peripheral interface circuit and responsive to receiving the error-free version of the data link packet in error and resent sequential data link packets received after the error-free version of the data link packet in error, transaction layer content from the error-free version of the data link packet in error and the resent sequential data link packets.
13 . The computer-implemented method of claim 11 , further comprising:
periodically determining, by the peripheral interface circuit, the adaptive threshold from a plurality of maximum fill levels based on the set of link operating parameters, wherein:
the replay buffer memory has a buffer size corresponding to a total number of data link packets that can be stored in the replay buffer memory at a time;
the fill level corresponds to a current number of data link packets stored in the replay buffer memory for pending selective replay requests; and
the adaptive threshold corresponds to a maximum fill level that is less than the buffer size of the replay buffer memory.
14 . The computer-implemented method of claim 13 , further comprising:
determining, by the peripheral interface circuit, that a flow control mode is active, wherein the peripheral interface protocol supports the flow control mode configured to vary a memory size and format of the data link packets;
determining, by the peripheral interface circuit, the fill level of the replay buffer memory based on the memory size and format of the data link packets in the flow control mode; and
dynamically determining, by the peripheral interface circuit, the adaptive threshold based on the flow control mode.
15 . The computer-implemented method of claim 11 , further comprising, responsive to each detection of a data link packet in error:
recalculating, by the peripheral interface circuit, the adaptive threshold based on a current set of link operating parameters to dynamically determine the adaptive threshold for that data link packet in error.
16 . The computer-implemented method of claim 11 , further comprising:
processing, by the peripheral interface circuit, the set of link operating parameters through a statistical model comprised of the set of link operating parameters and corresponding weighting factors configured to balance a likelihood of successfully recovering the data link packet in error with data link layer latency.
17 . The computer-implemented method of claim 11 , wherein the set of link operating parameters comprises at least one link connection parameter selected from:
current link speed;
number of lanes; and
bit error rate for the current link speed and number of lanes.
18 . The computer-implemented method of claim 11 , wherein the set of link operating parameters comprises at least one link workload parameter selected from:
a current data link packet workload volume;
a host system historical workload volume; and
a predictive workload volume.
19 . The computer-implemented method of claim 11 , wherein:
the peripheral interface protocol supports a skip ordered set mode configured to periodically resynchronize a data link layer by introducing idle time between fixed periods of transaction layer packet processing;
the link set of operating parameters comprises a counter for the fixed periods of transaction layer packet processing; and
responsive to the skip ordered set mode, dynamically determining the adaptive threshold includes compensation for predicted idle time based on the counter.
20 . A peripheral interface circuit comprising:
at least one processor;
a memory;
a data link layer configured to receive data link packets from a host system;
a replay buffer memory configured to store received data link packets following a packet in error to support a selective replay mode;
means, stored in the memory for execution by the at least one processor, for determining an error in a data link packet received from the host system;
means, stored in the memory for execution by the at least one processor, for dynamically determining an adaptive threshold for selecting a replay mode based on a set of link operating parameters;
means, stored in the memory for execution by the at least one processor, for selecting, based on comparing a fill level of the replay buffer memory to the adaptive threshold, a replay mode selected from:
the selective replay mode for requesting retransmission of only the data link packet in error; and
a sequential replay mode for requesting retransmission of the data link packet in error and subsequent data link packets sent after the data link packet in error; and
means, stored in the memory for execution by the at least one processor, for sending, based on the selected replay mode, a replay request to the host system.