The weekend's travel ban is sending shock waves through the immigrant community in Silicon Valley — and some are wondering if they should leave the U.S. altogether, one expert told CNBC.

"I had literally at least two or three dozen people contact me over the weekend asking me if they should just go back home — give it up," said Vivek Wadhwa, an engineering professor at Carnegie Mellon University's Silicon Valley campus.