40Gb ConnectX-3 can only reach about 5Gbps on Jetson AGX Xavier

Could you please attach the output of sudo lspci -vvvv ?

Please check the discussion and see if it is enumerated as x8:
Question about the PCIe adapter speed - #9 by vidyas