anlt module

Important

The APIs in this module are applicable only to Z800 Freya test modules.

Auto-Negotiation and Link Training (ANLT) provides functions to help you fine-tune the protocol to its optimal state, test interoperability between different vendors, and protocol compliance for different implementations.

anlt_link_recovery(port, restart_link_down, ...)

This command manages the auto-restart features.

anlt_log(port)

Get the anlt log messages

anlt_start(port, should_do_an, should_do_lt, ...)

Start ANLT on a port

anlt_status(port)

Get the overview of ANLT status

anlt_stop(port)

Stop AN & LT

autoneg_status(port)

Get the auto-negotiation status

lt_coeff_inc(port, serdes, emphasis)

Ask the remote port to increase coeff of the specified serdes.

lt_coeff_dec(port, serdes, emphasis)

Ask the remote port to decrease coeff of the specified serdes.

lt_encoding(port, serdes, encoding)

Ask the remote port to use the encoding of the specified serdes.

lt_preset(port, serdes, preset)

Ask the remote port to use the preset of the specified serdes.

lt_status(port, serdes)

Show the link training status.

lt_trained(port, serdes)

Tell the remote port that the current serdes is trained.

txtap_get(port, serdes)

Get the tap value of the local TX tap.

txtap_set(port, serdes, pre3, pre2, pre, ...)

Set the tap value of the local TX tap.

txtap_autotune(port, serdes)

Auto tune the tap value of the local TX tap.

lt_im_status(port)

Get LT initial modulation config

lt_algorithm_status(port)

Get LT initial modulation config

anlt_strict(port, enable)

Should ANLT strict mode be enabled

anlt_log_control(port, types)

Control what should be logged for ANLT by xenaserver

anlt_log_control_get(port)

Get ANLT log control config

Module Contents

The anlt high-level function module.

This command manages the auto-restart features.

Parameters:
  • port (Z800FreyaPort) – the port object

  • restart_link_down (bool) – enable AN+LT auto-restart when a link down condition is detected. A “link down” state signifies the loss of a valid input signal, which can occur due to events such as cable unplugging and re-plugging, TX disable, or link flap on the link partner’s end. The auto-restart process will continue until the link is re-established. Please note that this setting is only effective when AN and/or LT are enabled.

  • restart_lt_failure (bool) – if LT is enabled and experiences a failure on either side, the port will initiate the AN+LT restart process repeatedly until LT succeeds. This functionality is only applicable when LT is enabled.

Returns:

Return type:

None

async anlt_log(port)[source]

Get the anlt log messages

Parameters:

port (Z800FreyaPort) – the port object

Returns:

AN/LT protocol log traces of the port

Return type:

str

async anlt_start(port, should_do_an, should_do_lt, an_allow_loopback, lt_preset0, lt_initial_modulations, should_lt_interactive, lt_algorithm, should_enable_lt_timeout)[source]

Start ANLT on a port

Parameters:
  • port (Z800FreyaPort) – the port object

  • should_do_an (bool) – should the port do autoneg?

  • should_do_lt (bool) – should the port do link training?

  • an_allow_loopback (bool) – should the autoneg allow loopback?

  • lt_preset0 (enums.FreyaOutOfSyncPreset) – out-of-sync tap values (preset 0): existing or standard

  • lt_initial_modulations (Dict[str, enums.LinkTrainEncoding]) – the initial modulations of each serdes

  • should_lt_interactive (bool) – should perform link training manually?

  • lt_algorithm (Dict[str, enums.LinkTrainAlgorithm]) – Link training algorithm to use

  • should_enable_lt_timeout (bool) – should run link training with timeout?

async anlt_status(port)[source]

Get the overview of ANLT status

Parameters:

port (Z800FreyaPort) – the port object

Returns:

AN/LT status of the port

Return type:

Dict[str, Any]

async anlt_stop(port)[source]

Stop AN & LT

Parameters:

port (Z800FreyaPort) – the port object

async autoneg_status(port)[source]

Get the auto-negotiation status

Parameters:

port (Z800FreyaPort) – the port object

Returns:

Return type:

Dict[str, Any]

async lt_coeff_inc(port, serdes, emphasis)[source]

Ask the remote port to increase coeff of the specified serdes.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

  • emphasis (enums.LinkTrainCoeffs) – the emphasis to increase

Returns:

Return type:

None

async lt_coeff_dec(port, serdes, emphasis)[source]

Ask the remote port to decrease coeff of the specified serdes.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

  • emphasis (enums.LinkTrainCoeffs) – the emphasis to decrease

Returns:

Return type:

None

async lt_encoding(port, serdes, encoding)[source]

Ask the remote port to use the encoding of the specified serdes.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

  • encoding (enums.LinkTrainCoeffs) – link training encoding

Returns:

Return type:

None

async lt_preset(port, serdes, preset)[source]

Ask the remote port to use the preset of the specified serdes.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

  • preset (enums.LinkTrainPresets) – preset index to select for the serdes, 0,1,2,3,4,

Returns:

Return type:

None

async lt_status(port, serdes)[source]

Show the link training status.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

Returns:

LT status of the serdes

Return type:

Dict[str, Any]

async lt_trained(port, serdes)[source]

Tell the remote port that the current serdes is trained.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

Returns:

Return type:

None

async txtap_get(port, serdes)[source]

Get the tap value of the local TX tap.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

Returns:

tap values of the serdes

Return type:

Dict[str, int]

async txtap_set(port, serdes, pre3, pre2, pre, main, post)[source]

Set the tap value of the local TX tap.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

  • pre3 (int) – pre3 value

  • pre2 (int) – pre2 value

  • pre (int) – pre value

  • main (int) – main value

  • post (int) – post value

Returns:

Return type:

None

async txtap_autotune(port, serdes)[source]

Auto tune the tap value of the local TX tap.

Parameters:
  • port (Z800FreyaPort) – the port object

  • serdes (int) – the serdes index, starting from 0

Returns:

Return type:

None

async lt_im_status(port)[source]

Get LT initial modulation config

Parameters:

port (Z800FreyaPort) – the port object

Returns:

LT initial modulation configuration of the port

Return type:

Dict[str, Any]

async lt_algorithm_status(port)[source]

Get LT initial modulation config

Parameters:

port (Z800FreyaPort) – the port object

Returns:

LT initial modulation configuration of the port

Return type:

Dict[str, Any]

async anlt_strict(port, enable)[source]

Should ANLT strict mode be enabled

Parameters:
  • port (Z800FreyaPort) – the port object

  • enable (bool) – should ANLT strict mode be enabled

Returns:

Return type:

None

async anlt_log_control(port, types)[source]

Control what should be logged for ANLT by xenaserver

Parameters:
  • port (Z800FreyaPort) – the port object

  • types (List[enums.AnLtLogControl]) – control what should be logged for ANLT by xenaserver

Returns:

Return type:

None

async anlt_log_control_get(port)[source]

Get ANLT log control config

Parameters:

port (Z800FreyaPort) – the port object

Returns:

dict of log control status

Return type:

dict[str, bool]