President Donald Trump announced an executive order banning incoming travelers from Iraq, Syria, Iran, Libya, Somalia, Sudan and Yemen, leaving 109 travelers detained at airports over the weekend. White House chief of staff Reince Priebus later clarified that the order " doesn't include green card holders going forward ."

"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.

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.

Still, with permanent residents temporarily affected by the travel ban, some tech workers are asking, "What if it could be me next?," said Wadhwa, author of "The Immigrant Exodus: Why America Is Losing the Global Race to Capture Entrepreneurial Talent."

Indeed, a draft obtained by Bloomberg indicated that skilled immigration reform could be the next target of the Trump administration. Wadhwa had previously told CNBC that some of Trump's changes might actually be good for curbing abuse of skilled visas.

"They've been waiting five, 10, 15 years for their green cards," Wadhwa told CNBC's "Closing Bell" on Monday. "And now, is it worth it? Even if they get their green card, what if Trump decides he doesn't like Hindus anymore? .... Or he doesn't like people from Pakistan?"

The Trump administration has defended the ban, noting that it "temporarily inconvenienced for the safety of us all." But Wadhwa said it is scaring away talented engineers from America's technology companies and "making America look like a banana republic."

Technology companies across the country said they did not support the travel ban, and the mood is dark across the California tech sector, Wadhwa said.

"It's a threat to their business and their employees are terrified," Wadhwa said. "A lot of people here are on temporary visas. What happened this weekend was they realized, even if they are on a green card — a permanent resident visas — they could still be ejected from the United States."