From nobody Thu Aug 18 16:57:06 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M7rdv1b41z4YjMV; Thu, 18 Aug 2022 16:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M7rdv15m2z3G1K; Thu, 18 Aug 2022 16:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660841827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBijuRA8gDlafFa45V7yYYotARz3uVszTIpdxhojsA0=; b=ERftyleXFkBkSRDZppCzgOEFiGfTHgErViCunU/b6VL01S1MMiCS9up2s6KUlA6PihVQVi lBr5GuIU9ETprSFZMlTwyx1PY6WgM2gMXJ4mxhSZhrtz9+YDFASbE4J6bAcYlD1XLal72u TUn2UouImlda+0BUrs8uhcDBTRu9u0qmfsUCk5ZI9f1kf+TbC4kxktWbWSAsN1ySz6MaNr UTawOszTjijz7GKKcLHIUTD3ig+HxvONcAQqHgiOGvxHuWfzbwB8Z3dnfns8oKuh8+sLXy b/7/MgyajjBq4XnRFUHlKiumNZbx2Wmx4ruKpcSC+BMRqsiU4kjDjVbv78ZjyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M7rdv090mzLhP; Thu, 18 Aug 2022 16:57:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27IGv6cB077696; Thu, 18 Aug 2022 16:57:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27IGv6ka077695; Thu, 18 Aug 2022 16:57:06 GMT (envelope-from git) Date: Thu, 18 Aug 2022 16:57:06 GMT Message-Id: <202208181657.27IGv6ka077695@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Kornel=20Dul=C4=99ba?= Subject: git: 97ecdc00ac5a - main - neta: Fix MTU change sequence List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kd X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97ecdc00ac5ac506f4119be9570d13de2d3a003a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1660841827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bBijuRA8gDlafFa45V7yYYotARz3uVszTIpdxhojsA0=; b=ocad3m9xZMP7rpBK7wU3EYY1cvu2iUykE1cg8oQdAmP2qzXee23i0tIqDXLwLdOjUfshzM /v8H+mqfUGqcw2mGLWMPv/8zcrBH8YTA0whIEfCkphb5R4iLGPTiOLjEzKpw2+vBJIqFpN mXS2r1JJb87lJLIba+9RdBA56MK5Dp52YWLfSLGDbsd/XM0IagCx8IQYHOrnmkKZFk6AY4 1Vt9IS6Kf3SQnsebfb8ViAA99qF7wvXEl4iD6eruipXjd+hpbBXrFOoPacySTr7Kde7pgZ aarsZg5PjIFmDVGqIqYQP3r4pUg4FzdB+ZQW9SrDQ650/0jl/j4u36ScdDCt9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1660841827; a=rsa-sha256; cv=none; b=JIIfyv2dpBdBQk67k9WepReDXwjssbvfEigkzMNMgCXjDSW0NYRVrz3vlViEj/wkP89wTq EViTiwzrLXsDBB0Jan6KVQzegXA7l2DH1OHcD4iqHVEnhEj7DihYBg2ddoPaE1VcpzoTfS aITbD/dcYCvLlWDwcQwQtbwH/0pvFjRudZdBm8Bfv9bsSsBGCECQTf6bbKOEZwKYOWXku/ Ba+8JlK5IXYO8Gc88KLMSV2NYMmZFNN/DhLs0MU6TgVyzVMT2Raick2oJkxZYzPyvP7tF8 7PCKyWVIeDMm9odQUFtt35UghTuxEOvEAwqulP1wRUsfzImi1Qf5Ag7RKbmxmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kd: URL: https://cgit.FreeBSD.org/src/commit/?id=97ecdc00ac5ac506f4119be9570d13de2d3a003a commit 97ecdc00ac5ac506f4119be9570d13de2d3a003a Author: Kornel Dulęba AuthorDate: 2022-08-18 16:53:14 +0000 Commit: Kornel Dulęba CommitDate: 2022-08-18 16:53:14 +0000 neta: Fix MTU change sequence The IFF_DRV_RUNNING flag is used to see if the interface needs to be temporarily brought down during MTU change sequence. The problem here is that this flag is cleared in mvneta_stop_locked, resulting in the reinitialization logic never being executed after MTU has been changed. Fix that by saving the flag value before the interface is brought down. Reported by: Jérôme Tomczyk Approved by: mw(mentor) Obtained from: Semihalf Sponsored by: Stormshield MFC after: 2 weeks --- sys/dev/neta/if_mvneta.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index c2eb32947716..eb6c9eec74ce 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -2054,9 +2054,11 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr; int error, mask; uint32_t flags; + bool reinit; int q; error = 0; + reinit = false; sc = ifp->if_softc; ifr = (struct ifreq *)data; switch (cmd) { @@ -2157,8 +2159,10 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) * Reinitialize RX queues. * We need to update RX descriptor size. */ - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + reinit = true; mvneta_stop_locked(sc); + } for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) { mvneta_rx_lockq(sc, q); @@ -2172,7 +2176,7 @@ mvneta_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } mvneta_rx_unlockq(sc, q); } - if (ifp->if_drv_flags & IFF_DRV_RUNNING) + if (reinit) mvneta_init_locked(sc); mvneta_sc_unlock(sc);