svn commit: r344099 - head/sys/net

Randall Stewart rrs at FreeBSD.org
Wed Feb 13 14:58:01 UTC 2019


Author: rrs
Date: Wed Feb 13 14:57:59 2019
New Revision: 344099
URL: https://svnweb.freebsd.org/changeset/base/344099

Log:
  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

Modified:
  head/sys/net/if_lagg.c
  head/sys/net/if_vlan.c

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Wed Feb 13 14:39:16 2019	(r344098)
+++ head/sys/net/if_lagg.c	Wed Feb 13 14:57:59 2019	(r344099)
@@ -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, cadd
 	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

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c	Wed Feb 13 14:39:16 2019	(r344098)
+++ head/sys/net/if_vlan.c	Wed Feb 13 14:57:59 2019	(r344099)
@@ -267,6 +267,7 @@ static	int vlan_ioctl(struct ifnet *ifp, u_long cmd, c
 #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, si
 	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);
@@ -1933,5 +1935,11 @@ vlan_snd_tag_alloc(struct ifnet *ifp,
 		return (EOPNOTSUPP);
 	/* 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


More information about the svn-src-head mailing list