If I am not mistaken, the equality of the $p$-Selmer rank and the free rank of an elliptic curve are conjectured to be equal.
This is one of the many implications of the Birch and Swinnerton-Dyer conjecture.


I want to ask, and excuse me if this is "stupid": Is it enough to show the equality of the ranks for a certain set of primes $p$ to prove the validity of the Tate-Shafarevich conjecture for a given elliptic curve or does one have to prove it for all primes $p$?



Selmer and free rank of Elliptic Curves
You first statement is correct, both ranks are expected to be equal. In particular we have:


$$\mathrm{rank}\,\,\mathrm{Sel}\_p(E/K)=\mathrm{rank}(E/K)+\mathrm{rank}\,\,Ш(E/K)[p^\infty]$$


So if either $Ш$ or its $p$-primary part are finite, then the equality holds. And conversely, the equality *for any prime* implies the Tate-Shafarevich conjecture.


But none of this implies the Birch and Swinnerton-Dyer conjecture, although it is all closely related (see for example the partity (and p-parity) conjectures).


The $p$-Selmer rank is the more accessible tool which allows us to bound the rank, as for example in the recent breakthrough of Bhargava and Shankar. But notice that they don't prove new cases of BSD, they quantify the ones known from Gross-Zagier-Kolyvagin-Breuil-Conrad-Taylor-Wiles ($\leq 1$).


