hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/tipc/bearer.h
....@@ -93,7 +93,8 @@
9393 * @raw2addr: convert from raw addr format to media addr format
9494 * @priority: default link (and bearer) priority
9595 * @tolerance: default time (in ms) before declaring link failure
96
- * @window: default window (in packets) before declaring link congestion
96
+ * @min_win: minimum window (in packets) before declaring link congestion
97
+ * @max_win: maximum window (in packets) before declaring link congestion
9798 * @mtu: max packet size bearer can support for media type not dependent on
9899 * underlying device MTU
99100 * @type_id: TIPC media identifier
....@@ -119,7 +120,8 @@
119120 char *raw);
120121 u32 priority;
121122 u32 tolerance;
122
- u32 window;
123
+ u32 min_win;
124
+ u32 max_win;
123125 u32 mtu;
124126 u32 type_id;
125127 u32 hwaddr_len;
....@@ -137,12 +139,15 @@
137139 * @pt: packet type for bearer
138140 * @rcu: rcu struct for tipc_bearer
139141 * @priority: default link priority for bearer
140
- * @window: default window size for bearer
142
+ * @min_win: minimum window (in packets) before declaring link congestion
143
+ * @max_win: maximum window (in packets) before declaring link congestion
141144 * @tolerance: default link tolerance for bearer
142145 * @domain: network domain to which links can be established
143146 * @identity: array index of this bearer within TIPC bearer array
144
- * @link_req: ptr to (optional) structure making periodic link setup requests
147
+ * @disc: ptr to link setup request
145148 * @net_plane: network plane ('A' through 'H') currently associated with bearer
149
+ * @up: bearer up flag (bit 0)
150
+ * @refcnt: tipc_bearer reference counter
146151 *
147152 * Note: media-specific code is responsible for initialization of the fields
148153 * indicated below when a bearer is enabled; TIPC's generic bearer code takes
....@@ -158,13 +163,15 @@
158163 struct packet_type pt;
159164 struct rcu_head rcu;
160165 u32 priority;
161
- u32 window;
166
+ u32 min_win;
167
+ u32 max_win;
162168 u32 tolerance;
163169 u32 domain;
164170 u32 identity;
165171 struct tipc_discoverer *disc;
166172 char net_plane;
167173 unsigned long up;
174
+ refcount_t refcnt;
168175 };
169176
170177 struct tipc_bearer_names {
....@@ -207,9 +214,11 @@
207214
208215 int tipc_media_set_priority(const char *name, u32 new_value);
209216 int tipc_media_set_window(const char *name, u32 new_value);
210
-void tipc_media_addr_printf(char *buf, int len, struct tipc_media_addr *a);
217
+int tipc_media_addr_printf(char *buf, int len, struct tipc_media_addr *a);
211218 int tipc_enable_l2_media(struct net *net, struct tipc_bearer *b,
212219 struct nlattr *attrs[]);
220
+bool tipc_bearer_hold(struct tipc_bearer *b);
221
+void tipc_bearer_put(struct tipc_bearer *b);
213222 void tipc_disable_l2_media(struct tipc_bearer *b);
214223 int tipc_l2_send_msg(struct net *net, struct sk_buff *buf,
215224 struct tipc_bearer *b, struct tipc_media_addr *dest);
....@@ -229,9 +238,20 @@
229238 struct tipc_media_addr *dest);
230239 void tipc_bearer_xmit(struct net *net, u32 bearer_id,
231240 struct sk_buff_head *xmitq,
232
- struct tipc_media_addr *dst);
241
+ struct tipc_media_addr *dst,
242
+ struct tipc_node *__dnode);
233243 void tipc_bearer_bc_xmit(struct net *net, u32 bearer_id,
234244 struct sk_buff_head *xmitq);
245
+void tipc_clone_to_loopback(struct net *net, struct sk_buff_head *pkts);
246
+int tipc_attach_loopback(struct net *net);
247
+void tipc_detach_loopback(struct net *net);
248
+
249
+static inline void tipc_loopback_trace(struct net *net,
250
+ struct sk_buff_head *pkts)
251
+{
252
+ if (unlikely(dev_nit_active(net->loopback_dev)))
253
+ tipc_clone_to_loopback(net, pkts);
254
+}
235255
236256 /* check if device MTU is too low for tipc headers */
237257 static inline bool tipc_mtu_bad(struct net_device *dev, unsigned int reserve)