From patchwork Tue Jun 28 01:33:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12897510 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 C8FD2C433EF for ; Tue, 28 Jun 2022 01:35:21 +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: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:In-Reply-To:References: List-Owner; bh=NnDXbJv5Poe1TJabZEQuocwi4QyPOJ7fgZdjuidsAIc=; b=SlhoEhmrPmgP2L wUJb9sY5VM1JpdkYrL9QHm6Vh7/P1rVX26Khix7l5ySk1kXvTgVsZ/x/nVWU+QM4LrY31JMk8W0Gz VfKkhQFSrCnalLgGYWiPOBo9RmwcC8GjFmi+HG+vXAUttyRC+iRaEXr+RAIOA84eY4JX0RtIZrrRx zV7VlShMpKIW6vH6OkCd7h8oxAhT0xuhhfsZOl7JmVejhAHMV9lsXjKCLUKzGzhC1oLC3h+WGu2yn wZIEmgL9W0sYeCn6Wbq98+I3eKBV/jGzpKZNvdQVjG+lZ8F2pPvYszQho7THwhCOYOYHI0lxQLmyd w+i4KgQRaPRYjocyfXAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o607J-003WI8-2B; Tue, 28 Jun 2022 01:34:13 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o607F-003WGn-UF for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 01:34:11 +0000 Received: by mail-ed1-x534.google.com with SMTP id z7so15415931edm.13 for ; Mon, 27 Jun 2022 18:34:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y+PHCtYFQjlFqTy7xiF2BYO3NjlRKVCp7efVO+mj96g=; b=aF8Gc0nBYIqf+kRIRnA4wyxA7nSyQDUbC2F9DsBhQhe93Arz8CmKm9qj/XvtRX10jJ 1jwHvjBc/b0ATfNMt84xwCHJCfOwazM3TZ4Gy1Db94WbS8M+EHAItGJ1x7Ievvv9VyOf WpAUKHJjBZNvYMCmTYjrYUKUxLp42i4pUnz27/MEuccDg6kX8VFDy+HexwlKT+0AekIt VTs6ndF3+D8fEIa+1uwRMX0KmR+Dkxf+e2gAjz9QfhV2RmzVVatX769GU8lajXSrx4D/ NL7i4G2amGuxKpyDLdg7LzlkCQYe29gfbDYDdAmZWKUGxgOcls7/rFUM2iNtIPT/HjvV F+MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=y+PHCtYFQjlFqTy7xiF2BYO3NjlRKVCp7efVO+mj96g=; b=d3Wp7uLt5rsXeruzBTfFOIhYor56gUs7LZQiRCeHdX+Nhf6ij/bANmHPnfXcboPqyz NE7tZcmnKAotjYuwdM5lnCR60+bNiIq3enyX9GqzsUvgLhlOxkATvRJHNu/WJr590AhA xSPfQIs1ONC+jaywcKDR8TrYDToUd3sYSnc8QpPchXPIf2xjzPlsoenKLgfy8AXgpHbp 9TAIynJI5fAQHv5/rg/PmxFhSo/jdfj4hozViHD23ySJaNlIMsAVAXd6kVDAPCcitdEu xD+HJ1sVnUo0V0+y/EFNiQzN7/+bR6Tx8SCplaHtXhbBpk2K8AhhH9cUz6Z0fMiUQE4V TQMQ== X-Gm-Message-State: AJIora9xluoZEkwF9yfMbrJCDrmnkTu80OkKh3+RaB2NwAqV0gAjR12B dk0yP9wkeBAAsUAJlW58HBc= X-Google-Smtp-Source: AGRyM1sCM+8fBV9YLUq2tUBXlkuFyobvH2oa3NoRsTecMQqItiGnuJdbUwnCH3hGeHYNXPr62e/mdw== X-Received: by 2002:a05:6402:50d2:b0:435:8c44:8715 with SMTP id h18-20020a05640250d200b004358c448715mr20239193edb.49.1656380045367; Mon, 27 Jun 2022 18:34:05 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id x13-20020a170906b08d00b00724261b592esm5693492ejy.186.2022.06.27.18.34.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 18:34:04 -0700 (PDT) From: Christian Marangi To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Russell King , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Christian Marangi Subject: [net-next PATCH RFC 0/5] Add MTU change with stmmac interface running Date: Tue, 28 Jun 2022 03:33:37 +0200 Message-Id: <20220628013342.13581-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220627_183410_035077_984042E6 X-CRM114-Status: GOOD ( 17.11 ) 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 This series is to permit MTU change while the interface is running. Major rework are needed to permit to allocate a new dma conf based on the new MTU before applying it. This is to make sure there is enough space to allocate all the DMA queue before releasing the stmmac driver. This was tested with a simple way to stress the network while the interface is running. 2 ssh connection to the device: - One generating simple traffic with while true; do free; done - The other making the mtu change with a delay of 1 second The connection is correctly stopped and recovered after the MTU is changed. The first 2 patch of this series are minor fixup that fix problems presented while testing this. One fix a problem when we renable a queue while we are generating a new dma conf. The other is a corner case that was notice while stressing the driver and turning down the interface while there was some traffic. (this is a follow-up of a simpler patch that wanted to add the same feature. It was suggested to first try to check if it was possible to apply the new configuration. Posting as RFC as it does major rework for the new concept of DMA conf) Christian Marangi (5): net: ethernet: stmicro: stmmac: move queue reset to dedicated functions net: ethernet: stmicro: stmmac: first disable all queues in release net: ethernet: stmicro: stmmac: move dma conf to dedicated struct net: ethernet: stmicro: stmmac: generate stmmac dma conf before open net: ethernet: stmicro: stmmac: permit MTU change with interface up .../net/ethernet/stmicro/stmmac/chain_mode.c | 6 +- .../net/ethernet/stmicro/stmmac/ring_mode.c | 4 +- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 21 +- .../ethernet/stmicro/stmmac/stmmac_ethtool.c | 4 +- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 722 +++++++++++------- 5 files changed, 450 insertions(+), 307 deletions(-)