^^
Yeah, that would be enough I'd say. There are however some great day-tours from each of these cities that could warrant a longer stay, as there is much to see within both cities as well.
I spent something like 10 days in Hanoi which was way too much - I ended up sitting on the sidewalks drinking locally brewed beer most of the time instead.
I hope you'll have a great trip. Vietnam is really amazing.
Btw, I think we have a HCMC based forumer here (Jaroslaw) who might be able to answer any questions you might have.