From nobody Mon Jul 31 14:03:02 2023 X-Original-To: bugs@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 4RF0M036CVz4q92w for ; Mon, 31 Jul 2023 14:03:08 +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 4RF0Lv5BfTz45SB for ; Mon, 31 Jul 2023 14:03:03 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690812183; 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: in-reply-to:in-reply-to:references:references; bh=VDAs02KTrcCslDmVFQuvPK+h/i509VyzsfaXpovfsZA=; b=qk16FM/gSdtRXtje7aG60StxNZWtwaeu6IsHO/vuLnywoCsOUdPAfLM6vR3mpoU1SBaQgq Ea+w36Ff/8zLMBOUxjSvVCs+8LpZSZsG57DZCvxwmXlq53QBXPzNO4ypDbEDfyEnZouXnb P8SlU45s50gDUMcpbyHhDS2l9JGne/YJBh555p55/3N5bNbntEUT+FfToDZievXi9ozlpr cp8+PVkM2kN0DCwk9yAKDlhpkviyh4t+gVHQTWhjtDJ7bUP1hR1dWlou7tX/dbMxdCpopu bD4A9y9qtx48n/dhuf3/nd56DfpoMHu+BR4PmW3BGF8fmOZKqbqqXpaw4M4O5w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690812183; a=rsa-sha256; cv=none; b=Cs8xO7Pux4vkLGtcRRxwR2hgFgdre5goI22CeeuzuQb4OFVoW8pkCh3jTsQuBf0TgU3nNL 6GTPTm5fzwKB3E/DmbP4386+iK33BkY4ne5AKPL0aHZpB9XVuPBGInZ0jYunOm0LhxTMbj LauddHJUmHIKth6j7sdactm/iEYobXgFkilq1W2egowA8uywCkJOisvt3HWNPzZ4aZmU3E Z8aSBpPZytdS/PUUVTjJWa9RrYF7l673Ij1obOwxnWRqsHGMdG0optfGqKtRtqXZZP9p4Z V4NODM2GDpZ3OY0lccGdzQI/kMKfB0HOJdaH1ftfLIj44C01wL8l5/4OehyCiA== 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 4RF0Lv1kkxzyVH for ; Mon, 31 Jul 2023 14:03:02 +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 36VE325l059082 for ; Mon, 31 Jul 2023 14:03:02 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36VE325b059081 for bugs@FreeBSD.org; Mon, 31 Jul 2023 14:03:02 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: bugs@FreeBSD.org Subject: [Bug 272818] hv_kvp_daemon high CPU usage on Internet router Date: Mon, 31 Jul 2023 14:03:02 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: greg@codeconcepts.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272818 --- Comment #4 from Greg Becker --- Thanks Wencey, that's exactly what I wanted to see, which invalidates all my original presumptions. So, now presuming that there are contexts in which these hv_kvp_daemon scri= pts run where there is a default route, then the pipeline should return that ro= ute.=20 So I deleted the default route on one of my machines to see what 'route -n = get default' (thanks Yuri!) would return, and curiously it prints a "No error: = 0" error message to stderr and exits zero. However, my new awk command should give the same error as from the grep in the original pipeline when there is= no default route. root@sm1:~ # route delete default delete net default root@sm1:~ # route -n get default route: route has not been found: No error: 0 root@sm1:~ # echo $? 0 root@sm1:~ # route -n get default | awk -v ifce=3Dix0 '$1 ~ /gateway:/ || (= $1 ~ /interface:/ && $2 =3D=3D ifce) {val[n++] =3D $2} END{ if (n =3D=3D 2) prin= t val[0]; exit (n !=3D 2)}' route: route has not been found: No error: 0 root@sm1:~ # echo $? 1 And after I restore my default route it seems to do the right thing: root@sm1:~ # route add default 172.16.1.1 root@sm1:~ # route -n get default | awk -v ifce=3Dix0 '$1 ~ /gateway:/ || (= $1 ~ /interface:/ && $2 =3D=3D ifce) {val[n++] =3D $2} END{ if (n =3D=3D 2) print val[0]; exit (n !=3D 2)}' 172.16.1.1 root@sm1:~ # echo $? 0 So, it appears to me that the following pipeline would work. Is there any = way you can test this out? Presumably the interface is a positional parameter = to the script, so you'd need to replace the "ix0" in my awk command with somet= hing like ifce=3D"$1" or whatever... Note that this also presumes the output of 'route -n get default' is fairly rigid. route -n get default | awk -v ifce=3Dix0 '$1 ~ /gateway:/ || ($1 ~ /interfa= ce:/ && $2 =3D=3D ifce) {val[n++] =3D $2} END{ if (n =3D=3D 2) print val[0]; exi= t (n !=3D 2)}' I'm not the hp_kvp_daemon maintainer, so I wont speculate as to why they are doing this directly via route(4). Hope this helps! Greg --=20 You are receiving this mail because: You are the assignee for the bug.=