svn commit: r337873 - in head/sys/dev/cxgbe: . tom

Navdeep Parhar np at FreeBSD.org
Wed Aug 15 21:24:07 UTC 2018


Author: np
Date: Wed Aug 15 21:24:05 2018
New Revision: 337873
URL: https://svnweb.freebsd.org/changeset/base/337873

Log:
  cxgbe(4): Use VLAN_TRUNKDEV instead of private cookie to figure out the
  parent of a VLAN ifnet.
  
  MFC after:	1 week
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_connect.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Wed Aug 15 21:21:16 2018	(r337872)
+++ head/sys/dev/cxgbe/adapter.h	Wed Aug 15 21:24:05 2018	(r337873)
@@ -194,8 +194,6 @@ struct vi_info {
 	uint16_t rss_size;	/* size of VI's RSS table slice */
 	uint16_t rss_base;	/* start of VI's RSS table slice */
 
-	eventhandler_tag vlan_c;
-
 	int nintr;
 	int first_intr;
 

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Aug 15 21:21:16 2018	(r337872)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Aug 15 21:24:05 2018	(r337873)
@@ -544,7 +544,6 @@ static void get_regs(struct adapter *, struct t4_regdu
 static void vi_refresh_stats(struct adapter *, struct vi_info *);
 static void cxgbe_refresh_stats(struct adapter *, struct port_info *);
 static void cxgbe_tick(void *);
-static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t);
 static void cxgbe_sysctls(struct port_info *);
 static int sysctl_int_array(SYSCTL_HANDLER_ARGS);
 static int sysctl_bitfield_8b(SYSCTL_HANDLER_ARGS);
@@ -1522,9 +1521,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi)
 	ifp->if_hw_tsomaxsegcount = TX_SGL_SEGS;
 	ifp->if_hw_tsomaxsegsize = 65536;
 
-	vi->vlan_c = EVENTHANDLER_REGISTER(vlan_config, cxgbe_vlan_config, ifp,
-	    EVENTHANDLER_PRI_ANY);
-
 	ether_ifattach(ifp, vi->hw_addr);
 #ifdef DEV_NETMAP
 	if (ifp->if_capabilities & IFCAP_NETMAP)
@@ -1602,9 +1598,6 @@ cxgbe_vi_detach(struct vi_info *vi)
 
 	ether_ifdetach(ifp);
 
-	if (vi->vlan_c)
-		EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c);
-
 	/* Let detach proceed even if these fail. */
 #ifdef DEV_NETMAP
 	if (ifp->if_capabilities & IFCAP_NETMAP)
@@ -5459,18 +5452,6 @@ vi_tick(void *arg)
 	vi_refresh_stats(sc, vi);
 
 	callout_schedule(&vi->tick, hz);
-}
-
-static void
-cxgbe_vlan_config(void *arg, struct ifnet *ifp, uint16_t vid)
-{
-	struct ifnet *vlan;
-
-	if (arg != ifp || ifp->if_type != IFT_ETHER)
-		return;
-
-	vlan = VLAN_DEVAT(ifp, vid);
-	VLAN_SETCOOKIE(vlan, ifp);
 }
 
 /*

Modified: head/sys/dev/cxgbe/tom/t4_connect.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_connect.c	Wed Aug 15 21:21:16 2018	(r337872)
+++ head/sys/dev/cxgbe/tom/t4_connect.c	Wed Aug 15 21:24:05 2018	(r337873)
@@ -335,7 +335,7 @@ t4_connect(struct toedev *tod, struct socket *so, stru
 	if (rt_ifp->if_type == IFT_ETHER)
 		vi = rt_ifp->if_softc;
 	else if (rt_ifp->if_type == IFT_L2VLAN) {
-		struct ifnet *ifp = VLAN_COOKIE(rt_ifp);
+		struct ifnet *ifp = VLAN_TRUNKDEV(rt_ifp);
 
 		vi = ifp->if_softc;
 		VLAN_TAG(rt_ifp, &vid);


More information about the svn-src-all mailing list