lib/stp.c
/* Sets the priority of port 'p' to 'new_priority'.  Lower numerical values
 * are interpreted as higher priorities. */
Sets the priority of port 'p' to 'new_priority'.  Lower numerical values
are interpreted as higher priorities.
Sets the priority of port ' p ' to ' new_priority ' . Lower numerical values are interpreted as higher priorities .
void
stp_port_set_priority(struct stp_port *p, uint8_t new_priority)
{
    uint16_t new_port_id;
    ovs_mutex_lock(&mutex);
    new_port_id  = (p->port_id & 0xff) | (new_priority << 8);
    if (p->port_id != new_port_id) {
        struct stp *stp = p->stp;
        if (stp_is_designated_port(p)) {
            p->designated_port = new_port_id;
        }
        p->port_id = new_port_id;
        if (stp->bridge_id == p->designated_bridge
            && p->port_id < p->designated_port) {
            stp_become_designated_port(p);
            stp_port_state_selection(stp);
        }
    }
    ovs_mutex_unlock(&mutex);
}
void stp_port_set_priority ( struct stp_port * p , uint8_t new_priority ) { uint16_t new_port_id ; ovs_mutex_lock ( & mutex ) ; new_port_id = ( p -> port_id & 0xff ) | ( new_priority << 8 ) ; if ( p -> port_id != new_port_id ) { struct stp * stp = p -> stp ; if ( stp_is_designated_port ( p ) ) { p -> designated_port = new_port_id ; } p -> port_id = new_port_id ; if ( stp -> bridge_id == p -> designated_bridge && p -> port_id < p -> designated_port ) { stp_become_designated_port ( p ) ; stp_port_state_selection ( stp ) ; } } ovs_mutex_unlock ( & mutex ) ; }
Sets the priority of port 'p' to 'new_priority'.
Sets the priority of port ' p ' to ' new_priority ' .