Run DFS to compute tin[v] and tout[v] for all nodes.
Build array arr where arr[tin[v]] = value[v].
Build segment tree on arr supporting range sum and point update.
For subtree sum query on : query segment tree on range [tin[v], tout[v]].
For value update on : update segment tree at position tin[v]. Each query takes .
Space complexity is for the data structures used.