Via stub resonance: how long can a via stub be?
A via stub is the part of the barrel the signal does not use. It resonates where it is a quarter wavelength long and cuts a notch in S21, and it adds loss and reflection well below that. Keep the notch well above your Nyquist frequency.
The quarter-wave rule, f = c / (4 L √εr), gives about 37 GHz for a 1 mm stub in FR-4 and about 18 GHz for 2 mm. Real notches come lower, because every plane the barrel passes and every pad loads it with capacitance. In a public 3D case with a 1.29 mm stub the rule says 28.5 GHz, and both a 3D field solver and Impedora's via model put the notch at 23 GHz.
At PCIe 5 speed, 16 GHz Nyquist, a top-to-inner-layer via on a 1.6 mm 6-layer board with a 1.13 mm stub loses 3.84 dB. Backdrilled to 0.2 mm it loses 0.20 dB. Shorter stubs come from routing on a layer nearer the far side, backdrilling, blind or buried vias, or a thinner board.