Skip to contentSkip to conversation

bonding: remove the no effect lock for bond_3ad_lacpdu_recv()

PATCH Superseded Ding Tianhong 2 participants 2 messages Aug 30, 2013

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 bonding: remove the no effect lock for bond_3ad_lacpdu_recv()

There is no pointer needed read lock protection, remove the unnecessary lock and improve performance for the 3ad recv path.

Cc Nikolay Aleksandrov <[email protected]>
---
 drivers/net/bonding/bond_3ad.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/bonding/bond_3ad.c +0 -2
index 7a3860f..c134f43 100644
@@ -2494,9 +2494,7 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
 	if (!lacpdu)
 		return ret;
 
-	read_lock(&bond->lock);
 	ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
-	read_unlock(&bond->lock);
 	return ret;
 }
 
Signature · 1 line
1.8.2.1
#1 lore raw
Quoted 2 lines · Ding Tianhong

There is no pointer needed read lock protection, remove the unnecessary lock and improve performance for the 3ad recv path.

Improve performance by how much? For example, by how much is service demand lower on a netperf TCP_STREAM or TCP_RR test through a bond. I suppose that applies not only to this specific patch to to the set as a whole.

rick jones

Quoted 22 lines
Cc Nikolay Aleksandrov <[email protected]>
---
  drivers/net/bonding/bond_3ad.c | 2 --
  1 file changed, 2 deletions(-)
drivers/net/bonding/bond_3ad.c +0 -2
index 7a3860f..c134f43 100644
@@ -2494,9 +2494,7 @@ int bond_3ad_lacpdu_recv(const struct sk_buff *skb, struct bonding *bond,
  	if (!lacpdu)
  		return ret;
 
-	read_lock(&bond->lock);
  	ret = bond_3ad_rx_indication(lacpdu, slave, skb->len);
-	read_unlock(&bond->lock);
  	return ret;
  }