From patchwork Fri Jul 15 21:59:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12919829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05814C43334 for ; Fri, 15 Jul 2022 22:07:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SsFF8nbDqo/IGScN2aO9z/ypEEu+KnWSCmv0boq1g2Y=; b=TqasYju6mbOInD k+/ZmeKifZRtlmwhyvo4J4vH3NbrsTGqo4jOLhK64JlF+vqfZnl6CY/UR0jxcNFsdvXiPLGoYR/S7 7bsd8w/vBDJ48KGZ3B3PaPVj9zIRR1cWfNzJuVaORGhfhliWHLuxGLBtFzHIPRQ5+vakuHNoNlVL3 k5Q6DVhivmZVz04P4zQ2/WI7ylCATp56h5HaoD/UfvZzd7aNPdglVTrU2fHc0HBThq6tC9j26HgiK ugsAh3W82EVex0UPzOo5h6dKDJTFCE3T3RlnLtvzdJ05jkipSw+7O2cAndttOeUe4NkOi0z4kfvHj H0J9dhgZzgzwlZF8o/1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTS3-00AdeL-2v; Fri, 15 Jul 2022 22:06:24 +0000 Received: from mail-vi1eur05on2060.outbound.protection.outlook.com ([40.107.21.60] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTMZ-00AaxO-Ou for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2022 22:00:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q3KfH0k+3lFOmAebcdTpD+JdxJCSjH73qlB2DgJHS0IPHX4rV3Id8N8+inytOmPWQe5Y3oTQGxdFzhojScBV5qRRxc7y+WIy1sePWc3wNj2Ry7cDQqk+L2TQGx2O44anCTT9mXjZPs96f1rrVa3Z2s2AKZWY7OGsJOaEYQvvAD1ZH9iTTcTFdwKx1zGJqhWoJ+/uDItJDMUhR0EY3ZopI54vQNvKzvi8bFCvQtZbaPVoBSqDCr2DCBoJVlKW0UdntllAtJZXrALjWChdwHgpLpaKGSkRh+EtKM6MzunYbcWHPoIMkiythzkoaHG6Ly9CZLgI+Y31pRpF39ErmYRAHQ== 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=cg+cQIc2FCegiIrEJm1vgOxmPE0VZWdYu4MNifUz/hE=; b=a84FKrKy4mP2ukgYPDxG4GWEDWvwfvSn3U9/gtlKcA6Bc90257vbSjlmWuDXP1mfqYCiCJOXWYl52qWzlS/XvtLk8D2bc+1oq3Aw4ziV1qOe56NEJxpW1qm9F3fXffJ7NpOETzf8agsjqEIu0ZI6bIaE+l8mDycmqvmARVYQ3zb/IMOpVnKQVSWQsBkO3gR9FAoQzv3LKkOQoDPfBso/QH7rTiDrwKRB/oULIn6OzsEX9PewZk5TGk5GnWblPPJTlGZe/qOzAQNu4pgnwiIof5DOfYLcKPPTXjXQhDc5uf04pDe6Wib6JZLyyNcjIyinbLpzAAgbp/Wgu3K1Fzkktg== 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=cg+cQIc2FCegiIrEJm1vgOxmPE0VZWdYu4MNifUz/hE=; b=KczAAExYZ+FmO6xHiNJW3p4R1xJWtNtb+j0J2Bxrg84I01sycuBXMHhDwrKNWLTKWZyLejHlKdhoopMpYCswoSnJnu9xM8wwLxyP+Sako6UkuVmevfgHlPCNz0MNjkxyuntFwGIG5bihx3sG7hqUaOJs9K1CbvqtaGrubwvvSqMiJU53dPHmStxcGd6/JCDRDSuKkyfWeBS0eTLaSaF2Bl6TlVzIcweH5v3rgolmYoq1adDGl75QsBejDnV15o6BZYw1xlGfbEU89hwu9guo5dkHdvzj2576upxiWlpCOZjkvZgyzPB8W35oeQ1HmXH746h3s1FF9+bp0fvhbCuOsQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by DBBPR03MB5302.eurprd03.prod.outlook.com (2603:10a6:10:f5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Fri, 15 Jul 2022 22:00:36 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558%7]) with mapi id 15.20.5438.015; Fri, 15 Jul 2022 22:00:36 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, Russell King , linux-kernel@vger.kernel.org, Sean Anderson , Alexandru Marginean , Andrew Lunn , Heiner Kallweit , Vladimir Oltean Subject: [PATCH net-next v3 10/47] net: phylink: Adjust link settings based on rate adaptation Date: Fri, 15 Jul 2022 17:59:17 -0400 Message-Id: <20220715215954.1449214-11-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220715215954.1449214-1-sean.anderson@seco.com> References: <20220715215954.1449214-1-sean.anderson@seco.com> X-ClientProxiedBy: CH2PR10CA0009.namprd10.prod.outlook.com (2603:10b6:610:4c::19) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4649dcbe-6849-45dc-03ac-08da66ad72a6 X-MS-TrafficTypeDiagnostic: DBBPR03MB5302:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W3IR3uvBcAd91RqBLqkDIQlVadFWDTfntzBkNXJ4UwROAL0de8Hm0CHUFmu91naETOHDkrNndOhCoRowtV1CxBy7q3mEPJkQF9HGxVT2VvZcnCQ4zgCfuemCwOwtSM/nDFNYjRr7ZPvmar2l9ExjJJdKnSp0WhY7h6b31Q9qAtAtpa/90hdsIDAgp/j2j3RzhsjABkLrZ8WsQRjp3K8b4tf4JaMnESUUIqkNym3hS8WzgXpN4mKFi1P5tmcmZREOqERxG+1NBlvW76No2DgsOaYZa3ZVY68imoaNZfIqMnnNfzQOdKMwG05ArBMowrLyVXqRBixHrNXxkJ+WvnePXmQDRJZ7MDGcd8d1mGMYSy0sFeFuSQnmOTi+rAeSNWJ1nm60vH+CGByLmyq7h1GFK3Mr3Z98ms5QVxtQzZ8jwwZ41p3pe7PPk00gU9aaFYJVhB7P1JpJTgJSWUpWO2HlrabV0yCBFEBOlIuiwAqGNMNds/KzFWBVDdMqVCdrJbw+DqQlb7wj9Kv/WLGOoHfnVVv7iZTg5ORf3m8f7u274TL4Ms5HqCA7hjVMLEYE7m9Vk/jQkCkkRRLhw9f3GIyivbZFPxKOTHiWJstPf/Tc80CekOqMc7T3+HOWtEbeHzgAvdsTbjpiTWn6NMmxZm6JWbiVHEhMNJb60pWuk1aA2VKpIsrQQf2SUBhXxcrkbnJ/fPWxDAd6PsUAcHijakrXD28T9r4cmdN66XMtzktmck6kqvAPUKz7HRYkXoEf1B9EVAyrSqm4bMBnaFoJG0PbXs2HYfZTC7gWL57K2Xyn3rFC0YLK9FtcXJg836Z+QouN X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(376002)(366004)(396003)(136003)(39850400004)(346002)(478600001)(66556008)(41300700001)(66476007)(52116002)(6506007)(6486002)(6512007)(26005)(8676002)(6666004)(54906003)(86362001)(66946007)(316002)(8936002)(4326008)(38350700002)(2616005)(1076003)(186003)(7416002)(36756003)(4744005)(110136005)(38100700002)(2906002)(44832011)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gQvWoKs+Dm2Lw8jDw6WoO3TdjHsk0GpJpNe43thPT7Dy4EfSnxFtop4yEtnnguH1PvmU+JveOG/2vOfL47PygdCsBfayUGKjvaYiQXVFVnGfqz6pmGKvvwUCzRBw6GwXrVjGcnXVqbXBabz2Wm/3HqRn6jukLJHYAgh1mvIWcwkNZl6XmCBbVie/2JKVgqPxdvmxMBk0h3CzFAWJmIxyn+a8ktOnXNaliJpJ4K08SAcBqHv4LMlNklxGLed5aEplVZ5Eehj87G8GP9MQhlkAd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ez136lMwarKYgVnvzRGASJCCibdaN35htL9fXpkNMYp2c+LimJsfOWTYlWzzQVgOIvi/1T5tdYFLy2BhpS6pZ22cLajVhQnP7mpIPsRFO6y+dA3he6RnTqof1WAuR/uqdzZhhmB9tQgOsPioPOW0WfkJ9hRJKr/PeceWd8h+ZapVWuTNt+uHK81cA8KxJe/7hQtWEQ1Cep9L0XwyieQkXJK+Xh3c65/n+LWSMFsZiA+RXk5ZI9afxQNopt21jRiTemgV8/thrsSD3TTR8MVlBWW2Q== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4649dcbe-6849-45dc-03ac-08da66ad72a6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 22:00:36.7391 (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: /dkRvH94JsITO3oYo4yPGMdI6klXNuTXkUXz36twTIIMaFFF/Sq9YC1s4fu3Oz5b6Dy+a/M2opFLxfv+aoMTkg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB5302 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_150043_852858_BA276D8B X-CRM114-Status: UNSURE ( 8.78 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If the phy is configured to use pause-based rate adaptation, ensure that the link is full duplex with pause frame reception enabled. Note that these settings may be overridden by ethtool. Signed-off-by: Sean Anderson --- Changes in v3: - New drivers/net/phy/phylink.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 7fa21941878e..7f65413aa778 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1445,6 +1445,10 @@ static void phylink_phy_change(struct phy_device *phydev, bool up) pl->phy_state.speed = phy_interface_speed(phydev->interface, phydev->speed); pl->phy_state.duplex = phydev->duplex; + if (phydev->rate_adaptation == RATE_ADAPT_PAUSE) { + pl->phy_state.duplex = DUPLEX_FULL; + rx_pause = true; + } pl->phy_state.pause = MLO_PAUSE_NONE; if (tx_pause) pl->phy_state.pause |= MLO_PAUSE_TX;