Bug 270705 - lagg(4): sysctl net.link.lagg.default_use_flowid does not work
Summary: lagg(4): sysctl net.link.lagg.default_use_flowid does not work
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Zhenlei Huang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-08 15:34 UTC by Zhenlei Huang
Modified: 2023-04-21 10:29 UTC (History)
0 users

See Also:
zlei: mfc-stable13+
zlei: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhenlei Huang freebsd_committer freebsd_triage 2023-04-08 15:34:57 UTC
Tested on current and stable/13.

Steps to repeat:

```
# kldload -nq if_lagg
# sysctl net.link.lagg.default_use_flowid=1
net.link.lagg.default_use_flowid: 0 -> 1
# ifconfig lagg create
lagg0
# ifconfig -v lagg0
lagg0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=800000<>
	ether 00:00:00:00:00:00
	laggproto failover lagghash l2,l3,l4
	lagg options:
		flags=4<USE_NUMA>
		flowid_shift: 16
	lagg statistics:
		active ports: 0
		flapping: 0
	groups: lagg
	media: Ethernet autoselect
	status: no carrier
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
```

Pay attention to the lagg options from the output.
> flags=4<USE_NUMA>
flags should have `USE_FLOWID` .
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-04-17 10:27:23 UTC
A commit in branch main references this bug:

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

commit 401f03445e4aa42960e337604560593c7096e589
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-17 10:24:35 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-17 10:24:35 +0000

    lagg(4): Correctly define some sysctl variables

    939a050ad96c virtualized lagg(4), but the corresponding sysctl of some
    virtualized global variables are not marked with CTLFLAG_VNET. A try to
    operate on those variables via sysctl will effectively go to the 'master'
    copies and the virtualized ones are not read or set accordingly. As a
    side effect, on updating the 'master' copy, the virtualized global
    variables of newly created vnets will have correct values.

    PR:             270705
    Reviewed by:    kp
    Fixes:          939a050ad96c Virtualize lagg(4) cloner
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39467

 sys/net/if_lagg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-04-21 10:12:08 UTC
A commit in branch stable/13 references this bug:

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

commit 774a2ee9ad7a512c5faf0fc30b13aa1de33ceb2f
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-17 10:24:35 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-21 10:10:12 +0000

    lagg(4): Correctly define some sysctl variables

    939a050ad96c virtualized lagg(4), but the corresponding sysctl of some
    virtualized global variables are not marked with CTLFLAG_VNET. A try to
    operate on those variables via sysctl will effectively go to the 'master'
    copies and the virtualized ones are not read or set accordingly. As a
    side effect, on updating the 'master' copy, the virtualized global
    variables of newly created vnets will have correct values.

    PR:             270705
    Reviewed by:    kp
    Fixes:          939a050ad96c Virtualize lagg(4) cloner
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39467

    (cherry picked from commit 401f03445e4aa42960e337604560593c7096e589)

 sys/net/if_lagg.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-04-21 10:18:09 UTC
A commit in branch stable/12 references this bug:

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

commit 673685a50aeb090b81bbd84f5c606728e00aba68
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2023-04-17 10:24:35 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2023-04-21 10:16:10 +0000

    lagg(4): Correctly define some sysctl variables

    939a050ad96c virtualized lagg(4), but the corresponding sysctl of some
    virtualized global variables are not marked with CTLFLAG_VNET. A try to
    operate on those variables via sysctl will effectively go to the 'master'
    copies and the virtualized ones are not read or set accordingly. As a
    side effect, on updating the 'master' copy, the virtualized global
    variables of newly created vnets will have correct values.

    PR:             270705
    Reviewed by:    kp
    Fixes:          939a050ad96c Virtualize lagg(4) cloner
    MFC after:      3 days
    Differential Revision:  https://reviews.freebsd.org/D39467

    (cherry picked from commit 401f03445e4aa42960e337604560593c7096e589)
    (cherry picked from commit 774a2ee9ad7a512c5faf0fc30b13aa1de33ceb2f)

 sys/net/if_lagg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)