Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3530868imw; Mon, 18 Jul 2022 09:42:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tUg7EVJiswKy5wfOwGHdzqEybTU40lGw1vWcHa6WQdsyJ5WrNq3hzIOni9cQBtniFIgbK3 X-Received: by 2002:a17:906:794f:b0:72b:1346:85a3 with SMTP id l15-20020a170906794f00b0072b134685a3mr26081127ejo.259.1658162526969; Mon, 18 Jul 2022 09:42:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658162526; cv=pass; d=google.com; s=arc-20160816; b=cSvoZ7wribg08pyviPtJThwdztYXobWcUJGfz5bLRkwXD3lHqtmbrTLNkdtQCiRj9u KaBuZz2eypZvoOX59ThBIIxpFpzE/ZWCl7heqHsHsgCRuLqY+MemsBz5c6SlB420CRrH 6yqnNWWN6Et5Ht+dovBHwEYJBKPIDAt7j3QbY7aUqcbNb9u3n4XE4xSx7JMxQMjdegkA g/dButiASlTItNNTIIScBCLGQfR+vgUXxxbz7koyul4NLFqa90EBF3svajGc4J9V6EtV lu6r8ypvX3EWbLOsaRzEMzipktlngePUv5Sut0xqmaPT+AeJPG2fehQc4TJc7F2ogsk9 g+EA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=sSxk4yJrulyjlz72KdnbcoERE/D359KUvTgaxMSGGpE=; b=U8MFLn2ktxONSUhs3z6BVfqeDqD8vyWGwMS0FfvFNUCL5x22UjOQQvkQ8LZcRzAvuM +uHLpnggffcRwlZ/Ug6Mnr+1L8IgT81IeaBn236ryPjCKc5oYlijJgZFCYBupgtV9Vg+ va22/wRLTGO3IA6VCYN6fUggGIahpWxzuk13Dp2gX/xgrS+J+Bo8EnlS5I1aOb5QwfC4 937w+KdvhteGDAVbsh0FmVzcKwEsUrbEsOX7/pLnOy/0pSoD2xOPhWWTDx9NXzf301o+ VleVRBVSHWAF45jVIfcM6Kh0tcFhjTtB5p5+mo0lWq0wwUOOtbwsZ+oVoh+p0dMzg2He ozRg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=2y+4vrry; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i13-20020a170906264d00b006f4d14bbbb3si12993196ejc.150.2022.07.18.09.41.42; Mon, 18 Jul 2022 09:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@seco.com header.s=selector1 header.b=2y+4vrry; arc=pass (i=1 spf=pass spfdomain=seco.com dkim=pass dkdomain=seco.com dmarc=pass fromdomain=seco.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=seco.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235147AbiGRQjM (ORCPT + 99 others); Mon, 18 Jul 2022 12:39:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235280AbiGRQit (ORCPT ); Mon, 18 Jul 2022 12:38:49 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130053.outbound.protection.outlook.com [40.107.13.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CECA2B18A; Mon, 18 Jul 2022 09:38:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fcisCrPuGpQ3UhxNJNTxrxZNaZofwx+Etspl7GCdjwV1r0arP9Ec8jwkwXmFztl7YbWUEpfpUrEdktvyPhqsCaWvikw8GZ9J1D9Q73NivzJBF5T6kpcunkIjPBNYJgxyc5K4dRLOBv7gERybVnrMGsoV3kuAHHW7fDTt2PouEOp2V5jO3JbRqVtcca99pmBs0iHR9IyfvlSF5RI9mhQOMmSFhVubwVrNNNf5NCcfZaAmz6266sfltsCqjz88pVTq05iARIVm+hY7H5AFGNX+UuA5OCwvh9OakFX2CHF7SISeHTvcwL1qQ9KngxURp7YPO7SpY++33Mv2c+4S+ZTJcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sSxk4yJrulyjlz72KdnbcoERE/D359KUvTgaxMSGGpE=; b=J9QMkZ1A+D99d0grYwAlsBbEj+1dFG+uyuoXLV5LDA7vGaSzi67vuQMOGOAScdevUD5VZ0taoMJ1q8NCknRa/gUwbyHDSMvQvAUDQR0JEbrCOWxXdT+kqXiP7DNQREYcU0Qi7gOvB/2gD9tzfSUyPh7mIKSsgBlORUEZaR73J798Ki241YVIPB9gDY4VJb4+NkzKO3ITpoTq5IDxYd3u5yoeSNCTuk6/O2ldWXyj+kmQjIEcXT0ie98z1dLKjyDja+Ee2hgbCK3tqZPkJyvyD85fMeU7Xm88iEberdj/7YZBh9cXnjUdrI7uVjN9fapc/agpca7rrbs5dUKdinjvBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sSxk4yJrulyjlz72KdnbcoERE/D359KUvTgaxMSGGpE=; b=2y+4vrryrxnMC5lY7RkmfM/qPZJ0SnwB3GdrRWys6YGJOsh426N69DD+ciy2PibKAm6I5lwHnhtqqw0dhKzjziZFiKPh1AOicXRkulsYARPZzbGHFBQigCZbBT82vCYr0NQDnYZWoBGaGVXA/UvRJTug6g3kfd5FwBus1IggAy1rTj6iqtDkGVShGmlGes8mtJ+3ggVOACYSBqRis+x/vBcgZ2YkkllsJlL+DyGdBXiCziyZrHyt6Gjm0hnLv9tjKqdAWBpTfvoyauX2Pe4fMEP/e094sN/BvhnQ6HNUa3o/UsY5aBbj/2e7FBe2aTe2BT1vS+Ow0vcIqvan7ZIvZQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) by DB7PR03MB5097.eurprd03.prod.outlook.com (2603:10a6:10:33::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Mon, 18 Jul 2022 16:38:43 +0000 Received: from DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1]) by DB7PR03MB4972.eurprd03.prod.outlook.com ([fe80::757e:b75f:3449:45b1%6]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 16:38:43 +0000 Subject: Re: [PATCH net-next v3 08/47] net: phylink: Support differing link speeds and interface speeds To: "Russell King (Oracle)" , Andrew Lunn Cc: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org, Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandru Marginean , Heiner Kallweit , Vladimir Oltean References: <20220715215954.1449214-1-sean.anderson@seco.com> <20220715215954.1449214-9-sean.anderson@seco.com> From: Sean Anderson Message-ID: Date: Mon, 18 Jul 2022 12:38:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR05CA0025.namprd05.prod.outlook.com (2603:10b6:610::38) To DB7PR03MB4972.eurprd03.prod.outlook.com (2603:10a6:10:7d::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0cb81e4-7882-4b64-bf36-08da68dbfa32 X-MS-TrafficTypeDiagnostic: DB7PR03MB5097:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 43cAHl90F49MCmpfSzzoGS0gyj7agw1aIhRQoCtD4t++RVG7sp5Jdy8u5SEOMgJ8PvjKuOtse0ohvq4t33gSPDExslDQ3b54tbUXPTgd6jZeBcDD+IfILYtY2LKYURVHsU5ivLiradCOhm9aajNgVOwMoBS0Bv1mRDqSpSfRmRFCBhxwrOa7xXfQugHIyq6M+gjyAC3w4kEoGFiFTg+sqcI3Y5TBzWMnb3H1VAqtuxaIjQni7BcW97LiSYJLq0BXiPuYrtx/6FrYu0Sq+w6/XZ+gbCwDvqackFPEXPKnchOajQK1yt7JMlh5hQg+M+idfKQlH1l/BUFRyTIR8DR/9MIdfRx05UukSkb/5yVBx2/S6ZzKvaWYwmCFf3aYuqq07VumylwRc3MecPAcGvHcbEyhY5kHOanBZdA56eeCsxyjXnsnp2BKmCd97J+bzP49qutIYcYzvTOMrFasfSKL/TB6bNQu0gPf4IkB8pzNlwRUN+XNNEj7wej2lPYED+SplSJiMD9WFJ4/yEN8gXB1r1SDdb4eiKFQrdywuJ24Dl9H09MUGzdc7gBVczduRUqBKCv1iiZ4Gj9SWeg54baaF8wbvGpg+SQbXL0q8INe1y7sEa1hGN1Ec3LJ7kneSORlKHIYc6QnnB1anmCuLXwwHmRpSLRfiuG1dD3hsAtuIZDXjAUNkpHQkg4j0huHIkVUC8IXspIOQ0Y6ECLRQCD80lWOG6vofi92wTqiwkD2PloApUf+b5CpqlUEtXwoF48Utlq3QRR6NZBM+MFgBwMIvhvyMe8UHc2Tq80DcGpZTdrhwq8W4zPSzzrvQo9GUgn164hfL5ZCcgLLpx5zgsdT/sgupmJ+mU5y6u17zVB1k0vMuPiChgRCHqXMSKPApE4h X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB7PR03MB4972.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(136003)(39850400004)(346002)(366004)(396003)(66476007)(66556008)(66946007)(8676002)(4326008)(8936002)(86362001)(316002)(110136005)(54906003)(31696002)(7416002)(2906002)(31686004)(38350700002)(38100700002)(36756003)(5660300002)(83380400001)(478600001)(26005)(53546011)(41300700001)(6666004)(6506007)(52116002)(6486002)(6512007)(44832011)(2616005)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RTAyVUwreXQwVUJVcTZwUkZDTkMrRitwSnlvTFpVemR2TXdyZ1JETkVzazR2?= =?utf-8?B?Q29YeDl0SEo4bVhtOXJYRXRWQmo5TVRUOGRPZlBPbXpXUkZWMlhUeGFSdVFi?= =?utf-8?B?dlh3MUFGazBLWS9qVGJDUlI0dEdTQXU0cmxGSVNhaTdPQ0FVejh3UUI5ZlYr?= =?utf-8?B?a0RQYWs1SXE1dElSaG0wU3hGQWEvSVlrZzUzNUcwUVhwQmk1a1dTdDNKaFor?= =?utf-8?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mRnTkM4UUZFdGQycExiRG1J?= =?utf-8?B?bXpUYlpRTlJseHFtSWZaRW8vaFVINmtSY2p6WmhWRyswby9YM0NnZlVyMEVm?= =?utf-8?B?bTlGMVlDZGtPV2doWUQzZ1pKckxwdy9ZbjhSbDVUeVV2V1U2WkhjNFZiT0to?= =?utf-8?B?OXc9PQ==?= X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0cb81e4-7882-4b64-bf36-08da68dbfa32 X-MS-Exchange-CrossTenant-AuthSource: DB7PR03MB4972.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 16:38:43.2198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mYK1UzzTElTT3VzXz1ggOjoxrF2pv8wEq6ST06g0K6HOZnF2C0EOI1xb1mtJ19Shzujglbfg3bt5agmFIvZi6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR03MB5097 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/18/22 12:06 PM, Russell King (Oracle) wrote: > On Sat, Jul 16, 2022 at 10:06:01PM +0200, Andrew Lunn wrote: >> This seem error prone when new PHY_INTERFACE_MODES are added. I would >> prefer a WARN_ON_ONCE() in the default: so we get to know about such >> problems. >> >> I'm also wondering if we need a sanity check here. I've seen quite a >> few boards a Fast Ethernet MAC, but a 1G PHY because they are >> cheap. In such cases, the MAC is supposed to call phy_set_max_speed() >> to indicate it can only do 100Mbs. PHY_INTERFACE_MODE_MII but a >> link_speed of 1G is clearly wrong. Are there other cases where we >> could have a link speed faster than what the interface mode allows? > > Currently, phylink will deal with that situation - the MAC will report > that it only supports 10/100, and when the PHY is brought up, the > supported/advertisement masks will be restricted to those speeds. > >> Bike shedding a bit, but would it be better to use host_side_speed and >> line_side_speed? When you say link_speed, which link are your >> referring to? Since we are talking about the different sides of the >> PHY doing different speeds, the naming does need to be clear. > > Yes, we definitely need that clarification. > > I am rather worried that we have drivers using ->speed today in their > mac_config and we're redefining what that means in this patch. Well, kind of. Previously, interface speed was defined to be link speed, and both were just "speed". The MAC driver doesn't really care what the link speed is if there is a phy, just how fast the phy interface mode speed is. > Also, > the value that we pass to the *_link_up() calls appears to be the > phy <-> (pcs|mac) speed not the media speed. This is by design, to avoid breaking existing drivers. > It's also ->speed and > ->duplex that we report to the user in the "Link is Up" message, > which will be confusing if it always says 10G despite the media link > being e.g. 100M. > Ah, I should probably change that message as well. The ethtool stuff is already updated by this patch to report the link speed. --Sean