From owner-svn-src-head@freebsd.org Wed Aug 15 21:24:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC9B010715D7; Wed, 15 Aug 2018 21:24:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72C587D0EA; Wed, 15 Aug 2018 21:24:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A2CC1012C; Wed, 15 Aug 2018 21:24:06 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7FLO6Rg086722; Wed, 15 Aug 2018 21:24:06 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7FLO5Ss086720; Wed, 15 Aug 2018 21:24:05 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808152124.w7FLO5Ss086720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 15 Aug 2018 21:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337873 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . tom X-SVN-Commit-Revision: 337873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Aug 2018 21:24:07 -0000 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);