When a loop occurs in a network topology, spanning tree can use the port priority value for the ports to decide which port must be put in forwarding state. The port priority is only used to determine the topology if the loop in the network cannot be resolved using bridge IDs or path cost.
If a higher priority (lower numerical value) is assigned to a port, STP uses forwarding first. When a lower priority (higher numerical value) is assigned to a port, STP uses forwarding last. If all ports have the same priority values, spanning tree puts the lowest numbered interface in forwarding state and blocks all other interfaces.
Valid interfaces include physical interfaces and port-channel logical interfaces (port-channel port-channel-number). Acceptable priority values range from 0 to 240, in increments of 16. The default is 128. Valid priority values are 0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, and 240. All other values are rejected. The lower the the number, the higher the priority.