There is a PMA register responsible for data polarity inversion that could be written through the APB interface on 10G PCS IP.
From Table A.26 of FPGA-TN-02245, look for rx_polinv and tx_polinv where in writing 1 on this register bit will trigger the polarity inversion: