Can two PCIe endpoints communicate with each other through PCIe switch?
PCIe is a packet switched network. The root complex provides access to system memory from the bus to facilitate DMA operations as well as providing a method for the CPU to initiate bus transactions. However, any device on a PCIe bus can initiate a transaction to any other device - the root complex does not have to be involved, except for setting up the address space on startup. The root complex generally contains a switch as well so that it can route PCIe traffic between its ports. Traffic between endpoints does not have to pass through the root complex if there is a shorter route through the switches. Extra switches can be added to provide more PCIe ports as the root complex can be a bit limited in terms of the number of ports it supports, and the root complex ports should be reserved for the highest bandwidth devices.