Define ext{dp}[v] = maximum path sum starting at and going down into one of its subtrees (not both). Also track a global variable = best path sum found anywhere in the tree. At each node, update by considering the path that goes through that node using both subtrees.
Return ext{dp}[v] to the parent for its calculation. The returned value and the tracked answer serve different purposes.