hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/net/bonding/bond_sysfs.c
....@@ -1,22 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright(c) 2004-2005 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
6
- * Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful, but
10
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
- * for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along
15
- * with this program; if not, see <http://www.gnu.org/licenses/>.
16
- *
17
- * The full GNU General Public License is included in this distribution in the
18
- * file called LICENSE.
19
- *
204 */
215
226 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -342,6 +326,18 @@
342326 }
343327 static DEVICE_ATTR(updelay, 0644,
344328 bonding_show_updelay, bonding_sysfs_store_option);
329
+
330
+static ssize_t bonding_show_peer_notif_delay(struct device *d,
331
+ struct device_attribute *attr,
332
+ char *buf)
333
+{
334
+ struct bonding *bond = to_bond(d);
335
+
336
+ return sprintf(buf, "%d\n",
337
+ bond->params.peer_notif_delay * bond->params.miimon);
338
+}
339
+static DEVICE_ATTR(peer_notif_delay, 0644,
340
+ bonding_show_peer_notif_delay, bonding_sysfs_store_option);
345341
346342 /* Show the LACP interval. */
347343 static ssize_t bonding_show_lacp(struct device *d,
....@@ -734,6 +730,7 @@
734730 &dev_attr_arp_ip_target.attr,
735731 &dev_attr_downdelay.attr,
736732 &dev_attr_updelay.attr,
733
+ &dev_attr_peer_notif_delay.attr,
737734 &dev_attr_lacp_rate.attr,
738735 &dev_attr_ad_select.attr,
739736 &dev_attr_xmit_hash_policy.attr,