Bug 256819 - dummynet in monolithic kernel broken on stable/12-n233319-c419c8231fb arm64 on AWS
Summary: dummynet in monolithic kernel broken on stable/12-n233319-c419c8231fb arm64 o...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: 12.2-STABLE
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Kristof Provost
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-06-25 03:20 UTC by kudzu
Modified: 2021-07-08 11:51 UTC (History)
3 users (show)

See Also:


Attachments
kernconf (5.32 KB, text/plain)
2021-06-25 03:20 UTC, kudzu
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description kudzu 2021-06-25 03:20:16 UTC
Created attachment 226046 [details]
kernconf

This was working with 

stable/12-n233296-71efecb7eb1 arm64

and is broken with

stable/12-n233319-c419c8231fb arm64

The sysctl oids for dummynet (many of them) are borked. Something is not getting initialized.

===================================

root@graviton-1:/etc/ipfw 242# ipfw pipe 1 config gred 0.01/12/36/0.75 noerror
ipfw: net.inet.ip.dummynet.red_lookup_depth must be greater than zero

root@graviton-1:/etc/ipfw 243# sysctl net.inet.ip.dummynet.red_lookup_depth=256
sysctl: oid 'net.inet.ip.dummynet.red_lookup_depth' is read only

===================================

diff of the dummynet oids
< stable/12-n233296-71efecb7eb1 arm64
> stable/12-n233319-c419c8231fb arm64

3,4c3,4
< net.inet.ip.dummynet.io_pkt_fast: 66
< net.inet.ip.dummynet.io_pkt: 188
---
> net.inet.ip.dummynet.io_pkt_fast: 0
> net.inet.ip.dummynet.io_pkt: 0
6c6
< net.inet.ip.dummynet.fsk_count: 3
---
> net.inet.ip.dummynet.fsk_count: 0
8c8
< net.inet.ip.dummynet.schk_count: 6
---
> net.inet.ip.dummynet.schk_count: 0
10c10
< net.inet.ip.dummynet.expire: 1
---
> net.inet.ip.dummynet.expire: 0
12,18c12,18
< net.inet.ip.dummynet.tick_diff: 454
< net.inet.ip.dummynet.tick_adjustment: 53
< net.inet.ip.dummynet.tick_delta_sum: 4
< net.inet.ip.dummynet.tick_delta: -59
< net.inet.ip.dummynet.red_max_pkt_size: 1500
< net.inet.ip.dummynet.red_avg_pkt_size: 512
< net.inet.ip.dummynet.red_lookup_depth: 256
---
> net.inet.ip.dummynet.tick_diff: 0
> net.inet.ip.dummynet.tick_adjustment: 0
> net.inet.ip.dummynet.tick_delta_sum: 0
> net.inet.ip.dummynet.tick_delta: 0
> net.inet.ip.dummynet.red_max_pkt_size: 0
> net.inet.ip.dummynet.red_avg_pkt_size: 0
> net.inet.ip.dummynet.red_lookup_depth: 0
Comment 1 kudzu 2021-06-25 03:23:36 UTC
This is an EC2 instance in AWS

{
  "accountId" : "780662665147",
  "architecture" : "arm64",
  "availabilityZone" : "us-west-2a",
  "billingProducts" : null,
  "devpayProductCodes" : null,
  "marketplaceProductCodes" : null,
  "imageId" : "ami-0c129ca1e6df37472",
  "instanceId" : "i-01fdf777bf8bfff44",
  "instanceType" : "t4g.2xlarge",
  "kernelId" : null,
  "pendingTime" : "2021-06-25T00:28:32Z",
  "privateIp" : "172.31.62.151",
  "ramdiskId" : null,
  "region" : "us-west-2",
  "version" : "2017-09-30"
}
Comment 2 Marek Zarychta 2021-06-28 10:36:45 UTC
On June 17th dummynet got VNETified on stable/{12,13}[1][2][3]. I can confirm my setup with simple pipes working on stable/13 after that, but some aforementioned counters are empty like in the PR above, for example, net.inet.ip.dummynet.io_pkt_{,fast}.

To make it working again, please try to revert [3][2][1]

[1] https://cgit.freebsd.org/src/commit/?id=14cde6b5b12d32d7d5374f3766c0e06ae0ca3303
[2] https://cgit.freebsd.org/src/commit/?id=bc90a9cb0a741315ed6a43807b781acd2bd0957c
[3] https://cgit.freebsd.org/src/commit/?id=719f6456fbdee54f94109f945d7d945b2abf9589
Comment 3 Kristof Provost freebsd_committer 2021-07-01 09:47:38 UTC
Try https://reviews.freebsd.org/D30974

I'd expect it to just apply to stable/12 too.
Comment 4 Marek Zarychta 2021-07-01 11:48:00 UTC
Affected counters work fine again in my case after applying the proposed patch. Thank you for the fix.
Comment 5 commit-hook freebsd_committer 2021-07-01 19:36:19 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8f76eebce424de064f65fec5cdd105446a2de3bd

commit 8f76eebce424de064f65fec5cdd105446a2de3bd
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-07-01 07:42:34 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-07-01 19:34:08 +0000

    dummynet: fix sysctls

    The sysctl nodes which use V_dn_cfg must be marked as CTLFLAG_VNET so
    that we use the correct per-vnet offset

    PR:             256819
    Reviewed by:    donner
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30974

 sys/netpfil/ipfw/ip_dn_io.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
Comment 6 commit-hook freebsd_committer 2021-07-08 11:50:55 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1975b8347df66301e4760df04f4fa74e8619fa07

commit 1975b8347df66301e4760df04f4fa74e8619fa07
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-07-01 07:42:34 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-07-08 06:46:45 +0000

    dummynet: fix sysctls

    The sysctl nodes which use V_dn_cfg must be marked as CTLFLAG_VNET so
    that we use the correct per-vnet offset

    PR:             256819
    Reviewed by:    donner
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30974

    (cherry picked from commit 8f76eebce424de064f65fec5cdd105446a2de3bd)

 sys/netpfil/ipfw/ip_dn_io.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)
Comment 7 commit-hook freebsd_committer 2021-07-08 11:50:58 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=aae1a783dd444060f9a9ed9cf0fbb0c3ba7c6800

commit aae1a783dd444060f9a9ed9cf0fbb0c3ba7c6800
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2021-07-01 07:42:34 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2021-07-08 06:49:56 +0000

    dummynet: fix sysctls

    The sysctl nodes which use V_dn_cfg must be marked as CTLFLAG_VNET so
    that we use the correct per-vnet offset

    PR:             256819
    Reviewed by:    donner
    MFC after:      1 week
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D30974

    (cherry picked from commit 8f76eebce424de064f65fec5cdd105446a2de3bd)

 sys/netpfil/ipfw/ip_dn_io.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)