Real Madrid coach Carlo Ancelotti on Tuesday backed his Barcelona counterpart Xavi Hernandez to turn things around after a difficult spell.

The Spanish champions have struggled for form in recent weeks and sit fourth in La Liga after a 1-1 draw at Rayo Vallecano on Saturday.

Barcelona face a crucial Champions League group game against Porto later Tuesday, aiming to reach the knock-out rounds after two consecutive early eliminations.

Ancelotti said he had no advice to offer Xavi, whom he believes possesses the capability to get Madrid's bitter rivals back on track.

"Xavi, like me, knows football very well, and there is criticism," Ancelotti told reporters.

"Sometimes it can happen, but Xavi has the experience to manage all this.

"He knows the atmosphere (around Barca) and I think he has everything he needs to manage the situation." 

Group H leaders Barcelona can guarantee progress to the knock-out rounds with a win over Porto, who are second and level with them on nine points.

The Catalans are still without first choice goalkeeper Marc-Andre ter Stegen, who missed the Rayo draw with back pain.

Real Madrid have already qualified for the last 16 and lead Group C by five points ahead of Napoli.

Ancelotti's team host the Italians on Wednesday and a draw would guarantee them top spot.

Napoli replaced coach Rudi Garcia with Walter Mazzarri and he started his second stint at the club with a 2-1 win over Atalanta on Saturday.

"(Mazzarri) knows Italian football very well and he's a good friend," said Ancelotti, who coached Napoli himself between 2018-19.

"The change of coach gives them more motivation."