netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Vosburgh <jay.vosburgh@canonical.com>
To: Andy Roulin <aroulin@cumulusnetworks.com>
Cc: netdev@vger.kernel.org, dsahern@gmail.com,
	nikolay@cumulusnetworks.com, roopa@cumulusnetworks.com,
	vfalico@gmail.com, andy@greyhouse.net,
	stephen@networkplumber.org
Subject: Re: [PATCH net-next v2] bonding: move 802.3ad port state flags to uapi
Date: Wed, 11 Dec 2019 14:47:41 -0800	[thread overview]
Message-ID: <15326.1576104461@famine> (raw)
In-Reply-To: <1576103458-22411-1-git-send-email-aroulin@cumulusnetworks.com>

Andy Roulin <aroulin@cumulusnetworks.com> wrote:

>The bond slave actor/partner operating state is exported as
>bitfield to userspace, which lacks a way to interpret it, e.g.,
>iproute2 only prints the state as a number:
>
>ad_actor_oper_port_state 15
>
>For userspace to interpret the bitfield, the bitfield definitions
>should be part of the uapi. The bitfield itself is defined in the
>802.3ad standard.
>
>This commit moves the 802.3ad bitfield definitions to uapi.
>
>Related iproute2 patches, soon to be posted upstream, use the new uapi
>headers to pretty-print bond slave state, e.g., with ip -d link show
>
>ad_actor_oper_port_state_str <active,short_timeout,aggregating,in_sync>
>
>Signed-off-by: Andy Roulin <aroulin@cumulusnetworks.com>
>Acked-by: Roopa Prabhu <roopa@cumulusnetworks.com>

Acked-by: Jay Vosburgh <jay.vosburgh@canonical.com>


>---
> drivers/net/bonding/bond_3ad.c  | 10 ----------
> include/uapi/linux/if_bonding.h | 10 ++++++++++
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index e3b25f310936..34bfe99641a3 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -31,16 +31,6 @@
> #define AD_CHURN_DETECTION_TIME    60
> #define AD_AGGREGATE_WAIT_TIME     2
> 
>-/* Port state definitions (43.4.2.2 in the 802.3ad standard) */
>-#define AD_STATE_LACP_ACTIVITY   0x1
>-#define AD_STATE_LACP_TIMEOUT    0x2
>-#define AD_STATE_AGGREGATION     0x4
>-#define AD_STATE_SYNCHRONIZATION 0x8
>-#define AD_STATE_COLLECTING      0x10
>-#define AD_STATE_DISTRIBUTING    0x20
>-#define AD_STATE_DEFAULTED       0x40
>-#define AD_STATE_EXPIRED         0x80
>-
> /* Port Variables definitions used by the State Machines (43.4.7 in the
>  * 802.3ad standard)
>  */
>diff --git a/include/uapi/linux/if_bonding.h b/include/uapi/linux/if_bonding.h
>index 790585f0e61b..6829213a54c5 100644
>--- a/include/uapi/linux/if_bonding.h
>+++ b/include/uapi/linux/if_bonding.h
>@@ -95,6 +95,16 @@
> #define BOND_XMIT_POLICY_ENCAP23	3 /* encapsulated layer 2+3 */
> #define BOND_XMIT_POLICY_ENCAP34	4 /* encapsulated layer 3+4 */
> 
>+/* 802.3ad port state definitions (43.4.2.2 in the 802.3ad standard) */
>+#define AD_STATE_LACP_ACTIVITY   0x1
>+#define AD_STATE_LACP_TIMEOUT    0x2
>+#define AD_STATE_AGGREGATION     0x4
>+#define AD_STATE_SYNCHRONIZATION 0x8
>+#define AD_STATE_COLLECTING      0x10
>+#define AD_STATE_DISTRIBUTING    0x20
>+#define AD_STATE_DEFAULTED       0x40
>+#define AD_STATE_EXPIRED         0x80
>+
> typedef struct ifbond {
> 	__s32 bond_mode;
> 	__s32 num_slaves;
>-- 
>2.20.1
>

  reply	other threads:[~2019-12-11 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 22:30 [PATCH net-next v2] bonding: move 802.3ad port state flags to uapi Andy Roulin
2019-12-11 22:47 ` Jay Vosburgh [this message]
2019-12-14 21:18 ` Jakub Kicinski
2019-12-16  3:10   ` David Ahern
2019-12-16  3:13     ` Andy Gospodarek
2019-12-16  3:52       ` Jay Vosburgh

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=15326.1576104461@famine \
    --to=jay.vosburgh@canonical.com \
    --cc=andy@greyhouse.net \
    --cc=aroulin@cumulusnetworks.com \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=stephen@networkplumber.org \
    --cc=vfalico@gmail.com \
    /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).