From patchwork Sat Jul 23 14:29:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12927210 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 A3EB5C43334 for ; Sat, 23 Jul 2022 14:31:16 +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=k6XtIlKV/8FP68snhUiWTDNtd2SH/a3vhFKt06ptAg0=; b=Mc9ySJTOq9fIT5 eRbV0ZQhutGg91ESxUHkkZWl2MqthjDFe2CGgCobmdYWitBEL2ki86QqV33ehLghxY+ZNJcPPFAM/ qT4hW9uCnZlF/McQvB1llnfE4WO9c3bzrDF3SpnQFKdcupQe8H/qTD0kdpuMhdH+xM7SdvOxUCOEF C6rBzxRP3AoGxtcwyP7iHxgwbTv4KzqbBLMQOOSk4ipbPtq48HpQbM/ckiXL1sObrXRr1Ql0XShuy dhcCqQcd8JJqzl58wwvw/yl1vqxrfg+lxXqAp3WKxsx9gJ+qsSGCxcn2C+75HKqAyR1AuDYpATv7w GnZM70jNRP9NwgTfixQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFG8f-0045xP-Dx; Sat, 23 Jul 2022 14:29:53 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFG8c-0045rm-9r for linux-arm-kernel@lists.infradead.org; Sat, 23 Jul 2022 14:29:51 +0000 Received: by mail-wm1-x32f.google.com with SMTP id v5so4302653wmj.0 for ; Sat, 23 Jul 2022 07:29:45 -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=hq2Xmgn0Ku0O4P6lR7XqOtoy//jBBsNeMteoMXkSOuo=; b=ZQ0PygAPKX+uCMzBYmJaijuE63twVe6pps9Q7Pt1jSbgr5VpXB3hJbQi33bzn6ffzl uCBxkdqy5GXx2giRXlaulRet2o7+rJsUrOXKjI59svNrCxyjMUuHWY/of3k7zOJED7Pe MNZepcvce+2EOf5GukLYf/8ukEJJVjKC2iQ10OvQzXAIFrS0LlOJUvy9g4HG7UMV9zJX 1O2AVBT+25HZEE5B3qtdJWSjJPEUWtk+wVsiaHo0L3podgeWJ2nNZisx4dIvQK6iO1wN uKpxV0Lr/ojI16CSMo5ywKEm0OFpf2jHVu7BOgjpNrDSeJ0qRVvSSr2zV0DzsOaTYeRz 2G0Q== 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=hq2Xmgn0Ku0O4P6lR7XqOtoy//jBBsNeMteoMXkSOuo=; b=hJ2CUwLnmj1F06DWHrcLwBq+FAfkvR8mjp/MGcmW1KYwzIJH9c3pl2esIzf8KADNYZ 6SPCJE9rKZFsQL8h0DvfJ7ezkTpseI9PoFHOFKRHxp1humRfSsZY/1PNQaAO347J6Zol Mp8c0O9iRzAyJDsjaz2HAnPjPxmZ+92S5oNOjzcwnn5n3+wv13mToytlq46bbMUqydcI Jwu8HqFzfiHUqwqv9r0sDJVoXYpxjvZS5Z+36oewVctN7NPP2CiuRluLlrR4Ac4IBLgE R4+YfEgzItCddxQZExorphJgDqiGa3vro4BMCJUaZDYgeRqJHMbGgiriF6ZC6LrEhTsE cP2w== X-Gm-Message-State: AJIora9UkjUmLjo+WY9N+i5Y2uEMKkhAtTYQfgrsXutE94lKWXPW4RhR m4oYu16tlCjgXcH6pJmv0eA= X-Google-Smtp-Source: AGRyM1tuX7ru0+QSDMniQaKgrPs1+GeHcWREL15bd1ePhphCSjTo1hPxx8fZqMepm6C4Y99CzIGwGg== X-Received: by 2002:a05:600c:1f0a:b0:3a3:15a8:a8e1 with SMTP id bd10-20020a05600c1f0a00b003a315a8a8e1mr3091269wmb.167.1658586584285; Sat, 23 Jul 2022 07:29:44 -0700 (PDT) Received: from localhost.localdomain (host-87-7-207-127.retail.telecomitalia.it. [87.7.207.127]) by smtp.googlemail.com with ESMTPSA id q6-20020a1cf306000000b0039c5ab7167dsm11689717wmq.48.2022.07.23.07.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:29:43 -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 v5 0/5] *Add MTU change with stmmac interface running Date: Sat, 23 Jul 2022 16:29:28 +0200 Message-Id: <20220723142933.16030-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-20220723_072950_364482_FC46F313 X-CRM114-Status: GOOD ( 17.63 ) 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) v5: - Fix double space for kdoc - Fix missing kdoc for dma_conf in __init_dma_tx_desc_rings v4: - Add additional stmmac_set_rx_mode after stmmac_open - Disconnect phylink first on stmmac release v3: - Fix compilation error reported by kernel test bot (missing dma_confg changes to tc and selftest source) v2: - Put it out of RFC Christian Marangi (5): net: ethernet: stmicro: stmmac: move queue reset to dedicated functions net: ethernet: stmicro: stmmac: first disable all queues and disconnect 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 | 723 +++++++++++------- .../stmicro/stmmac/stmmac_selftests.c | 8 +- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 6 +- 7 files changed, 459 insertions(+), 313 deletions(-)