aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2011-03-11 22:14:35 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 15:51:19 -0400
commitf1c1775ac7e61950225925c949045406ffcb43de (patch)
treedff2fc348c566df3c18f023043fd308bb75662f7 /drivers/net/bonding/bonding.h
parentc888385a0d61c4c6923ecc3b9dacfe8a1d8cb222 (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.h3
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 *