From patchwork Tue Jul 19 01:32:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12921974 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 8A626C43334 for ; Tue, 19 Jul 2022 01:51:05 +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=nBz0h97FWwsM+x8nLb8xvuiVkalYzDfRRUqRfovFdx0=; b=KTBYxr1zFb9ebh XRkXYouTLQ0Y8wssWX/ltNRY05RDAwXL3JY6vnTwpqlohxTIfeMxf/cAxcySJOQiM+tnuyeuSimy6 sHiyk+wn6Cxw+Iw2b3249NaeNQaTf7E0p1l2GDR7op5AOJxku4d/e+JfbwaK0Is5qAKQi/m1gp1He lkKKdpM7+Av0GPwQqY32bIRAwUSJvSzNtMqN3XECCrhPQKz1ffzA/y4zySR23Lz0+kGmbsLEUQ0Aw hZMJQ/Ws1rgwdB4iCs+lUzTitlzAV2hh43+fNO4VZQWRBknGNe1bpf5vdZwW6IICnm9mymmtGMg8k aWYcD4ARVWkIlX+/RwSg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDcMi-003gHt-9W; Tue, 19 Jul 2022 01:49:36 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oDcMf-003gGl-5C for linux-arm-kernel@lists.infradead.org; Tue, 19 Jul 2022 01:49:34 +0000 Received: by mail-wr1-x42d.google.com with SMTP id j1so15054520wrs.4 for ; Mon, 18 Jul 2022 18:49:31 -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=NRlQ3mxg3RzKLJEGPG1n3tE2Reyt0PmZbkS9Sk9bMTs=; b=I7xGQX4QrHDZwh9zLKLOg9R55Dz23nFRbAU+JW9KAV99wmpuzTbVctG72+amjQ5Zzw tZ4wbHPrtnnViOPfQ7SiQPjReHaBxnVGlTQ7GjKNMVIyx84+AgDRZ4/Nxuk7AimnMNst xqkGPM9AiGMpLeBFsacUWDmFPMS+ocjBx9QynIdO/h/30vdeEM9VRh1pyR9n0UPUyV4w HOmqAPiDnN8d0eIf4zBEGgMgcFLaZONHiDokMYrhwc/dRqKd2JNfAcjSQVIu4ua0XUvH LOVBI3lVHTXrzHx2hcRz4SI1XTO2+T49wm0+XQCuriIebz2Dx7535QYHyhmBdREnE3jr rBIg== 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=NRlQ3mxg3RzKLJEGPG1n3tE2Reyt0PmZbkS9Sk9bMTs=; b=Be8MrlAH+raYE8kpbIJD0cLCij107yeyTu4eWjd5lBHcQ+MaSs4icgyJ5UjKrXcXua pgiDouMcjiRM6LkF0qPVJN18Frl5CPnT7axToUQngmxz5aSWBax5SiQsg40uQBge1ak9 FnoLfUgNscCzdfjNPYPbDYCt43NWDitE/crif9MXLan88eilNOfgUIQ3ShUu9CTNPbEY ORSeIwDSzHKnuBTF5UV+hzGJwKP9z5Wxj76RytAUXwR/Hu6ZxCCl7N6qkyQkJ8JUoNiM fn5Jag9NXL7sBnhMPiYNXAo8m39dOe8Jxbr9F5Z6gIK6krgApGe3bYPv1pnOl1MMlvNM aO9Q== X-Gm-Message-State: AJIora+JmGUX+himbxUv8WXOfscoalRCY45Wb7Nl2zhArVQS8B+glo3q BIj5xl3tFP1DToMiwx18iAw= X-Google-Smtp-Source: AGRyM1sgPFrzN1+aui8l4wS4BVl7j70f+1Uo9TEgTIrEo9LFJKayW9/hAmm/cUeLt51/PEU8QtbbvQ== X-Received: by 2002:a05:6000:1367:b0:21d:75cd:5ae8 with SMTP id q7-20020a056000136700b0021d75cd5ae8mr24932292wrz.282.1658195370030; Mon, 18 Jul 2022 18:49:30 -0700 (PDT) Received: from localhost.localdomain (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.googlemail.com with ESMTPSA id v10-20020a05600c428a00b003a2fc754313sm16193600wmc.10.2022.07.18.18.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 18:49:29 -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 v4 0/5] Add MTU change with stmmac interface running Date: Tue, 19 Jul 2022 03:32:14 +0200 Message-Id: <20220719013219.11843-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-20220718_184933_236502_0E23B9D3 X-CRM114-Status: GOOD ( 18.12 ) 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) 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 | 720 +++++++++++------- .../stmicro/stmmac/stmmac_selftests.c | 8 +- .../net/ethernet/stmicro/stmmac/stmmac_tc.c | 6 +- 7 files changed, 457 insertions(+), 312 deletions(-)