git: 401f03445e4a - main - lagg(4): Correctly define some sysctl variables

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 17 Apr 2023 10:26:27 UTC
The branch main has been updated by zlei:

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(-)

diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c
index c07deb3217fa..1b90d1220722 100644
--- a/sys/net/if_lagg.c
+++ b/sys/net/if_lagg.c
@@ -276,22 +276,22 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, failover_rx_all, CTLFLAG_RW | CTLFLAG_VNET,
 /* Default value for using flowid */
 VNET_DEFINE_STATIC(int, def_use_flowid) = 0;
 #define	V_def_use_flowid	VNET(def_use_flowid)
-SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN,
-    &VNET_NAME(def_use_flowid), 0,
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid,
+    CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(def_use_flowid), 0,
     "Default setting for using flow id for load sharing");
 
 /* Default value for using numa */
 VNET_DEFINE_STATIC(int, def_use_numa) = 1;
 #define	V_def_use_numa	VNET(def_use_numa)
-SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_numa, CTLFLAG_RWTUN,
-    &VNET_NAME(def_use_numa), 0,
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_numa,
+    CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(def_use_numa), 0,
     "Use numa to steer flows");
 
 /* Default value for flowid shift */
 VNET_DEFINE_STATIC(int, def_flowid_shift) = 16;
 #define	V_def_flowid_shift	VNET(def_flowid_shift)
-SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN,
-    &VNET_NAME(def_flowid_shift), 0,
+SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift,
+    CTLFLAG_RWTUN | CTLFLAG_VNET, &VNET_NAME(def_flowid_shift), 0,
     "Default setting for flowid shift for load sharing");
 
 static void