netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Wilder <wilder@us.ibm.com>
To: netdev@vger.kernel.org
Cc: jv@jvosburgh.net, wilder@us.ibm.com, pradeep@us.ibm.com,
	i.maximets@ovn.org, amorenoz@redhat.com, haliu@redhat.com,
	stephen@networkplumber.org, dsahern@gmail.com
Subject: [PATCH iproute2-next v7 0/1] iproute2-next: Extending bonding's arp_ip_target to include a list of vlan tags.
Date: Mon, 13 Oct 2025 16:57:39 -0700	[thread overview]
Message-ID: <20251013235827.1291202-1-wilder@us.ibm.com> (raw)

This change extends the "arp_ip_target" option format to allow for a list of
vlan tags to be included for each arp target. This new list of tags is optional
and may be omitted to preserve the current format and process of discovering
vlans.  The new logic preserves both forward and backward compatibility with
the kernel and iproute2 versions.

Changes since V6
As each member of the arp_ip_target array consists of
one "addr" key-value pair and one optional "vlan" array it was necessary to
make each arp_ip_target array entry a JSON object.  Here is the new output
(using jq to format).

       "arp_ip_target": [
          {
            "addr": "10.0.0.1",
            "vlan": [
              10,
              20
            ]
          },
          {
            "addr": "10.0.0.2",
            "vlan": [
              5
            ]
          }
        ],

Changes since V5
Thanks to Stephen Hemminger for help on these changes:
- Use array for vlans
- Removed use of packed and Capitalization
- fix incorrect use of color
- Removed temporary string buffer.
- make vlan print a function for likely future IPv6 usage.

Output for ip -d --json <bond-name> has been updated. Example:
"arp_ip_target":["addr":"10.0.0.1","vlan":[4080,4081,4082,4083,4084]],

- changes to error reporting in bond_vlan_tags_parse() for invalid vlan_ids.

Changes since V4
Changed unneeded print_color_string() to print_string(). Thanks Steve.

Change since V3:
1) Add __attribute__((packed)) to struct definition
   to ensure size calculation is correct for memcpy() and
   addattr_l().

Input: arp_ip_target 10.0.0.1[10/20],10.0.0.2[10/20])
Sample JSON output:
...
"arp_ip_target": [
 "10.0.0.1[10/20]",
 "10.0.0.2[10/20]"
],
...

Changes since V2: (bond_print_opt() only)
Based on suggestions from Stephen Hemminger.
1) Removed inline from bond_vlan_tags_parse().
2) Switched to print_color_string() from print_string()
3) Follow kernel style.
4) Fixed JSON output.


Changes since V1:
Updates to support ip link show <bonding-device>.

This change is dependent on this bonding driver patch set:
https://marc.info/?l=linux-netdev&m=175684731919992&w=2

Merge only after the above patch set has been merged.

Thank you for your time and reviews.

Signed-off-by: David Wilder <wilder@us.ibm.com>

David Wilder (1):
  iproute: Extend bonding's "arp_ip_target" parameter to add vlan tags.

 ip/iplink_bond.c | 149 ++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 123 insertions(+), 26 deletions(-)

-- 
2.50.1


             reply	other threads:[~2025-10-13 23:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-13 23:57 David Wilder [this message]
2025-10-13 23:57 ` [PATCH iproute2-next v7 1/1] iproute: Extend bonding's "arp_ip_target" parameter to add vlan tags David Wilder
2025-10-16 15:32   ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251013235827.1291202-1-wilder@us.ibm.com \
    --to=wilder@us.ibm.com \
    --cc=amorenoz@redhat.com \
    --cc=dsahern@gmail.com \
    --cc=haliu@redhat.com \
    --cc=i.maximets@ovn.org \
    --cc=jv@jvosburgh.net \
    --cc=netdev@vger.kernel.org \
    --cc=pradeep@us.ibm.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).