From patchwork Tue Apr 9 16:22:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Gothe X-Patchwork-Id: 1921507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=tL+nJxiJ; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=genexis.eu header.i=@genexis.eu header.a=rsa-sha256 header.s=selector1 header.b=YWOQmpUh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VDWXB67nyz1yYT for ; Wed, 10 Apr 2024 02:25:12 +1000 (AEST) 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:Content-ID:Message-ID:Date :Subject:To:From:Reply-To:Cc:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pjAQ1jUeQ5fSgf966c8nRFXOrvrb5Z9jqwpBWDFgV/A=; b=tL+nJxiJexYCCv OyEug/PNob04Lnb3soSJ3XYo1nbId6xX0MQA40rMxu64x6Rz8hE1VKzrjy0F+tPl4QnlwJw9RmHZB /Ce54Sm5QZrCSvfJVswFDJ0+h3n7kS+7UDWh/jzsVJ0ClLYZFrDnIpXwDi977qlb+kfgV+zHM0VAJ 2MImBRI1CR2V2R4lqItFwKd9aTRtcodpdH56KvhL8kFJtYx8rJhjPlef62qtVi/rufVFIBLrhzCNJ s0lauNxni6wQGFW4CzaaGeeSJKKzeuq2fHjpx0MOb2CJyK96KSi8BfvhegRjuFbEW25vKg6e6GN36 lnaEiBsnXpKmxJX8Cdww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruEFX-00000002vD1-3bxS; Tue, 09 Apr 2024 16:23:07 +0000 Received: from mail-db5eur02on20700.outbound.protection.outlook.com ([2a01:111:f403:2608::700] helo=EUR02-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruEFT-00000002vA5-3qBB for openwrt-devel@lists.openwrt.org; Tue, 09 Apr 2024 16:23:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aCDNdkSc8eId2zJfZO7aicPeEVv/cyQqUjcTVzkvJjeOkbxyOgp/q7bIY0fszJB2p7k9zTZ/HCH929yRVM6NYzmOT59/8457K1oL5h+HogUof5zpkWqcOHY7mPdzTRul00k7rsXKc0VfN8UE3Jw8lXgu+KyjzsuEW0xnd1Rv1JjXgiBsalj4RjPKOHJvbaCLuI3IWBoK3Rx/GHrknKriBEgtzUrfXGHdlutJKaj4H8gqCJZjGVeRUQiQGZS63kYCZDeqxaEg4lfpSeKBqkhzlMneXiDtQ/el8xjOG1EDkcoqFtJq8a3YVGlApEBZlUow1BfHSv8Mzk8quxziitCbuA== 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=ExEHItw6wEvfoehtqFSiwpTsz6sOqh4QljJUFxRVxhc=; b=SsqURSJ9H6QeGu5Zq9phmIC1gIQEZ5CWHVu7Swn2mH5HcNdi67pRR8FJTjdDXG2Lj6RnyN8FuZsTi4tIPtzom94Ga/KoeePpSbdQx+uok3iyHQCVF4+pdQK0X+u4bMLkCuJ/JJTIvbIrta0IcZHahNogWLUfgr/Ky/c0hyMZ4zAcZjNIiefFpHZhNkZ50TLvgR4L6pMui3MkCtReAVgoLCXGPxCenvABMi2ijYZCX7k3MwZzTsj1BYIJKdn167ComnEZlXHKZu/OdpipU2R8ysMUbQioQLPLVpQ+kv/ZjiG0IrbJMpl+P6/YpWgK9/Mg1er0IXDKW0aH4sUxMmQQnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=genexis.eu; dmarc=pass action=none header.from=genexis.eu; dkim=pass header.d=genexis.eu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=genexis.eu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ExEHItw6wEvfoehtqFSiwpTsz6sOqh4QljJUFxRVxhc=; b=YWOQmpUhrwbqO6QXms3kFXGU2DvluyU1JDQ0a+xu8j8yjHg5pPI9SbVXvVx8GdRdl0Wkr9yAukTl/rk561myYUr1EIyBP+BHH+eOk/+gJY1tPrjXHt4TbPePBnAsD/DrFkhp2E0A3ygJAB2k9ILJzIeL9S3x51PFL/Rd76GenxA= Received: from PAXPR08MB7320.eurprd08.prod.outlook.com (2603:10a6:102:223::18) by AM9PR08MB6049.eurprd08.prod.outlook.com (2603:10a6:20b:2de::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Tue, 9 Apr 2024 16:22:55 +0000 Received: from PAXPR08MB7320.eurprd08.prod.outlook.com ([fe80::d430:8fc7:12f7:5ba7]) by PAXPR08MB7320.eurprd08.prod.outlook.com ([fe80::d430:8fc7:12f7:5ba7%4]) with mapi id 15.20.7409.042; Tue, 9 Apr 2024 16:22:55 +0000 From: Markus Gothe To: "openwrt-devel@lists.openwrt.org" Subject: [PATCH] system-linux.c: Allow user to set fixed speed with and without autonegotiation. Thread-Topic: [PATCH] system-linux.c: Allow user to set fixed speed with and without autonegotiation. Thread-Index: AQHaipotJ/oI2shRq0WWeDg/Z3caqw== Date: Tue, 9 Apr 2024 16:22:55 +0000 Message-ID: <766b9171-a364-4784-b967-a704a7ab767e@genexis.eu> Accept-Language: en-SE, en-US Content-Language: aa X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla Thunderbird x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAXPR08MB7320:EE_|AM9PR08MB6049:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: k1dUQAiAk8r5rqjcWCd8RTe7YY5YvcI/ua+/PvelElhIVPPfqfCalLAsbCd+pLU4938D1/YJERRzNN4mgQlr7YsH0gUVxB0YfQ/u92MQ5dQsimygJAowE+/p92v8WH09/6nqyvz9MibfeTS+HpOPAzy08QttcX4PO9UUIjiwr9h2rGvwdkRtsO7cDZINhr4VEMeZmrCQ8DWkqQFaRICr2dat11HpmrsUIjEwvG9960xjy7nqeIZ8fwKop0njKl+wyS2oJ3OE+cDHSUHJrfZLs9R0oXeigiN78qvW932TsHTx3P4TQcaTLu5i3vXrHa13TTFnJOZqngyFI/OPs7fma/Fgmfi65EMKgcuhmrlUlPsLH4tqR+MQXeMY3LiTk7TNoPE0HrrsZsDEmHwtEFtmW85LIXwCUFhhXxYQ36XJd8g2mJjjN5j8hx80r4gAQ4+GGaSlxLIHdYCMj3ODBlAISsoRWy4PN+MKk7LNACQ5mNfvDTuW3kgUrwG75iC0qvwDDdOVOodClRYqBNuoGEF6ZNdp1Ta2CTkuN4dLUhulPPT6pPcWABLgHxerb6D4Py8xwb1U8H5ugJ21BaSdyao9oaUSWH9WSA7N+PfeGaNzw6ooCUW9Gagyo3SWH8MW5b7MiEecZxLyFYfvAC5ZjJ7c+rEB9wjyWhhz9A8KxjRMufc= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7320.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?AYezyxrJdocTS5QwEq89iFRAhTRY?= =?utf-8?q?xODvpVKmqhPYOhexeuNMW1325+3rkB0/m7B5C99Ig3kWbleB6Pm22mAAAVdd3DRAu?= =?utf-8?q?ZXM6ZyGSRXwFaorwV/XDP8FfXShb5N4e7W/8K/qoxyFqTRGI0cA8kKJHBpduzIdm2?= =?utf-8?q?/fZXyRAUJ9MIVDtoHO5XvcyTvgZm/2b2yJeAtxQq+V/6e5pN4be3//jo3F3nUzdnm?= =?utf-8?q?8gUC+kF1iks7HRjuLDtC5H+OXxuM5bBdLySoMIt0AdXal1Xn6MrhnEm/FAvhhCbzv?= =?utf-8?q?9BGwO9B+MQLoUoJDm6P1iwcVsD14+vsn5po1MjOfKshph5pF7qe8fg0ymA81BLWyW?= =?utf-8?q?gaOXiTtuV4qfahTgWg5I4iNDcZS+J3XJgRkBw0uKiLzQNAAVbyXmKCXS3q9sul2CV?= =?utf-8?q?0nCmIsz1tGQ+BLfR5RyzQoVt6kEbr3j7rLjS/LPD0MNXmlNsxiEjmJFaPu+NHIhtq?= =?utf-8?q?s33982Xm8Tdc/l57qeDIhJhY+FS/90lCyzZKDxWPpkNylRi+fHxYT8hytTxDrxZZ9?= =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?utf-8?q?gAoWDdWvUD7E4P+O4tyE3EWDGNn342NzVccLIsAZ9vQuXx/N/r9Y5BNHEZBa1ffRT?= =?utf-8?q?esFL4ZDUYt3XcGDoJMPghXf0crWOcrsXD36UC/K6kjFeFCkyt9oiPhBZ4/WT8IHK4?= =?utf-8?q?Fu8S4sYVM7Gg?= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: genexis.eu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAXPR08MB7320.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11af9141-fcbb-4aa7-afff-08dc58b14fec X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2024 16:22:55.2852 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 8d891be1-7bce-4216-9a99-bee9de02ba58 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TuHtjY092D/jL+VA5gnPS9Z57dhj6otUqo9LtnHrh5cJrQMYy1WM6qUD8X40AqhawcUZineAUkkppLvG7ZwQRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6049 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240409_092304_465942_794D612A X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On certain types of links, i.e. active ethernet fiber links, we can have both fixed speed and autonegotiation on at the same time. It is, in these cases, not speed which is being auto- negotiatied but [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.0 ARC_VALID Message has a valid ARC signature -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 ARC_SIGNED Message has a ARC signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org On certain types of links, i.e. active ethernet fiber links, we can have both fixed speed and autonegotiation on at the same time. It is, in these cases, not speed which is being auto- negotiatied but the use of pause frames. This fix reverts back to the old behaviour before switching to the new ETHTOOL_xLINKSETTINGS API and allows the user to freely configure these systems. Signed-off-by: Markus Gothe --- system-linux.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/system-linux.c b/system-linux.c index 4463a2a..6454900 100644 --- a/system-linux.c +++ b/system-linux.c @@ -2075,16 +2075,14 @@ system_set_ethtool_settings(struct device *dev, struct device_settings *s) if (!s->asym_pause) ethtool_link_mode_clear_bit(nwords, ETHTOOL_LINK_MODE_Asym_Pause_BIT, advertising); - if (s->flags & DEV_OPT_AUTONEG) { + if (s->flags & DEV_OPT_AUTONEG) ecmd.req.autoneg = s->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE; - if (!s->autoneg) { - if (s->flags & DEV_OPT_SPEED) - ecmd.req.speed = s->speed; - if (s->flags & DEV_OPT_DUPLEX) - ecmd.req.duplex = s->duplex ? DUPLEX_FULL : DUPLEX_HALF; - } - } + if (s->flags & DEV_OPT_SPEED) + ecmd.req.speed = s->speed; + + if (s->flags & DEV_OPT_DUPLEX) + ecmd.req.duplex = s->duplex ? DUPLEX_FULL : DUPLEX_HALF; ecmd.req.cmd = ETHTOOL_SLINKSETTINGS; ioctl(sock_ioctl, SIOCETHTOOL, &ifr);