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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS 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 A5CFCC43381 for ; Mon, 25 Mar 2019 18:10:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6FF402087C for ; Mon, 25 Mar 2019 18:10:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kHQRiZGW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729238AbfCYSKM (ORCPT ); Mon, 25 Mar 2019 14:10:12 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40041 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728912AbfCYSKM (ORCPT ); Mon, 25 Mar 2019 14:10:12 -0400 Received: by mail-wr1-f67.google.com with SMTP id t5so11263580wri.7 for ; Mon, 25 Mar 2019 11:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=eLhRbmqP1WrcXxcaRtshSdRE3u4bKxInKuNyHKmMoUc=; b=kHQRiZGWTVRqEIzULXW4RXRbvpL3mUJpcV3NAF/NAPB8C6+10tpxfsEar/BYt5L6R2 Io3JIkFET3/mQjn8T36CbLWqoQO73Az19dzGL6wEDu998b25xHLYs12nUk+24vVSVgB8 Cu26ECggkwyENrJ1ffw/qzoyjTJxp48Lky4pqJIQWNIzBlpXPNbGvWbaP4uabO6wpXZe 4vlTKFSjj5J2l/iWJsWiKDl64AF02J58xwChGh6k0n2k7xDrxfffq7SE6JHq7KnroxYc +SStCaEdHZuuDrG/+2f4LDE3MfFuvgRzk+0cEtCD4QoONFRaxIFkwQTGFFmEmBA9M8fa iqSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=eLhRbmqP1WrcXxcaRtshSdRE3u4bKxInKuNyHKmMoUc=; b=uV18lO1kLJ7b1Fb5RSLuYgnS9VPVJsGG0y64vx49CboBV2tYQOVAJgk84ZyjwnAMPy y9unV0sn+19YV0caU87UpsMa4Lvu7ZRbvPb6jwijO/bWtNNxyxFzD3w14zjl3Uqzm14l mWahAjufS1avu5OKl8oE1ctTNKHByjwkdW2FTzOesaYZsJwszA54VoKOzmz0i7SMF9J3 42j3NSlzlgSDxB6liWg1CdmrqzAvbTblmP5HKyFf+xhBHP24Ta4VsWpRJEhcE0BJZba2 ffjFtLdl0JVdI8fLCznIvllZMiv0Iv7KP8tV9jFkHnGQv3uDVCInF6xn7l3urqhRfx4A 9EOg== X-Gm-Message-State: APjAAAV5jcZG5FLKO83OdY96X+bkEiUPe388dQJT5Ky040PGILbPq/aK ZjTZ7ZTBNwY2NQBtSw5Fr2I/0EJh X-Google-Smtp-Source: APXvYqxk842H/Vm8S12c2wy+XTMdfkBbbhtF0D4Z/Xs+K1gB7Vz/TwpNt2RfW7zrZTjwXaPambhXLA== X-Received: by 2002:a5d:4f8b:: with SMTP id d11mr16041284wru.150.1553537409702; Mon, 25 Mar 2019 11:10:09 -0700 (PDT) Received: from ?IPv6:2003:ea:8bc4:dc00:79ce:2608:a3c3:1d6b? (p200300EA8BC4DC0079CE2608A3C31D6B.dip0.t-ipconnect.de. [2003:ea:8bc4:dc00:79ce:2608:a3c3:1d6b]) by smtp.googlemail.com with ESMTPSA id s2sm1985927wmc.7.2019.03.25.11.10.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 11:10:08 -0700 (PDT) Subject: Re: [PATCH net-next 1/2] ethtool: add PHY Fast Link Down support To: Michal Kubecek Cc: Andrew Lunn , Florian Fainelli , David Miller , "John W. Linville" , "netdev@vger.kernel.org" References: <506ae10e-5d93-f64e-a615-c320010a5529@gmail.com> <20190325174928.GF26076@unicorn.suse.cz> From: Heiner Kallweit Message-ID: Date: Mon, 25 Mar 2019 19:10:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190325174928.GF26076@unicorn.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 25.03.2019 18:49, Michal Kubecek wrote: > On Sun, Mar 24, 2019 at 04:02:43PM +0100, Heiner Kallweit wrote: >> This adds support for Fast Link Down as new PHY tunable. >> Fast Link Down reduces the time until a link down event is reported >> for 1000BaseT. According to the standard it's 750ms what is too long >> for several use cases. >> >> Signed-off-by: Heiner Kallweit >> --- >> include/uapi/linux/ethtool.h | 4 ++++ >> net/core/ethtool.c | 2 ++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h >> index 3652b239d..2c7136adc 100644 >> --- a/include/uapi/linux/ethtool.h >> +++ b/include/uapi/linux/ethtool.h >> @@ -252,9 +252,13 @@ struct ethtool_tunable { >> #define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff >> #define DOWNSHIFT_DEV_DISABLE 0 >> >> +#define ETHTOOL_PHY_FAST_LINK_DOWN_ON 0 >> +#define ETHTOOL_PHY_FAST_LINK_DOWN_OFF 0xff >> + >> enum phy_tunable_id { >> ETHTOOL_PHY_ID_UNSPEC, >> ETHTOOL_PHY_DOWNSHIFT, >> + ETHTOOL_PHY_FAST_LINK_DOWN, >> /* >> * Add your fresh new phy tunable attribute above and remember to update >> * phy_tunable_strings[] in net/core/ethtool.c > > It would be nice to have a short summary around here explaining how is > the value interpreted. While it's obvious from the second patch, one > shouldn't have to go into driver specific implementation to find out. > OK > I also wonder if the range 0-254 ms is sufficient. Would it be possible > that there is some other hardware which would support e.g. 300 ms? > The relevant use cases (according to the Marvell spec) require link down recognition in <50ms. Something >200ms I think wouldn't be considered as "fast" in general. And for something completely different, all mails to John are bounced currently: rejected because 209.85.128.65 is in a black list at 0spam.fusionzero.com Received: from mail-wm1-f65.google.com I tried from another email address, but same result. > Michal Kubecek > Heiner >> diff --git a/net/core/ethtool.c b/net/core/ethtool.c >> index b1eb32419..387d67eb7 100644 >> --- a/net/core/ethtool.c >> +++ b/net/core/ethtool.c >> @@ -136,6 +136,7 @@ static const char >> phy_tunable_strings[__ETHTOOL_PHY_TUNABLE_COUNT][ETH_GSTRING_LEN] = { >> [ETHTOOL_ID_UNSPEC] = "Unspec", >> [ETHTOOL_PHY_DOWNSHIFT] = "phy-downshift", >> + [ETHTOOL_PHY_FAST_LINK_DOWN] = "phy-fast-link-down", >> }; >> >> static int ethtool_get_features(struct net_device *dev, void __user *useraddr) >> @@ -2432,6 +2433,7 @@ static int ethtool_phy_tunable_valid(const struct ethtool_tunable *tuna) >> { >> switch (tuna->id) { >> case ETHTOOL_PHY_DOWNSHIFT: >> + case ETHTOOL_PHY_FAST_LINK_DOWN: >> if (tuna->len != sizeof(u8) || >> tuna->type_id != ETHTOOL_TUNABLE_U8) >> return -EINVAL; >> -- >> 2.21.0 >> >> >