From patchwork Wed Feb 10 20:43:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 380689 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 239ABC433DB for ; Wed, 10 Feb 2021 20:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D40DD64E30 for ; Wed, 10 Feb 2021 20:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233326AbhBJUor (ORCPT ); Wed, 10 Feb 2021 15:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232936AbhBJUo0 (ORCPT ); Wed, 10 Feb 2021 15:44:26 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD32BC061786 for ; Wed, 10 Feb 2021 12:43:45 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id i8so6537163ejc.7 for ; Wed, 10 Feb 2021 12:43:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OeANL9KGfWTYkUvP2UaZNdk3ZWSmtbVkLQLdr1Sp3lk=; b=ZN32C28tGs5zIM1MFD9NBN3weL0pmKx91IhBo/7/8SjFdi3S04V2D1oQKsxDj3FmkI H16XmGAPrDpE1yaRho2+XZw2AHoo3rHkhTz/x2eN95v92uIzVF7mipTVvP9H2JKVVfDQ 2toc5Z8k2vwx7KZk36EfoXUnqgwslwCdxU0tdRXecApJ8Fcp4f0Ka+nRYfu8vmY38H3D UACCxe8UIyzh3GBKBhhSwdZ0nYXiOYYEbxRGbbl9fkdhZ7px9cuYAVU/NKWieBn226Nr XO6vfies+dNhC5SS/oD5gqMZc0/f4elV3N+sGFx4DLuOZexJFbH+K+TnqVnuhLBdNqcP 2u8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OeANL9KGfWTYkUvP2UaZNdk3ZWSmtbVkLQLdr1Sp3lk=; b=OXP13y0ruz3s93p7f2qCczVFZ/nnkH9sCFpl8Er90c0LpnuEfAHDE+/nSvfg+aCW6u k06r3yX0kbdUbnXgRdjkOxlGzq9vfuqLMyT9L/aoWf0IGe8iZvoZXFrkzZvei6O2QFWj 6loUOemW1tWtgO0rdqMPdkkN0z98Weo+gpb9yhwk7txmQM9qkUQchRLg+EKN+04cya5r gTQiXGtAefNVMONwgP0nPwaORInKXrWpfWF/Q1K0eyIMR7bwr9QTKjlV+6SM4DkQRURT uTvhZ8bvuUly/jEtNSEHvnCHrcDc4jz9yfCYGmSh1h0I3+X+upj6HU8S78MitmZpTsJK n7wA== X-Gm-Message-State: AOAM530eRrhyI03FvTH01avfEgDfu7+udqh/p/JSH57yScaVEzl4a6Cq vcqlaPBz/wW8EVXRSi3LOQsaFarAYAx2yLtZ9Dnb3Q== X-Google-Smtp-Source: ABdhPJyUu/rcDepjEFIc3DBkriar9KP1pU1WZ1XVlb4GCNj6ks3l5jja7SXTbMv9hq+46CephYdnlw== X-Received: by 2002:a17:906:43d7:: with SMTP id j23mr4736075ejn.519.1612989824273; Wed, 10 Feb 2021 12:43:44 -0800 (PST) Received: from debil.vdiclient.nvidia.com (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id l1sm2062655eje.12.2021.02.10.12.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 12:43:43 -0800 (PST) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, andy@greyhouse.net, j.vosburgh@gmail.com, vfalico@gmail.com, kuba@kernel.org, davem@davemloft.net, alexander.duyck@gmail.com, idosch@nvidia.com, Nikolay Aleksandrov Subject: [PATCH net-next v2 1/3] bonding: 3ad: add support for 200G speed Date: Wed, 10 Feb 2021 22:43:31 +0200 Message-Id: <20210210204333.729603-2-razor@blackwall.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210210204333.729603-1-razor@blackwall.org> References: <20210210204333.729603-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nikolay Aleksandrov In order to be able to use 3ad mode with 200G devices we need to extend the supported speeds. Signed-off-by: Nikolay Aleksandrov --- v2: no changes drivers/net/bonding/bond_3ad.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index aa001b16765a..390e877419f3 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -73,6 +73,7 @@ enum ad_link_speed_type { AD_LINK_SPEED_50000MBPS, AD_LINK_SPEED_56000MBPS, AD_LINK_SPEED_100000MBPS, + AD_LINK_SPEED_200000MBPS, }; /* compare MAC addresses */ @@ -245,6 +246,7 @@ static inline int __check_agg_selection_timer(struct port *port) * %AD_LINK_SPEED_50000MBPS * %AD_LINK_SPEED_56000MBPS * %AD_LINK_SPEED_100000MBPS + * %AD_LINK_SPEED_200000MBPS */ static u16 __get_link_speed(struct port *port) { @@ -312,6 +314,10 @@ static u16 __get_link_speed(struct port *port) speed = AD_LINK_SPEED_100000MBPS; break; + case SPEED_200000: + speed = AD_LINK_SPEED_200000MBPS; + break; + default: /* unknown speed value from ethtool. shouldn't happen */ if (slave->speed != SPEED_UNKNOWN) @@ -733,6 +739,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) case AD_LINK_SPEED_100000MBPS: bandwidth = nports * 100000; break; + case AD_LINK_SPEED_200000MBPS: + bandwidth = nports * 200000; + break; default: bandwidth = 0; /* to silence the compiler */ } From patchwork Wed Feb 10 20:43:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Aleksandrov X-Patchwork-Id: 380688 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 97CD6C4332D for ; Wed, 10 Feb 2021 20:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67CE464E26 for ; Wed, 10 Feb 2021 20:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233418AbhBJUpI (ORCPT ); Wed, 10 Feb 2021 15:45:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233353AbhBJUos (ORCPT ); Wed, 10 Feb 2021 15:44:48 -0500 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC440C06178A for ; Wed, 10 Feb 2021 12:43:47 -0800 (PST) Received: by mail-ed1-x52f.google.com with SMTP id s11so4623750edd.5 for ; Wed, 10 Feb 2021 12:43:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bAD7uqVBt9z/Yn17SCW6bFz5mIqxunvQE9EQMuF/uro=; b=Ui0+I1XqjlmzqGhKevVmLmTbtsIA6Ia2b7as0B0wendmBWiPO6IC8w87wXGtkP70GO el28+sUDxWV57jju4raX2UJfYiAN9+wD5b0gCyKfuwr5RoMi/YWkN3XD0Wi5ilVZX4Bp MMgNIpzGFJzIAWpbN12/EN2U/206jL6+Z4ijTdvnngTSSBR1DJS+vBO04tuqO/LypJII cwPry6dnSAfLXikjMpPjB27q1jfkoGG1qm0b9bY3Ll+W221vjGWs6G3/TuiwHhXRWmQi 2CgqdGYCLomdhoD7a9i8SDJE8+Avk/RhYb/GV0KF0e3G7TCQPtVTW8IPNnNhPlqjPvBv uadQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bAD7uqVBt9z/Yn17SCW6bFz5mIqxunvQE9EQMuF/uro=; b=DQuB40YLFgG5DNbIyuKQt4KTuRnbdsvwYajsemhd2y/tuRaqCQ/9kH5/NzkqeK5Nx7 2AI7Pu//IjohnZokuesk9v9tRDu+zrlNHpQTUoTOGsqfVjUlNzqvCb/UrFR0Sp4aYv/n Ow9M9lHU4S/keQWUOH10zgbM41aQQ5P+7TOfP8L9EbP+pmQfZ0wkgqpxMtiORCiz8taN 9sXsusd6ElJaICeQDthpO52o3PZFWUyIX94AO6Y7iyWh9YbL6omiq/Sk7cjJJUJkoaz9 NiCHI1TcxW1I1rALr62Fq1OTu03X6a2naMVt3zkrtL+8tnNPiHCtROj+PV6zhmZdF3Fs voNw== X-Gm-Message-State: AOAM5332c7x69oUaMQONzoGCBE+Vi76mi+LUNdlBVJWUWYEIQ0rkwXEr w+ghDNlh+O0FMyabcyw0Rtuw/V0cPEPP76ShnAtgcA== X-Google-Smtp-Source: ABdhPJwESpS9Ov7cD4cHYHYl5/B+/pSgPx/pkkpsibP6zLzO/ttMY8KCj1Jk09wrz9gTL5cE/91AMQ== X-Received: by 2002:aa7:d149:: with SMTP id r9mr5069247edo.38.1612989826272; Wed, 10 Feb 2021 12:43:46 -0800 (PST) Received: from debil.vdiclient.nvidia.com (84-238-136-197.ip.btc-net.bg. [84.238.136.197]) by smtp.gmail.com with ESMTPSA id l1sm2062655eje.12.2021.02.10.12.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 12:43:45 -0800 (PST) From: Nikolay Aleksandrov To: netdev@vger.kernel.org Cc: roopa@nvidia.com, andy@greyhouse.net, j.vosburgh@gmail.com, vfalico@gmail.com, kuba@kernel.org, davem@davemloft.net, alexander.duyck@gmail.com, idosch@nvidia.com, Nikolay Aleksandrov Subject: [PATCH net-next v2 3/3] bonding: 3ad: Print an error for unknown speeds Date: Wed, 10 Feb 2021 22:43:33 +0200 Message-Id: <20210210204333.729603-4-razor@blackwall.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210210204333.729603-1-razor@blackwall.org> References: <20210210204333.729603-1-razor@blackwall.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Ido Schimmel The bond driver needs to be patched to support new ethtool speeds. Currently it emits a single warning [1] when it encounters an unknown speed. As evident by the two previous patches, this is not explicit enough. Instead, promote it to an error. [1] bond10: (slave swp1): unknown ethtool speed (200000) for port 1 (set it to 0) v2: * Use pr_err_once() instead of WARN_ONCE() Signed-off-by: Ido Schimmel Signed-off-by: Nikolay Aleksandrov --- drivers/net/bonding/bond_3ad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 2e670f68626d..6908822d9773 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c @@ -327,10 +327,10 @@ static u16 __get_link_speed(struct port *port) default: /* unknown speed value from ethtool. shouldn't happen */ if (slave->speed != SPEED_UNKNOWN) - pr_warn_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n", - slave->bond->dev->name, - slave->dev->name, slave->speed, - port->actor_port_number); + pr_err_once("%s: (slave %s): unknown ethtool speed (%d) for port %d (set it to 0)\n", + slave->bond->dev->name, + slave->dev->name, slave->speed, + port->actor_port_number); speed = 0; break; }