Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2019 05:01:34 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r346878 - in stable/11/sys/dev/cxgbe: . tom
Message-ID:  <201904290501.x3T51YJA016631@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Mon Apr 29 05:01:34 2019
New Revision: 346878
URL: https://svnweb.freebsd.org/changeset/base/346878

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

Modified:
  stable/11/sys/dev/cxgbe/adapter.h
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/cxgbe/tom/t4_connect.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/11/sys/dev/cxgbe/adapter.h	Mon Apr 29 04:51:30 2019	(r346877)
+++ stable/11/sys/dev/cxgbe/adapter.h	Mon Apr 29 05:01:34 2019	(r346878)
@@ -195,8 +195,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: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c	Mon Apr 29 04:51:30 2019	(r346877)
+++ stable/11/sys/dev/cxgbe/t4_main.c	Mon Apr 29 05:01:34 2019	(r346878)
@@ -617,7 +617,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);
@@ -1614,9 +1613,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 (vi->nnmrxq != 0)
@@ -1682,9 +1678,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)
@@ -5644,18 +5637,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: stable/11/sys/dev/cxgbe/tom/t4_connect.c
==============================================================================
--- stable/11/sys/dev/cxgbe/tom/t4_connect.c	Mon Apr 29 04:51:30 2019	(r346877)
+++ stable/11/sys/dev/cxgbe/tom/t4_connect.c	Mon Apr 29 05:01:34 2019	(r346878)
@@ -332,7 +332,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904290501.x3T51YJA016631>