From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ABC6FC43603 for ; Wed, 11 Dec 2019 22:47:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84DDA20836 for ; Wed, 11 Dec 2019 22:47:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbfLKWrr convert rfc822-to-8bit (ORCPT ); Wed, 11 Dec 2019 17:47:47 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:56546 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726463AbfLKWrr (ORCPT ); Wed, 11 Dec 2019 17:47:47 -0500 Received: from 1.general.jvosburgh.us.vpn ([10.172.68.206] helo=famine.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ifAlj-0005oS-B6; Wed, 11 Dec 2019 22:47:43 +0000 Received: by famine.localdomain (Postfix, from userid 1000) id A30DC6C567; Wed, 11 Dec 2019 14:47:41 -0800 (PST) Received: from famine (localhost [127.0.0.1]) by famine.localdomain (Postfix) with ESMTP id 9CEC0AC1CC; Wed, 11 Dec 2019 14:47:41 -0800 (PST) From: Jay Vosburgh To: Andy Roulin 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 In-reply-to: <1576103458-22411-1-git-send-email-aroulin@cumulusnetworks.com> References: <1576103458-22411-1-git-send-email-aroulin@cumulusnetworks.com> Comments: In-reply-to Andy Roulin message dated "Wed, 11 Dec 2019 14:30:58 -0800." X-Mailer: MH-E 8.6+git; nmh 1.6; GNU Emacs 27.0.50 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15325.1576104461.1@famine> Content-Transfer-Encoding: 8BIT Date: Wed, 11 Dec 2019 14:47:41 -0800 Message-ID: <15326.1576104461@famine> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Andy Roulin 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 > >Signed-off-by: Andy Roulin >Acked-by: Roopa Prabhu Acked-by: Jay Vosburgh >--- > 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 >