In addition to the local loopback available at the PMA, the 40G/50G PCS provides test pattern and remote loopback functions as illustrated in the following figure.
When enabled, the transmitted test pattern is continuous idle characters. The idle characters are scrambled.
Remote loopback (also called far-end loopback) is a mode where the GT receiver captures incoming serial data and routes it back to the transmitter, sending it back to the originating device. This is useful for validating link connectivity and debugging signal integrity. Refer to the GT User Guide (e.g., UltraScale Architecture GTY Transceivers User Guide (UG578) or equivalent for your device family). Look for sections on Loopback Modes.