From nobody Fri Jun 4 12:01:20 2021 X-Original-To: net@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 C4D9613AE2DE for ; Fri, 4 Jun 2021 12:01:20 +0000 (UTC) (envelope-from bugzilla-noreply@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 4FxLvh4ydZz3JLJ for ; Fri, 4 Jun 2021 12:01:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 91ABE1CCA9 for ; Fri, 4 Jun 2021 12:01:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 154C1KAO044395 for ; Fri, 4 Jun 2021 12:01:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 154C1KG9044394 for net@FreeBSD.org; Fri, 4 Jun 2021 12:01:20 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 256375] iflib/if_em: unplugging network cable causes huge KTorrent slowdown Date: Fri, 04 Jun 2021 12:01:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: IntelNetworking, iflib, performance X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: afedorov@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256375 --- Comment #9 from Aleksandr Fedorov --- I wrote a quick and dirty program to test getting link status in a loop. See attachments. To start: c++ ifmediatst.cpp -o ifmediatst ./ifmediatst em0 Also I found Notebook (DELL Latitude 5280) with I219-LM network card. Some tests output. RELASE-13.0 with iflib based driver: ./ifmediatst em0 ... iteration: 16631 state: active, duration: 0.146374 ms iteration: 16632 state: active, duration: 0.148981 ms iteration: 16633 state: active, duration: 0.149550 ms iteration: 16634 state: active, duration: 0.147517 ms iteration: 16635 state: no carrier, duration: 111.931014 ms iteration: 16636 state: no carrier, duration: 224.454816 ms iteration: 16637 state: no carrier, duration: 111.525601 ms iteration: 16638 state: no carrier, duration: 111.994844 ms iteration: 16639 state: no carrier, duration: 111.995998 ms iteration: 16640 state: no carrier, duration: 111.996868 ms iteration: 16641 state: no carrier, duration: 111.992766 ms iteration: 16642 state: no carrier, duration: 111.994449 ms iteration: 16643 state: no carrier, duration: 111.996805 ms iteration: 16644 state: no carrier, duration: 111.979432 ms iteration: 16645 state: no carrier, duration: 111.992068 ms ... RELEASE-13.0 with removed iflib_admin_intr_deferred(ctx) from em_if_media_status(): ./ifmediatst em0 ... iteration: 7412 state: active, duration: 0.048852 ms iteration: 7413 state: active, duration: 0.047400 ms iteration: 7414 state: active, duration: 0.046978 ms iteration: 7415 state: active, duration: 0.048232 ms iteration: 7416 state: active, duration: 0.047024 ms iteration: 7417 state: active, duration: 0.046711 ms iteration: 7418 state: active, duration: 0.048584 ms iteration: 7419 state: active, duration: 0.048262 ms iteration: 7420 state: no carrier, duration: 55.209966 ms iteration: 7421 state: no carrier, duration: 55.980619 ms iteration: 7422 state: no carrier, duration: 55.990572 ms iteration: 7423 state: no carrier, duration: 55.990879 ms iteration: 7424 state: no carrier, duration: 55.991856 ms iteration: 7425 state: no carrier, duration: 55.995035 ms iteration: 7426 state: no carrier, duration: 111.989782 ms iteration: 7427 state: no carrier, duration: 55.992155 ms iteration: 7428 state: no carrier, duration: 55.982886 ms iteration: 7429 state: no carrier, duration: 55.988871 ms iteration: 7430 state: no carrier, duration: 55.990932 ms iteration: 7431 state: no carrier, duration: 55.992620 ms iteration: 7432 state: no carrier, duration: 55.990883 ms iteration: 7433 state: no carrier, duration: 55.992068 ms iteration: 7434 state: no carrier, duration: 55.992049 ms iteration: 7435 state: no carrier, duration: 55.994219 ms iteration: 7436 state: no carrier, duration: 111.993054 ms iteration: 7437 state: no carrier, duration: 55.988053 ms iteration: 7438 state: no carrier, duration: 55.992884 ms iteration: 7439 state: no carrier, duration: 55.990556 ms iteration: 7440 state: no carrier, duration: 55.991261 ms iteration: 7441 state: no carrier, duration: 55.993390 ms iteration: 7442 state: no carrier, duration: 55.991350 ms iteration: 7443 state: no carrier, duration: 55.990535 ms iteration: 7444 state: no carrier, duration: 52.996427 ms iteration: 7445 state: no carrier, duration: 55.971019 ms iteration: 7446 state: no carrier, duration: 111.987514 ms iteration: 7447 state: no carrier, duration: 55.990414 ms ... As you can see, active state: 0.1 ms -> 0.04 ms, no carrier: 111 ms -> 55 m= s. Periodically, in the absence of a carrier, the value reaches 111 ms. I think this is the influence of the timer that calls em_if_update_admin_status(). RELEASE-13.0 with driver from net/intel-em-kmod: ./ifmediatst em0 ... iteration: 276057 state: active, duration: 0.000437 ms iteration: 276058 state: active, duration: 0.000438 ms iteration: 276059 state: active, duration: 0.000440 ms iteration: 276060 state: active, duration: 0.000435 ms iteration: 276061 state: no carrier, duration: 50.117849 ms iteration: 276062 state: no carrier, duration: 50.113035 ms iteration: 276063 state: no carrier, duration: 50.109604 ms iteration: 276064 state: no carrier, duration: 50.110543 ms iteration: 276065 state: no carrier, duration: 50.109672 ms iteration: 276066 state: no carrier, duration: 50.109586 ms iteration: 276067 state: no carrier, duration: 50.109930 ms iteration: 276068 state: no carrier, duration: 50.113659 ms iteration: 276069 state: no carrier, duration: 100.288162 ms iteration: 276070 state: no carrier, duration: 50.109680 ms iteration: 276071 state: no carrier, duration: 50.110047 ms iteration: 276072 state: no carrier, duration: 50.110437 ms ... iteration: 276122 state: no carrier, duration: 50.111246 ms iteration: 276123 state: no carrier, duration: 50.110519 ms iteration: 276124 state: no carrier, duration: 50.110134 ms iteration: 276125 state: no carrier, duration: 100.281411 ms iteration: 276126 state: no carrier, duration: 50.111783 ms iteration: 276127 state: no carrier, duration: 50.110226 ms iteration: 276128 state: no carrier, duration: 50.112179 ms ... iteration: 276153 state: no carrier, duration: 50.112264 ms iteration: 276154 state: no carrier, duration: 50.111985 ms iteration: 276155 state: no carrier, duration: 50.113115 ms iteration: 276156 state: no carrier, duration: 50.112568 ms iteration: 276157 state: no carrier, duration: 100.300982 ms iteration: 276158 state: no carrier, duration: 50.109478 ms iteration: 276159 state: no carrier, duration: 50.109434 ms iteration: 276160 state: no carrier, duration: 50.111644 ms iteration: 276161 state: no carrier, duration: 50.109683 ms ... A port tree driver is significantly faster in active state. Without a carri= er, it's about the same: 55 vs 50 ms. Also, the port tree driver has a longer timer period. Alexey, may you perform similar tests with ifmediatst utility? --=20 You are receiving this mail because: You are the assignee for the bug.=