Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp15413pxv; Wed, 21 Jul 2021 14:08:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0yMW9yz3AzLGFN8r3pdicvHtLGF4Fbn/ABiPzl4j1zxz+Dk1D/TIvSXiL8gheIvZt5u88 X-Received: by 2002:a92:d344:: with SMTP id a4mr23471396ilh.230.1626901733733; Wed, 21 Jul 2021 14:08:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1626901733; cv=pass; d=google.com; s=arc-20160816; b=HfIp9e/znQt5ueCear8KfJXXEJGfMsEddS6eca2kUHgF5LhBwQlH0Q8kPzq/pz10j6 kqUtIxvK9y/w+HCpZb+YloHonW/SGyLZLUQ4NindTHdbOnzSeTLCXAiOXCwmoiNYSg07 tvf7QXC+GXZk8ej62SWg0xxyl/O3YNkHKrxXEZGnXywyvK+pczo6BJfLDHqtOVqZ0swS vjtUa9A5vHfHk6eJ4S2CK+t89Nlw/yC8IOa3bHFsAdls7nYQqaeE0PMl8nsgnoV7Bn2U QY0m8fzEnm1olflXBilF6revdhWNC8OVzLsleAajKQ5c4s4OQn/euDo6+wSSrjeN4fk9 y+Bg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=W35GdinijwmZVnYTo+diF2CEeDFrcpUAibySQPZF14k=; b=ivE5auc/Aas+6WP5PvGWZb+W4I8/PPhs9zk7dZfMg946GeLojv3jHV/m6b2JFviZgp pAkEIzfmYPnxQ0KLJH7jEwwQ05BzOEfGR6uszvJqTdvtrJYaF8iwSmy7WxSR4eLPHmc4 BBPaUf6ujEBUrhl9KSow8/TjV8wfjKZfq3hEAGt77jkQCs5iciY73Bc3e2Q5t4+cz9gq +lo58X68nDE075OFQ0xjvlXksEvqIww+pJpekUA0AySobCld63Zpo9VzMi17WDN5aBh0 X4yrWsp5KGrtASjir5OzA400kVNS55QQ0ooQrBKN0ZkJx81rUUPAk+gi17atAaR6s+hZ hcIw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="TuVT3/XU"; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si30732794jab.103.2021.07.21.14.08.42; Wed, 21 Jul 2021 14:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="TuVT3/XU"; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230196AbhGUUZV (ORCPT + 99 others); Wed, 21 Jul 2021 16:25:21 -0400 Received: from mail-sn1anam02on2096.outbound.protection.outlook.com ([40.107.96.96]:53294 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229553AbhGUUZU (ORCPT ); Wed, 21 Jul 2021 16:25:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ccdnwFQ9sN4HgMZ8HJkBbzohQScWYyMrgFqjaDIupPVwIJbKo2+ayh4XCj+UyoD0W1AuFWmuReye4yVpESGC9pZH50DTYQ5NpxjFJNAisNTuiDvjmVbSnUINq8sJHD4byfA4p5TUcJ56dUsozN+OEzBETplimukd1bzoUVVrwrNiFsIytJDm+MTrD9JyxJ0FOoimWkN9NfgnuosCjM4wmRy4UtySi52vIWtzDt4xBWnmRPJIrj5QRArRoDqJHnif8GHlbplgC+vtutiAXZZyRI5M7PqMXOl5pIqO0SQj+yXOd4cjGPEzl1owny/Djvqd55V37+Wf1s5Cmm9JEFdJvw== 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-SenderADCheck; bh=W35GdinijwmZVnYTo+diF2CEeDFrcpUAibySQPZF14k=; b=CSlRsQdVgVoyNUwgYLStyCuBEPuc2RgFBn/DSC7cTJ/mHZ6Hv5rnubyn1QX7hZLxd2+cUvwHdU3fdSO42CaRoTFaP7Ez8aJPx25B6gEI82L3HWZiHnwzra+46K1vAO8uvQx8+zkujdW7wP8BSAzVZ6G2vV4wZ9R9SvFOgLdVLRRhYGtQjpRN2nOG7Xns/Kabs6TdzTLTCQZrHnM/IKugGEETnUmvqVxcFDH2/p+9T7ZnUh5qejSf9d0UHlM3eV/feFDYeN/SdD/ERPNZT6wBu5CV2xepRAIvNGIPn3TzxG+Oe0bYiqHK8YZRReI6bwvnpYTek7lK4seInAxsojS75w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=W35GdinijwmZVnYTo+diF2CEeDFrcpUAibySQPZF14k=; b=TuVT3/XUzD8B7qhkuZJ3TjBwv68CPzk4SBDF3azMgSpgEbSBZSU5xnQxE5ecBu3gcy2TULGgAvcnUk1s7SgqsceerKEPB/WPsrU5B41/h4PPEo++EWG82vGpdPLnTwiTyzKZLQy59jSrjQzHLbXv/CdCHueKFVA/keeYlK7eb8M= Authentication-Results: ti.com; dkim=none (message not signed) header.d=none;ti.com; dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by MWHPR10MB1454.namprd10.prod.outlook.com (2603:10b6:300:23::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4352.24; Wed, 21 Jul 2021 21:05:52 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::e81f:cf8e:6ad6:d24d]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::e81f:cf8e:6ad6:d24d%3]) with mapi id 15.20.4331.034; Wed, 21 Jul 2021 21:05:52 +0000 From: Colin Foster To: Grygorii Strashko , "David S. Miller" , Jakub Kicinski Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v1 net-next 1/1] net: ethernet: ti: cpsw: allow MTU > 1500 when overridden by module parameter Date: Wed, 21 Jul 2021 14:05:38 -0700 Message-Id: <20210721210538.22394-1-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MWHPR14CA0046.namprd14.prod.outlook.com (2603:10b6:300:12b::32) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from MSI.localdomain (96.93.101.165) by MWHPR14CA0046.namprd14.prod.outlook.com (2603:10b6:300:12b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4331.22 via Frontend Transport; Wed, 21 Jul 2021 21:05:51 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3664e91e-2c83-4f49-dc80-08d94c8b529d X-MS-TrafficTypeDiagnostic: MWHPR10MB1454: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M37NpeaKPTwFaTl7N6d6oOym3KlXIpvDZkvrYydJPeolWPDdVuLU3xZjVyXEuoJCCnILpHVCnB1pKDoY8KEgiEoa9s3YRJ0xagOBkOz1uNaOhp3MLan5WBZP8zeH8diTNDGhYwzZcSpOsBlCCk3m2T4IFWlsthdE4HX8cOdQh0NKyJrEbMjiqUUUQXQ+hU68VgMQxoENOxYml2TvFC0n6KbFToNyNNk6GbO//u3tYqhW6HvyhIeLW1cqHk68ED2pr5mqdMACm9QYv7ulwIxdDxyrW7XQ62GlTA0uxK/Fg8q2wiJTc+nPMz4zoBK9RURQ8T8522zTS5qyU5dqEcT30Qq5rnSrdUb5WPsYvhSxbanSZrubHkpAqAuTWRDkgJUgfkMCsJrgtXcwWFYN6+k+raMMFqGdSH2In7xWPj3YLV/A/skPxq2oPVdu49roW89mqKMxcw/MMZPjQk2ojIGrYU0MCQiKdOdKnymqsIP9a8XO+zQaCHlmb/7pZ4ZJ6MSZr/pnGiCa2IADlT6lN6R+k6/gsHn27FhM9WfcwUlDT3Sdv3QL0bHcmSY2ytg/Uxu/z2yKVY3vGoRcqMZTswhJtWOcOq2d73hQaBTThuuWQhrnSzGdc6cvJuyVkZy1e5tio2I2QPMV+VgiNkPKeAvyElifasNCDWUaeCY7ST3+kBwW4Z4MrNrwChdQJ0KlRXg89anrG6Wvi7pncWmLaZML6V6D8+PeI2NpVYz3bebVPng= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(346002)(136003)(396003)(366004)(376002)(39830400003)(316002)(86362001)(6486002)(956004)(44832011)(66946007)(6506007)(508600001)(66556008)(186003)(26005)(2616005)(66476007)(83380400001)(52116002)(2906002)(6512007)(8936002)(6666004)(5660300002)(4326008)(38100700002)(110136005)(1076003)(38350700002)(8676002)(36756003)(221023002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?DEw7lsEKewmpJzcUoY0p8r1FI4SELkKZEBerU1KN1jMW+74vQuMAgztOAMUm?= =?us-ascii?Q?h5XmvzzbV5mm7d539dduUjbxvhaPVTv4YUrUOZLn52ts/6JoNQi9X3r35luF?= =?us-ascii?Q?rd0fy0i33URWtnjNIh1c2nX1ut5xQ7jY8XmgOS1oZevoQMvJ0x7enC5xyf7M?= =?us-ascii?Q?E0Nmd6x+FrmKUWj+tETLXqh82ixkDkrdTLaZ3WUNacBZiaem1qdLXRwXwn3C?= =?us-ascii?Q?JOoMcjM9m2Mc8MKrF1LqQ13iFCEg+hisXCfTGHIzqPa/Dy2fGos/NUaQ+Cn9?= =?us-ascii?Q?QZQwn6jEJfJ87Mf8yj5IAVQp44kLiRaMtl58hMT+dIwBtVEuzqitqQHCPrK+?= =?us-ascii?Q?cEiVTrZ+hGuO97Chd/MDEKZCSpobw+IdhiF8flmKiXgCr9+IuGKwEVQxvqNB?= =?us-ascii?Q?IE5T4uBpSlUR78pc11DX3mrDFrBcOanRenYmyNpXzsCUHV3gIdEzvt+PxGBk?= =?us-ascii?Q?2nBaYpMapKZirxuNbTx6f/SOfAEAcnw6MzMqWmzvUajndZwxCarihpAPPkbF?= =?us-ascii?Q?iOvJj1K5whPFImjBFrgjd9j/p1ohxk3pQM4Nh+hmdjfvfGl3gs8TAONLeUv5?= =?us-ascii?Q?Iti2/CMEiC3fOWHook8NVVV8EceL+m+ofYsQb5t2ZIy8M0nAeIxtcFwHhM76?= =?us-ascii?Q?S+5YUSQgFIRBQeagX2UEqWNiVuIGlfMp8NlxfLScDNNALdCBhon0C9i7Kcc3?= =?us-ascii?Q?ZhKxgS84O6Mt0KL1BFceZLSww/SLermmi6677E35vYGr13eiNf4ezMuZH9QE?= =?us-ascii?Q?I01C1/C0y6G0tkqm8g83GJk1m2VV7x0d/72ezHOtMpCl55jKJL3IBLvrs58z?= =?us-ascii?Q?FOGOCa75BNF1XLV/aWUlcn/JgE8oUeyvSPab/gGDXm5CQZCf3giernEWZRjl?= =?us-ascii?Q?uc2QrqT9rB9aXzK0VoW0A/Td/0yzFU7n96qBYtzE9x6Vw1KJ47kybYXqT5XV?= =?us-ascii?Q?4YU36qXvh+mJ2h2LTwbVv6hB+3xNyTzHzn4J62153x+5yL4/S5s/+23hroqO?= =?us-ascii?Q?fSe3Yioc5FucsRlJrIAFO2zOGpfZvWG8FOSCk3IQoJD1oxwCx5s+J9NjHYGa?= =?us-ascii?Q?8yHYyk4JyfIAJ0bhVZkQCYGeebnP27z6cN33+vweTxt87WGMDotezQ4wLdBa?= =?us-ascii?Q?GU1EKrcGgOi8KM00kgAXFAiThvp1Zf9bCREt8I9AOuyQG4C+80XoIyILVUdl?= =?us-ascii?Q?j13iekCFDIn9gHpdPhf9FyWOzOl6fOCd/PG9YGwNNPKmUB4nPTmow5r3yXGJ?= =?us-ascii?Q?5TasilokcgvDFn3asqUbMD+Fxgu76uZyZNqqiBHNbWfsm9JEwRog8B7jwmjq?= =?us-ascii?Q?4CYAkhEMetNIkQz5D6tb3lVJ?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3664e91e-2c83-4f49-dc80-08d94c8b529d X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2021 21:05:52.2236 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yeY5HOKlqOm5WAteF4SmpAcPQAc+o9/Qmwmq3PYz/rCgS6PS6AHII9K8k04z6Ziyc1KkUiSzru8Dr4AHL4L0Yh/M2my0OeJQiMZYR79XPJQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1454 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The module parameter rx_packet_max can be overridden at module load or boot args. But it doesn't adjust the max_mtu for the device accordingly. If a CPSW device is to be used in a DSA architecture, increasing the MTU by small amounts to account for switch overhead becomes necessary. This way, a boot arg of cpsw.rx_packet_max=1600 should allow the MTU to be increased to values of 1520, which is necessary for DSA tagging protocols like "ocelot" and "seville". Signed-off-by: Colin Foster --- drivers/net/ethernet/ti/cpsw.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index c0cd7de88316..d400163c4ef2 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1625,6 +1625,14 @@ static int cpsw_probe(struct platform_device *pdev) goto clean_cpts; } + /* adjust max_mtu to match module parameter rx_packet_max */ + if (cpsw->rx_packet_max > CPSW_MAX_PACKET_SIZE) { + ndev->max_mtu = ETH_DATA_LEN + (cpsw->rx_packet_max - + CPSW_MAX_PACKET_SIZE); + dev_info(dev, "overriding default MTU to %d\n\n", + ndev->max_mtu); + } + priv = netdev_priv(ndev); priv->cpsw = cpsw; priv->ndev = ndev; -- 2.25.1