Thread (18 messages) 18 messages, 5 authors, 2025-08-08

RE: [PATCH net-next v4 6/7] bonding: Update to bond's sysfs and procfs for extended arp_ip_target format.

From: David Wilder <hidden>
Date: 2025-07-03 18:07:51



________________________________________
From: Jay Vosburgh <jv@jvosburgh.net>
Sent: Wednesday, July 2, 2025 11:32 AM
To: David Wilder
Cc: netdev@vger.kernel.org; pradeeps@linux.vnet.ibm.com; Pradeep Satyanarayana; i.maximets@ovn.org; Adrian Moreno Zapata; Hangbin Liu
Subject: [EXTERNAL] Re: [PATCH net-next v4 6/7] bonding: Update to bond's sysfs and procfs for extended arp_ip_target format.
David Wilder [off-list ref] wrote:
quoted
/sys/class/net/<bond>/bonding/arp_ip_target and
/proc/net/bonding/<bond> will display vlan tags if
they have been configured by the user
       I don't think we need to do any of this, the sysfs and proc APIs
to bonding should not be updated to support new functionality.  Netlink
and /sbin/ip must do the right thing, but the other APIs are more or
less frozen in the past.
ok, I can remove this patch from the set.
       -J
quoted
Signed-off-by: David Wilder <redacted>
---
drivers/net/bonding/bond_procfs.c | 5 ++++-
drivers/net/bonding/bond_sysfs.c  | 9 ++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 94e6fd7041ee..b07944396912 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -111,6 +111,7 @@ static void bond_info_show_master(struct seq_file *seq)

      /* ARP information */
      if (bond->params.arp_interval > 0) {
+              char pbuf[BOND_OPTION_STRING_MAX_SIZE];
              int printed = 0;

              seq_printf(seq, "ARP Polling Interval (ms): %d\n",
@@ -125,7 +126,9 @@ static void bond_info_show_master(struct seq_file *seq)
                              break;
                      if (printed)
                              seq_printf(seq, ",");
-                      seq_printf(seq, " %pI4", &bond->params.arp_targets[i].target_ip);
+                      bond_arp_target_to_string(&bond->params.arp_targets[i],
+                                                pbuf, sizeof(pbuf));
+                      seq_printf(seq, " %s", pbuf);
                      printed = 1;
              }
              seq_printf(seq, "\n");
quoted
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index d7c09e0a14dd..870e0d90b77c 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -286,13 +286,16 @@ static ssize_t bonding_show_arp_targets(struct device *d,
                                      struct device_attribute *attr,
                                      char *buf)
{
+      char pbuf[BOND_OPTION_STRING_MAX_SIZE];
      struct bonding *bond = to_bond(d);
      int i, res = 0;

      for (i = 0; i < BOND_MAX_ARP_TARGETS; i++) {
-              if (bond->params.arp_targets[i].target_ip)
-                      res += sysfs_emit_at(buf, res, "%pI4 ",
-                                           &bond->params.arp_targets[i].target_ip);
+              if (bond->params.arp_targets[i].target_ip) {
+                      bond_arp_target_to_string(&bond->params.arp_targets[i],
+                                                pbuf, sizeof(pbuf));
+                      res += sysfs_emit_at(buf, res, "%s ", pbuf);
+              }
      }
      if (res)
              buf[res-1] = '\n'; /* eat the leftover space */
--
2.43.5
---
       -Jay Vosburgh, jv@jvosburgh.net
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help