hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/net/bonding.h
....@@ -38,6 +38,15 @@
3838 #define __long_aligned __attribute__((aligned((sizeof(long)))))
3939 #endif
4040
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
+
4150 #define BOND_MODE(bond) ((bond)->params.mode)
4251
4352 /* slave list primitives */
....@@ -77,6 +86,9 @@
7786 #define bond_for_each_slave_rcu(bond, pos, iter) \
7887 netdev_for_each_lower_private_rcu((bond)->dev, pos, iter)
7988
89
+#define BOND_XFRM_FEATURES (NETIF_F_HW_ESP | NETIF_F_HW_ESP_TX_CSUM | \
90
+ NETIF_F_GSO_ESP)
91
+
8092 #ifdef CONFIG_NET_POLL_CONTROLLER
8193 extern atomic_t netpoll_block_tx;
8294
....@@ -114,6 +126,7 @@
114126 int fail_over_mac;
115127 int updelay;
116128 int downdelay;
129
+ int peer_notif_delay;
117130 int lacp_fast;
118131 unsigned int min_links;
119132 int ad_select;
....@@ -178,13 +191,18 @@
178191 struct bond_up_slave {
179192 unsigned int count;
180193 struct rcu_head rcu;
181
- struct slave *arr[0];
194
+ struct slave *arr[];
182195 };
183196
184197 /*
185198 * Link pseudo-state only used internally by monitors
186199 */
187200 #define BOND_LINK_NOCHANGE -1
201
+
202
+struct bond_ipsec {
203
+ struct list_head list;
204
+ struct xfrm_state *xs;
205
+};
188206
189207 /*
190208 * Here are the locking policies for the two bonding locks:
....@@ -195,9 +213,9 @@
195213 struct slave __rcu *curr_active_slave;
196214 struct slave __rcu *current_arp_slave;
197215 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;
199218 bool force_primary;
200
- u32 nest_level;
201219 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
202220 int (*recv_probe)(const struct sk_buff *, struct bonding *,
203221 struct slave *);
....@@ -233,6 +251,11 @@
233251 struct dentry *debug_dir;
234252 #endif /* CONFIG_DEBUG_FS */
235253 struct rtnl_link_stats64 bond_stats;
254
+#ifdef CONFIG_XFRM_OFFLOAD
255
+ struct list_head ipsec_list;
256
+ /* protecting ipsec_list */
257
+ spinlock_t ipsec_lock;
258
+#endif /* CONFIG_XFRM_OFFLOAD */
236259 };
237260
238261 #define bond_slave_get_rcu(dev) \
....@@ -500,18 +523,17 @@
500523 }
501524
502525 #ifdef CONFIG_NET_POLL_CONTROLLER
503
-static inline void bond_netpoll_send_skb(const struct slave *slave,
526
+static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
504527 struct sk_buff *skb)
505528 {
506
- struct netpoll *np = slave->np;
507
-
508
- if (np)
509
- netpoll_send_skb(np, skb);
529
+ return netpoll_send_skb(slave->np, skb);
510530 }
511531 #else
512
-static inline void bond_netpoll_send_skb(const struct slave *slave,
532
+static inline netdev_tx_t bond_netpoll_send_skb(const struct slave *slave,
513533 struct sk_buff *skb)
514534 {
535
+ BUG();
536
+ return NETDEV_TX_OK;
515537 }
516538 #endif
517539
....@@ -605,7 +627,7 @@
605627 };
606628
607629 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);
630
+netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
609631 int bond_create(struct net *net, const char *name);
610632 int bond_create_sysfs(struct bond_net *net);
611633 void bond_destroy_sysfs(struct bond_net *net);
....@@ -741,10 +763,14 @@
741763 /* exported from bond_sysfs_slave.c */
742764 extern const struct sysfs_ops slave_sysfs_ops;
743765
744
-static inline void bond_tx_drop(struct net_device *dev, struct sk_buff *skb)
766
+/* exported from bond_3ad.c */
767
+extern const u8 lacpdu_mcast_addr[];
768
+
769
+static inline netdev_tx_t bond_tx_drop(struct net_device *dev, struct sk_buff *skb)
745770 {
746771 atomic_long_inc(&dev->tx_dropped);
747772 dev_kfree_skb_any(skb);
773
+ return NET_XMIT_DROP;
748774 }
749775
750776 #endif /* _NET_BONDING_H */