diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-03-11 22:14:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-16 15:51:19 -0400 |
commit | f1c1775ac7e61950225925c949045406ffcb43de (patch) | |
tree | dff2fc348c566df3c18f023043fd308bb75662f7 /drivers/net/bonding/bonding.h | |
parent | c888385a0d61c4c6923ecc3b9dacfe8a1d8cb222 (diff) |
bonding: register slave pointer for rx_handler
Register slave pointer as rx_handler data. That would eventually prevent
need to loop over slave devices to find the right slave.
Use synchronize_net to ensure that bond_handle_frame does not get slave
structure freed when working with that.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Reviewed-by: Nicolas de Pesloüan <nicolas.2p.debian@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index c4e2343bb0b7..ff9af31e8c5b 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -266,6 +266,9 @@ struct bonding { | |||
266 | #endif /* CONFIG_DEBUG_FS */ | 266 | #endif /* CONFIG_DEBUG_FS */ |
267 | }; | 267 | }; |
268 | 268 | ||
269 | #define bond_slave_get_rcu(dev) \ | ||
270 | ((struct slave *) rcu_dereference(dev->rx_handler_data)) | ||
271 | |||
269 | /** | 272 | /** |
270 | * Returns NULL if the net_device does not belong to any of the bond's slaves | 273 | * Returns NULL if the net_device does not belong to any of the bond's slaves |
271 | * | 274 | * |