Officials ejected Greenlaw for the hit, which drew a 15-yard penalty for unnecessary roughness. Herbert briefly left the game before he was cleared to return after halftime.
"He's OK," Chargers head coach Brandon Staley told NBC.
The hit took place late in the second quarter quarter as Herbert scrambled. Fred Warner tackled Herbert from behind. Greenlaw was leaning in for a hit in front of Herbert and made direct contact to Herbert's head with the crown of his helmet as Herbert fell to the turf, sending Herbert's head twisting to the side.
Herbert stood up after the hit, apparently intent on staying in the game. Officials then consulted with each other before announcing the penalty and Greenlaw's ejection. Herbert eventually left for the sideline and was replaced by backup Chase Daniel for the final 30 seconds of the half.
Herbert remained on the sideline with his helmet off as the half played out and the Chargers carried a 16-10 lead into the break. He returned to lead the Chargers' first possession after halftime.
The 49ers eventually won, 22-16, shutting out the Chargers in the second half as Herbert finished 21-of-35 for 196 passing yards, one touchdown and one interception.
Should Greenlaw have been ejected?
NBC officiating analyst Terry McAulay reported that he spoke with the NFL's league office and that executive vice president of football operations Troy Vincent weighed in on the decision to eject Greenlaw.
"We heard from New York, and they determined — Troy Vincent determined — that the player lowered his head and made illegal forcible and flagrant contact to the head of an opponent," McAulay said.
McAulay disagreed with the decision to eject Greenlaw, arguing that he didn't believe that Greenlaw intentionally made contact with Herbert's head.
"For disqualification, you want to see a player doing something unnecessary, some attempt to punish the opponent," McAulay said. "I feel he's trying to lead with his shoulder — the changing elevation of the runner being tackled led to the forcible content to the head.
"You can argue that it's a foul. I just don't think it should be flagrant and disqualifying."
NBC's Melissa Stark reported that she spoke with 49ers head coach Kyle Shanahan about the decision. Per Stark, he understood the penalty but "used a whole lot of expletives" about the ejection.
"It kind of actually blew my mind," Shanahan said after the game, via KNBR's Jake Hutchinson. "I get how it is with penalties, because he did hit his helmet ... But I thought there had to be intent and something unnecessary.
"To lose Greenlaw for the whole game, that really shocked me."
Quarterback safety is always a point of emphasis in the NFL, and is increasingly so this season after Miami Dolphins quarterback Tua Tagovailoa was hospitalized in Week 4 after a second blow to his head in as many weeks against the Cincinnati Bengals.
Herbert was considered a runner on the play and lost the extra protections afforded a quarterback in the pocket. McAulay reports that the NFL told him that Herbert's status a quarterback wasn't a factor in the decision to eject Greenlaw.
"Any runner at that point would have been treated the same way," McAulay said, paraphrasing the NFL office.
Greenlaw's a fourth-year starter after joining the 49ers as a rookie in 2019. He entered Sunday's game second on the team with 58 tackles.