my rule of thumb:
mix everything down to a stereo two track,
just exactly the way i want to hear the final mix. should sound so good that it really doesn't need mastering.
except to attain level.
how you get there varies,
but ultimately, everything should route to your main outs, and THIS is what you export as a stereo file at least 24 bit and as high a sample rate as your system can handle.
then, use THIS stereo file to master.
a lot of modern DAWS can handle mixing inside a song and mastering at the same time,
but i never do this.
i always start a NEW session setup for strictly mastering.
if you are mastering a group of songs together (as you should if you are putting together an EP or cd) then you need to have all of these finished 2-track mixdowns lined up in running order, and mastered in relation to each other.
this is the heart of mastering.