Skip to content

Commit f592006

Browse files
Daniele VenturinoJarno Rajahalme
authored andcommitted
lib/rstp: Use ovs_refcount_unref_relaxed.
Access to RSTP and RSTP port objects is protected by a mutex, so the refcount unref operation can have relaxed memory order semantics (See commit 24f8381). Signed-off by: Daniele Venturino <daniele.venturino@m3s.it> Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
1 parent 7ac97d7 commit f592006

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/rstp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void
168168
rstp_unref(struct rstp *rstp)
169169
OVS_EXCLUDED(rstp_mutex)
170170
{
171-
if (rstp && ovs_refcount_unref(&rstp->ref_cnt) == 1) {
171+
if (rstp && ovs_refcount_unref_relaxed(&rstp->ref_cnt) == 1) {
172172
ovs_mutex_lock(&rstp_mutex);
173173

174174
/* Each RSTP port points back to struct rstp without holding a
@@ -1080,7 +1080,7 @@ void
10801080
rstp_port_unref(struct rstp_port *rp)
10811081
OVS_EXCLUDED(rstp_mutex)
10821082
{
1083-
if (rp && ovs_refcount_unref(&rp->ref_cnt) == 1) {
1083+
if (rp && ovs_refcount_unref_relaxed(&rp->ref_cnt) == 1) {
10841084
struct rstp *rstp;
10851085

10861086
ovs_mutex_lock(&rstp_mutex);

0 commit comments

Comments
 (0)