aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bonding.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-02-04 19:14:29 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-04 19:14:29 -0500
commitce388fff3aa446d5a4895f8a757345f53daa200a (patch)
tree93990685d6fdba0784d68bf5ca0dbf523c930bb4 /include/net/bonding.h
parent251c005a6403933b3405fdc15fca4355e7590b42 (diff)
parentc6215745b66a7fbeeda1a826f94dd864a2ccf654 (diff)
Merge branch 'mlx4-next'
Or Gerlitz says: ==================== Add HA and LAG support to mlx4 RoCE and SRIOV services This series takes advanges of bonding mlx4 Ethernet devices to support a model of High-Availability and Link Aggregation for more environments. The mlx4 driver reacts on netdev events generated by bonding when slave state changes happen by programming a HW V2P (Virt-to-Phys) port table. Bonding was extended to expose these state changes through netdev events. When an mlx4 interface such as the mlx4 IB/RoCE driver is subject to this policy, QPs are created over virtual ports which are mapped to one of the two physical ports. When a failure happens, the re-programming of the V2P table allows traffic to keep flowing. The mlx4 Ethernet driver interfaces are not subject to this policy and act as usual. A 2nd use-case for this model would be to add HA and Link Aggregation support to single ported mlx4 Ethernet VFs. In this case, the PF Ethernet intrfaces are bonded, all the VFs see single port devices (which is supported already today), and VF QPs are subject to V2P. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/bonding.h')
-rw-r--r--include/net/bonding.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 29f53eacac0a..4e17095ad46a 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -150,6 +150,12 @@ struct bond_parm_tbl {
150 int mode; 150 int mode;
151}; 151};
152 152
153struct netdev_notify_work {
154 struct delayed_work work;
155 struct slave *slave;
156 struct net_device *dev;
157};
158
153struct slave { 159struct slave {
154 struct net_device *dev; /* first - useful for panic debug */ 160 struct net_device *dev; /* first - useful for panic debug */
155 struct bonding *bond; /* our master */ 161 struct bonding *bond; /* our master */
@@ -243,6 +249,8 @@ struct bonding {
243#define bond_slave_get_rtnl(dev) \ 249#define bond_slave_get_rtnl(dev) \
244 ((struct slave *) rtnl_dereference(dev->rx_handler_data)) 250 ((struct slave *) rtnl_dereference(dev->rx_handler_data))
245 251
252void bond_queue_slave_event(struct slave *slave);
253
246struct bond_vlan_tag { 254struct bond_vlan_tag {
247 __be16 vlan_proto; 255 __be16 vlan_proto;
248 unsigned short vlan_id; 256 unsigned short vlan_id;
@@ -315,6 +323,7 @@ static inline void bond_set_active_slave(struct slave *slave)
315{ 323{
316 if (slave->backup) { 324 if (slave->backup) {
317 slave->backup = 0; 325 slave->backup = 0;
326 bond_queue_slave_event(slave);
318 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 327 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
319 } 328 }
320} 329}
@@ -323,6 +332,7 @@ static inline void bond_set_backup_slave(struct slave *slave)
323{ 332{
324 if (!slave->backup) { 333 if (!slave->backup) {
325 slave->backup = 1; 334 slave->backup = 1;
335 bond_queue_slave_event(slave);
326 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 336 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
327 } 337 }
328} 338}
@@ -336,6 +346,7 @@ static inline void bond_set_slave_state(struct slave *slave,
336 slave->backup = slave_state; 346 slave->backup = slave_state;
337 if (notify) { 347 if (notify) {
338 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC); 348 rtmsg_ifinfo(RTM_NEWLINK, slave->dev, 0, GFP_ATOMIC);
349 bond_queue_slave_event(slave);
339 slave->should_notify = 0; 350 slave->should_notify = 0;
340 } else { 351 } else {
341 if (slave->should_notify) 352 if (slave->should_notify)
@@ -490,6 +501,12 @@ static inline bool bond_is_slave_inactive(struct slave *slave)
490 return slave->inactive; 501 return slave->inactive;
491} 502}
492 503
504static inline void bond_set_slave_link_state(struct slave *slave, int state)
505{
506 slave->link = state;
507 bond_queue_slave_event(slave);
508}
509
493static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local) 510static inline __be32 bond_confirm_addr(struct net_device *dev, __be32 dst, __be32 local)
494{ 511{
495 struct in_device *in_dev; 512 struct in_device *in_dev;