There is a pretty heated discussion about the war in Vietnam, among other things, in the comments of this post by Ginny, so these observations by Jerry Pournelle should contribute some useful context:
Viet Nam was a US success because a great part of Soviet transport production including trucks and such was built in the USSR, transported at great expense to Viet Nam and destroyed by USAF. When North Viet Nam invaded the South in 1975 they had more armor than the Wehrmacht had at Kursk, and more trucks than Patton ever had in the Red Ball Express. This was all replacements for similar amounts of materiel destroyed in 1973 when the US at a cost of 663 US casualties aided ARVN in repulsing a 150,000 troop invasion — fewer than 40,000 ever got back home — bringing with it more tanks than the Wehrmacht had at Kursk and more trucks than Patton ever had — none of which ever got home.
Viet Nam helped convert the USSR into Bulgaria with missiles. They neglected their own infrastructure to send materiel to Viet Nam for us to destroy.
As Pournelle also writes in his post, Afghanistan was yet another war of attrition that finished them off. One important reason why the Soviets didn’t realize all that in time was that they lied to each other. If displeasing your superiors with reports about problems is risky, you simply report successes all the time. The West in turn didn’t notice what happened because our spies didn’t get to hear anything but the misinformation Soviet officials were feeding each other. That’s also why the victory in Vietnam didn’t feel like one for decades. While Iraq isn’t Vietnam (it can’t be repeated frequently enough), the example of the long-term success that the Vietnam turned out to be should serve to demonstrate the virtue of patience. Iraq will only turn into a defeat (in the long as well as the short run) in case of a premature troop withdrawal (but that is an issue for another post).