The literal Greek for the Authorised Version says, "...authority of [over] all flesh, that all which thou hast given him..."
There's an interesting link to Matthew 28:18 where Jesus says, "All power is given unto me in heaven and in earth. Go ye therefore and teach all nations". It would be wrong to interchange 'all' with 'as many' in the Matthew instance. But in John 17:2 the meaning is clear; God gave Jesus authority over all flesh. Jesus will give eternal life to all whom the Father has given Him, which is not 'all flesh'. Some flesh will be saved whilst others will not. This is made clear further on in Jesus' prayer in John 17.
Jesus said He was not praying for the world, but for those God had given him, for they are God's. Those are the ones who believe Jesus and Jesus did not 'lose' any of them, except the son of perdition (Judas Iscariot), to fulfill Scripture. Jesus added that the world would hate His disciples. So there is a clear distinction made between all flesh (whom Jesus has authority over) and all His disciples (who believe Jesus). John 17:2 cannot be made to teach universal salvation. Verse 3 goes on to show that coming to know God, through Christ, is necessary for salvation. This is not talking about a head-trip but a heart-transplant. We do not have to attain a certain level of knowledge about God, but we must come to God through faith in Christ. This is about relationship, not knowledge (as some bad translations imply).
On the Day of Judgement, we will see Jesus exercise His authority over all flesh when the dead are resurrected. Some will be put to His right hand side, whilst others will be cast off. All those who are appointed unto salvation will be saved, but the many who chose the broad path leading to destruction will go off into destruction.