FreeBSD Bugzilla – Attachment 190856 Details for
Bug 193953
vlan(4) on LACP lagg(4) do not update if_baudrate value and thus SNMP daemons do not provide high capacity counters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Another patch for FreeBSD 12-CURRENT
if_baudrate.diff (text/plain), 3.37 KB, created by
Andrey V. Elsukov
on 2018-02-21 14:08:51 UTC
(
hide
)
Description:
Another patch for FreeBSD 12-CURRENT
Filename:
MIME Type:
Creator:
Andrey V. Elsukov
Created:
2018-02-21 14:08:51 UTC
Size:
3.37 KB
patch
obsolete
>commit 13ef9fea77913c9f3fa82c9b548afc0f7c48d7d8 >Author: Andrey V. Elsukov <bu7cher@yandex.ru> >Date: Wed Jan 31 13:23:17 2018 +0300 > > Add IFNET_EVENT_UPDATE_BAUDRATE event and use it to update if_baudrate > for vlan interfaces created on the LACP lagg. > >diff --git a/sys/net/ieee8023ad_lacp.c b/sys/net/ieee8023ad_lacp.c >index 740294d7df2..36ced1b4464 100644 >--- a/sys/net/ieee8023ad_lacp.c >+++ b/sys/net/ieee8023ad_lacp.c >@@ -1049,6 +1049,8 @@ lacp_update_portmap(struct lacp_softc *lsc) > speed = lacp_aggregator_bandwidth(la); > } > sc->sc_ifp->if_baudrate = speed; >+ EVENTHANDLER_INVOKE(ifnet_event, sc->sc_ifp, >+ IFNET_EVENT_UPDATE_BAUDRATE); > > /* switch the active portmap over */ > atomic_store_rel_int(&lsc->lsc_activemap, newmap); >diff --git a/sys/net/if_var.h b/sys/net/if_var.h >index 9e62a497b25..1656562a2cf 100644 >--- a/sys/net/if_var.h >+++ b/sys/net/if_var.h >@@ -410,6 +410,7 @@ EVENTHANDLER_DECLARE(ifnet_link_event, ifnet_link_event_handler_t); > /* Interface up/down event */ > #define IFNET_EVENT_UP 0 > #define IFNET_EVENT_DOWN 1 >+#define IFNET_EVENT_UPDATE_BAUDRATE 2 > typedef void (*ifnet_event_fn)(void *, struct ifnet *ifp, int event); > EVENTHANDLER_DECLARE(ifnet_event, ifnet_event_fn); > #endif /* _SYS_EVENTHANDLER_H_ */ >diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c >index 7dd63a0f457..62b2a1bb7ef 100644 >--- a/sys/net/if_vlan.c >+++ b/sys/net/if_vlan.c >@@ -221,6 +221,7 @@ static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface"); > > static eventhandler_tag ifdetach_tag; > static eventhandler_tag iflladdr_tag; >+static eventhandler_tag ifevent_tag; > > /* > * if_vlan uses two module-level locks to allow concurrent modification of vlan >@@ -347,6 +348,7 @@ static int vlan_clone_destroy(struct if_clone *, struct ifnet *); > > static void vlan_ifdetach(void *arg, struct ifnet *ifp); > static void vlan_iflladdr(void *arg, struct ifnet *ifp); >+static void vlan_ifevent(void *arg, struct ifnet *ifp, int event); > > static void vlan_lladdr_fn(void *arg, int pending); > >@@ -651,6 +653,32 @@ vlan_setmulti(struct ifnet *ifp) > return (0); > } > >+/* >+ * A handler for interface ifnet events. >+ */ >+static void >+vlan_ifevent(void *arg __unused, struct ifnet *ifp, int event) >+{ >+ VLAN_LOCK_READER; >+ struct ifvlan *ifv; >+ struct ifvlantrunk *trunk; >+ >+ if (event != IFNET_EVENT_UPDATE_BAUDRATE) >+ return; >+ >+ VLAN_RLOCK(); >+ trunk = ifp->if_vlantrunk; >+ if (trunk == NULL) { >+ VLAN_RUNLOCK(); >+ return; >+ } >+ >+ VLAN_FOREACH(ifv, trunk) { >+ ifv->ifv_ifp->if_baudrate = ifp->if_baudrate; >+ } >+ VLAN_RUNLOCK(); >+} >+ > /* > * A handler for parent interface link layer address changes. > * If the parent interface link layer address is changed we >@@ -871,6 +899,10 @@ vlan_modevent(module_t mod, int type, void *data) > vlan_iflladdr, NULL, EVENTHANDLER_PRI_ANY); > if (iflladdr_tag == NULL) > return (ENOMEM); >+ ifevent_tag = EVENTHANDLER_REGISTER(ifnet_event, >+ vlan_ifevent, NULL, EVENTHANDLER_PRI_ANY); >+ if (ifevent_tag == NULL) >+ return (ENOMEM); > VLAN_LOCKING_INIT(); > vlan_input_p = vlan_input; > vlan_link_state_p = vlan_link_state; >@@ -900,6 +932,7 @@ vlan_modevent(module_t mod, int type, void *data) > #endif > EVENTHANDLER_DEREGISTER(ifnet_departure_event, ifdetach_tag); > EVENTHANDLER_DEREGISTER(iflladdr_event, iflladdr_tag); >+ EVENTHANDLER_DEREGISTER(ifnet_event, ifevent_tag); > vlan_input_p = NULL; > vlan_link_state_p = NULL; > vlan_trunk_cap_p = NULL;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 193953
:
190855
| 190856