mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-25 16:13:17 +00:00
This commit adds the missing release mechanism for the
ratelimiting code. The two modules (lagg and vlan) did have allocation routines, and even though they are indirect (and vector down to the underlying interfaces) they both need to have a free routine (that also vectors down to the actual interface). Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D19032
This commit is contained in:
parent
2a021abd9e
commit
fa91f84502
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=344099
@ -133,6 +133,7 @@ static int lagg_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
static int lagg_snd_tag_alloc(struct ifnet *,
|
||||
union if_snd_tag_alloc_params *,
|
||||
struct m_snd_tag **);
|
||||
static void lagg_snd_tag_free(struct m_snd_tag *);
|
||||
#endif
|
||||
static int lagg_setmulti(struct lagg_port *);
|
||||
static int lagg_clrmulti(struct lagg_port *);
|
||||
@ -514,6 +515,7 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params)
|
||||
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
|
||||
#ifdef RATELIMIT
|
||||
ifp->if_snd_tag_alloc = lagg_snd_tag_alloc;
|
||||
ifp->if_snd_tag_free = lagg_snd_tag_free;
|
||||
#endif
|
||||
ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS;
|
||||
|
||||
@ -1568,6 +1570,13 @@ lagg_snd_tag_alloc(struct ifnet *ifp,
|
||||
/* forward allocation request */
|
||||
return (ifp->if_snd_tag_alloc(ifp, params, ppmt));
|
||||
}
|
||||
|
||||
static void
|
||||
lagg_snd_tag_free(struct m_snd_tag *tag)
|
||||
{
|
||||
tag->ifp->if_snd_tag_free(tag);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int
|
||||
|
@ -267,6 +267,7 @@ static int vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr);
|
||||
#ifdef RATELIMIT
|
||||
static int vlan_snd_tag_alloc(struct ifnet *,
|
||||
union if_snd_tag_alloc_params *, struct m_snd_tag **);
|
||||
static void vlan_snd_tag_free(struct m_snd_tag *);
|
||||
#endif
|
||||
static void vlan_qflush(struct ifnet *ifp);
|
||||
static int vlan_setflag(struct ifnet *ifp, int flag, int status,
|
||||
@ -1047,6 +1048,7 @@ vlan_clone_create(struct if_clone *ifc, char *name, size_t len, caddr_t params)
|
||||
ifp->if_ioctl = vlan_ioctl;
|
||||
#ifdef RATELIMIT
|
||||
ifp->if_snd_tag_alloc = vlan_snd_tag_alloc;
|
||||
ifp->if_snd_tag_free = vlan_snd_tag_free;
|
||||
#endif
|
||||
ifp->if_flags = VLAN_IFFLAGS;
|
||||
ether_ifattach(ifp, eaddr);
|
||||
@ -1934,4 +1936,10 @@ vlan_snd_tag_alloc(struct ifnet *ifp,
|
||||
/* forward allocation request */
|
||||
return (ifp->if_snd_tag_alloc(ifp, params, ppmt));
|
||||
}
|
||||
|
||||
static void
|
||||
vlan_snd_tag_free(struct m_snd_tag *tag)
|
||||
{
|
||||
tag->ifp->if_snd_tag_free(tag);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user