netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v3 0/2] pretty-print LACP slave state
@ 2019-12-31 12:15 Andy Roulin
  2019-12-31 12:15 ` [PATCH iproute2-next v3 1/2] include/uapi: update bonding kernel header Andy Roulin
  2019-12-31 12:15 ` [PATCH iproute2-next v3 2/2] iplink: bond: print lacp actor/partner oper states as strings Andy Roulin
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Roulin @ 2019-12-31 12:15 UTC (permalink / raw)
  To: netdev; +Cc: dsahern, nikolay, roopa, j.vosburgh, vfalico, andy, aroulin

Print the bond slave 802.3ad/LACP state in a human-readable way.
The LACP bond slave actor/partner state definitions are exported
to userspace in the kernel include/uapi.

rtnetlink sends the bond slave state to userspace, see
 - IFLA_BOND_SLAVE_AD_ACTOR_OPER_PORT_STATE; and
 - IFLA_BOND_SLAVE_AD_PARTNER_OPER_PORT_STATE

and these are only printed as numbers, e.g.,

ad_actor_oper_port_state 15

Add an additional output in ip link show that prints a string describing
the individual 3ad bit meanings.

ad_actor_oper_port_state_str <active,short_timeout,aggregating,in_sync>

JSON output is also supported, the field becomes a json array:

"ad_actor_oper_port_state_str":
	["active","short_timeout","aggregating","in_sync"]

These changes are dependent on a kernel change to uapi/ in net-next;
the following patches are the changes and are already in net-next:
[PATCH net-next v2] bonding: move 802.3ad port state flags to uapi
[PATCH net-next v2] bonding: rename AD_STATE_* to LACP_STATE_*

v2:
 - address patch format and comments

v3:
 - prefix state defines with LACP_*

Andy Roulin (2):
  include/uapi: update bonding kernel header
  iplink: bond: print 3ad actor/partner oper states as strings

 include/uapi/linux/if_bonding.h | 16 +++++++--------
 ip/iplink_bond_slave.c          | 36 +++++++++++++++++++++++++++++----
 2 files changed, 40 insertions(+), 12 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-01-02 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-31 12:15 [PATCH iproute2-next v3 0/2] pretty-print LACP slave state Andy Roulin
2019-12-31 12:15 ` [PATCH iproute2-next v3 1/2] include/uapi: update bonding kernel header Andy Roulin
2019-12-31 12:15 ` [PATCH iproute2-next v3 2/2] iplink: bond: print lacp actor/partner oper states as strings Andy Roulin
2020-01-02 17:56   ` David Ahern

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).