hc
2024-05-10 ee930fffee469d076998274a2ca55e13dc1efb67
kernel/include/net/bond_3ad.h
....@@ -1,23 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms of the GNU General Public License as published by the Free
6
- * Software Foundation; either version 2 of the License, or (at your option)
7
- * any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, write to the Free Software Foundation, Inc., 59
16
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
- *
18
- * The full GNU General Public License is included in this distribution in the
19
- * file called LICENSE.
20
- *
214 */
225
236 #ifndef _NET_BOND_3AD_H
....@@ -31,8 +14,6 @@
3114 /* General definitions */
3215 #define PKT_TYPE_LACPDU cpu_to_be16(ETH_P_SLOW)
3316 #define AD_TIMER_INTERVAL 100 /*msec*/
34
-
35
-#define MULTICAST_LACPDU_ADDR {0x01, 0x80, 0xC2, 0x00, 0x00, 0x02}
3617
3718 #define AD_LACP_SLOW 0
3819 #define AD_LACP_FAST 1
....@@ -180,6 +161,19 @@
180161 #pragma pack(8)
181162 #endif
182163
164
+struct bond_3ad_stats {
165
+ atomic64_t lacpdu_rx;
166
+ atomic64_t lacpdu_tx;
167
+ atomic64_t lacpdu_unknown_rx;
168
+ atomic64_t lacpdu_illegal_rx;
169
+
170
+ atomic64_t marker_rx;
171
+ atomic64_t marker_tx;
172
+ atomic64_t marker_resp_rx;
173
+ atomic64_t marker_resp_tx;
174
+ atomic64_t marker_unknown_rx;
175
+};
176
+
183177 /* aggregator structure(43.4.5 in the 802.3ad standard) */
184178 typedef struct aggregator {
185179 struct mac_addr aggregator_mac_address;
....@@ -265,13 +259,15 @@
265259
266260 struct ad_bond_info {
267261 struct ad_system system; /* 802.3ad system structure */
268
- atomic_t agg_select_timer; /* Timer to select aggregator after all adapter's hand shakes */
262
+ struct bond_3ad_stats stats;
263
+ atomic_t agg_select_timer; /* Timer to select aggregator after all adapter's hand shakes */
269264 u16 aggregator_identifier;
270265 };
271266
272267 struct ad_slave_info {
273268 struct aggregator aggregator; /* 802.3ad aggregator structure */
274269 struct port port; /* 802.3ad port structure */
270
+ struct bond_3ad_stats stats;
275271 u16 id;
276272 };
277273
....@@ -307,5 +303,7 @@
307303 int bond_3ad_set_carrier(struct bonding *bond);
308304 void bond_3ad_update_lacp_rate(struct bonding *bond);
309305 void bond_3ad_update_ad_actor_settings(struct bonding *bond);
306
+int bond_3ad_stats_fill(struct sk_buff *skb, struct bond_3ad_stats *stats);
307
+size_t bond_3ad_stats_size(void);
310308 #endif /* _NET_BOND_3AD_H */
311309