u64 timerval;
if (nla_put_u8(skb, IFLA_BRPORT_STATE, p->state) ||
- nla_put_u16(skb, IFLA_BRPORT_PRIORITY, p->priority) ||
+ nla_put_u16(skb, IFLA_BRPORT_PRIORITY, READ_ONCE(p->priority)) ||
nla_put_u32(skb, IFLA_BRPORT_COST, READ_ONCE(p->path_cost)) ||
nla_put_u8(skb, IFLA_BRPORT_MODE, mode) ||
nla_put_u8(skb, IFLA_BRPORT_GUARD, !!(p->flags & BR_BPDU_GUARD)) ||
WRITE_ONCE(p->designated_port, new_port_id);
p->port_id = new_port_id;
- p->priority = newprio;
+ WRITE_ONCE(p->priority, newprio);
if (!memcmp(&p->br->bridge_id, &p->designated_bridge, 8) &&
p->port_id < p->designated_port) {
br_become_designated_port(p);
static ssize_t show_priority(struct net_bridge_port *p, char *buf)
{
- return sysfs_emit(buf, "%d\n", p->priority);
+ return sysfs_emit(buf, "%d\n", READ_ONCE(p->priority));
}
static int store_priority(struct net_bridge_port *p, unsigned long v)