A 21 gun salute is fired by cannons or artillery pieces and is reserved for a head of state. Lesser numbers are fired for foreign ministers, other cabinet members and flag officers.
What is fired at a military funeral is three volleys. Here is the description taken from the American Legional protocol manual for military funerals: "The firing party may include three to eight riflebearers, reflecting the American military custom of firing 'three volleys of musketry' over the graves of fallen comrades."
If there are seven members of the firing party, there will coincidentally be 21 rounds fired, but it is not a 21 gun salute.