.. | .. |
---|
38 | 38 | #define __long_aligned __attribute__((aligned((sizeof(long))))) |
---|
39 | 39 | #endif |
---|
40 | 40 | |
---|
| 41 | +#define slave_info(bond_dev, slave_dev, fmt, ...) \ |
---|
| 42 | + netdev_info(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__) |
---|
| 43 | +#define slave_warn(bond_dev, slave_dev, fmt, ...) \ |
---|
| 44 | + netdev_warn(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__) |
---|
| 45 | +#define slave_dbg(bond_dev, slave_dev, fmt, ...) \ |
---|
| 46 | + netdev_dbg(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__) |
---|
| 47 | +#define slave_err(bond_dev, slave_dev, fmt, ...) \ |
---|
| 48 | + netdev_err(bond_dev, "(slave %s): " fmt, (slave_dev)->name, ##__VA_ARGS__) |
---|
| 49 | + |
---|
41 | 50 | #define BOND_MODE(bond) ((bond)->params.mode) |
---|
42 | 51 | |
---|
43 | 52 | /* slave list primitives */ |
---|
.. | .. |
---|
77 | 86 | #define bond_for_each_slave_rcu(bond, pos, iter) \ |
---|
78 | 87 | netdev_for_each_lower_private_rcu((bond)->dev, pos, iter) |
---|
79 | 88 | |
---|
| 89 | +#define BOND_XFRM_FEATURES (NETIF_F_HW_ESP | NETIF_F_HW_ESP_TX_CSUM | \ |
---|
| 90 | + NETIF_F_GSO_ESP) |
---|
| 91 | + |
---|
80 | 92 | #ifdef CONFIG_NET_POLL_CONTROLLER |
---|
81 | 93 | extern atomic_t netpoll_block_tx; |
---|
82 | 94 | |
---|
.. | .. |
---|
114 | 126 | int fail_over_mac; |
---|
115 | 127 | int updelay; |
---|
116 | 128 | int downdelay; |
---|
| 129 | + int peer_notif_delay; |
---|
117 | 130 | int lacp_fast; |
---|
118 | 131 | unsigned int min_links; |
---|
119 | 132 | int ad_select; |
---|
.. | .. |
---|
178 | 191 | struct bond_up_slave { |
---|
179 | 192 | unsigned int count; |
---|
180 | 193 | struct rcu_head rcu; |
---|
181 | | - struct slave *arr[0]; |
---|
| 194 | + struct slave *arr[]; |
---|
182 | 195 | }; |
---|
183 | 196 | |
---|
184 | 197 | /* |
---|
185 | 198 | * Link pseudo-state only used internally by monitors |
---|
186 | 199 | */ |
---|
187 | 200 | #define BOND_LINK_NOCHANGE -1 |
---|
| 201 | + |
---|
| 202 | +struct bond_ipsec { |
---|
| 203 | + struct list_head list; |
---|
| 204 | + struct xfrm_state *xs; |
---|
| 205 | +}; |
---|
188 | 206 | |
---|
189 | 207 | /* |
---|
190 | 208 | * Here are the locking policies for the two bonding locks: |
---|
.. | .. |
---|
195 | 213 | struct slave __rcu *curr_active_slave; |
---|
196 | 214 | struct slave __rcu *current_arp_slave; |
---|
197 | 215 | struct slave __rcu *primary_slave; |
---|
198 | | - struct bond_up_slave __rcu *slave_arr; /* Array of usable slaves */ |
---|
| 216 | + struct bond_up_slave __rcu *usable_slaves; |
---|
| 217 | + struct bond_up_slave __rcu *all_slaves; |
---|
199 | 218 | bool force_primary; |
---|
200 | | - u32 nest_level; |
---|
| 219 | + bool notifier_ctx; |
---|
201 | 220 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ |
---|
202 | 221 | int (*recv_probe)(const struct sk_buff *, struct bonding *, |
---|
203 | 222 | struct slave *); |
---|
.. | .. |
---|
233 | 252 | struct dentry *debug_dir; |
---|
234 | 253 | #endif /* CONFIG_DEBUG_FS */ |
---|
235 | 254 | struct rtnl_link_stats64 bond_stats; |
---|
| 255 | +#ifdef CONFIG_XFRM_OFFLOAD |
---|
| 256 | + struct list_head ipsec_list; |
---|
| 257 | + /* protecting ipsec_list */ |
---|
| 258 | + spinlock_t ipsec_lock; |
---|
| 259 | +#endif /* CONFIG_XFRM_OFFLOAD */ |
---|
236 | 260 | }; |
---|
237 | 261 | |
---|
238 | 262 | #define bond_slave_get_rcu(dev) \ |
---|
.. | .. |
---|
500 | 524 | } |
---|
501 | 525 | |
---|
502 | 526 | #ifdef CONFIG_NET_POLL_CONTROLLER |
---|
503 | | -static inline void bond_netpoll_send_skb(const struct slave *slave, |
---|
| 527 | +static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave, |
---|
504 | 528 | struct sk_buff *skb) |
---|
505 | 529 | { |
---|
506 | | - struct netpoll *np = slave->np; |
---|
507 | | - |
---|
508 | | - if (np) |
---|
509 | | - netpoll_send_skb(np, skb); |
---|
| 530 | + return netpoll_send_skb(slave->np, skb); |
---|
510 | 531 | } |
---|
511 | 532 | #else |
---|
512 | | -static inline void bond_netpoll_send_skb(const struct slave *slave, |
---|
| 533 | +static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave, |
---|
513 | 534 | struct sk_buff *skb) |
---|
514 | 535 | { |
---|
| 536 | + BUG(); |
---|
| 537 | + return NETDEV_TX_OK; |
---|
515 | 538 | } |
---|
516 | 539 | #endif |
---|
517 | 540 | |
---|
.. | .. |
---|
605 | 628 | }; |
---|
606 | 629 | |
---|
607 | 630 | int bond_arp_rcv(const struct sk_buff *skb, struct bonding *bond, struct slave *slave); |
---|
608 | | -void bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); |
---|
| 631 | +netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); |
---|
609 | 632 | int bond_create(struct net *net, const char *name); |
---|
610 | 633 | int bond_create_sysfs(struct bond_net *net); |
---|
611 | 634 | void bond_destroy_sysfs(struct bond_net *net); |
---|
.. | .. |
---|
675 | 698 | } |
---|
676 | 699 | |
---|
677 | 700 | /* Caller must hold rcu_read_lock() for read */ |
---|
678 | | -static inline struct slave *bond_slave_has_mac_rcu(struct bonding *bond, |
---|
679 | | - const u8 *mac) |
---|
| 701 | +static inline bool bond_slave_has_mac_rcu(struct bonding *bond, const u8 *mac) |
---|
680 | 702 | { |
---|
681 | 703 | struct list_head *iter; |
---|
682 | 704 | struct slave *tmp; |
---|
683 | 705 | |
---|
684 | 706 | bond_for_each_slave_rcu(bond, tmp, iter) |
---|
685 | 707 | if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr)) |
---|
686 | | - return tmp; |
---|
687 | | - |
---|
688 | | - return NULL; |
---|
689 | | -} |
---|
690 | | - |
---|
691 | | -/* Caller must hold rcu_read_lock() for read */ |
---|
692 | | -static inline bool bond_slave_has_mac_rx(struct bonding *bond, const u8 *mac) |
---|
693 | | -{ |
---|
694 | | - struct list_head *iter; |
---|
695 | | - struct slave *tmp; |
---|
696 | | - struct netdev_hw_addr *ha; |
---|
697 | | - |
---|
698 | | - bond_for_each_slave_rcu(bond, tmp, iter) |
---|
699 | | - if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr)) |
---|
700 | 708 | return true; |
---|
701 | | - |
---|
702 | | - if (netdev_uc_empty(bond->dev)) |
---|
703 | | - return false; |
---|
704 | | - |
---|
705 | | - netdev_for_each_uc_addr(ha, bond->dev) |
---|
706 | | - if (ether_addr_equal_64bits(mac, ha->addr)) |
---|
707 | | - return true; |
---|
708 | | - |
---|
709 | 709 | return false; |
---|
710 | 710 | } |
---|
711 | 711 | |
---|
.. | .. |
---|
741 | 741 | /* exported from bond_sysfs_slave.c */ |
---|
742 | 742 | extern const struct sysfs_ops slave_sysfs_ops; |
---|
743 | 743 | |
---|
744 | | -static inline void bond_tx_drop(struct net_device *dev, struct sk_buff *skb) |
---|
| 744 | +/* exported from bond_3ad.c */ |
---|
| 745 | +extern const u8 lacpdu_mcast_addr[]; |
---|
| 746 | + |
---|
| 747 | +static inline netdev_tx_t bond_tx_drop(struct net_device *dev, struct sk_buff *skb) |
---|
745 | 748 | { |
---|
746 | 749 | atomic_long_inc(&dev->tx_dropped); |
---|
747 | 750 | dev_kfree_skb_any(skb); |
---|
| 751 | + return NET_XMIT_DROP; |
---|
748 | 752 | } |
---|
749 | 753 | |
---|
750 | 754 | #endif /* _NET_BONDING_H */ |
---|