diff options
| author | Alexander Duyck <alexanderduyck@fb.com> | 2025-11-21 08:40:31 -0800 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2025-11-27 10:41:31 +0100 |
| commit | 9963117a2b9b29074763ccb62fe8ee4d78ca46f2 (patch) | |
| tree | 57e305850e3e83ebaefabc0bf56245706adb5d6c /tools/testing/selftests/net/af_unix/unix_connreset.c | |
| parent | f18dd1b15f7a0bea5743fcbf3a62b7d2940e2dd5 (diff) | |
fbnic: Add logic to track PMD state via MAC/PCS signals
One complication with the design of our part is that the PMD doesn't
provide a direct signal to the host. Instead we have visibility to signals
that the PCS provides to the MAC that allow us to check the link state
through that.
We will need to account for several things in the PMD and firmware when
managing the link. Specifically when the link first starts to come up the
PMD will cause the link to flap. This is due to the firmware starting a
training cycle when the link is first detected. This will cause link
flapping if we were to immediately report link up when the PCS first
detects it.
To address that we are adding a pmd_state variable that is meant to be a
countdown of sorts indicating the state of the PMD. If the link is down or
has been reconfigured the PMD will start out in the initialize state. By
default the link is assumed to be in the SEND_DATA state if it is available
on initial link inspection. If link is detected while in the initialize
state the PMD state will switch to training, and if after 4 seconds the
link is still stable we will transition to link_ready, and finally the
send_data state. With this we can avoid link flapping when a cable is
first connected to the NIC.
One side effect of this is that we need to pull the link state away from
the PCS. For now we use a union of the PCS link state register value and
the pmd_state. The plan is to add a PMD register to report the pmd_state
to the phylink interface. With that we can then look at switching over to
the use of the XPCS driver for fbnic instead of having an internal one.
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://patch.msgid.link/176374323107.959489.14951134213387615059.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/testing/selftests/net/af_unix/unix_connreset.c')
0 files changed, 0 insertions, 0 deletions