From owner-svn-src-all@freebsd.org Sun Jul 19 18:06:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 138829A667E; Sun, 19 Jul 2015 18:06:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 040DE1B8B; Sun, 19 Jul 2015 18:06:31 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6JI6UcT095852; Sun, 19 Jul 2015 18:06:30 GMT (envelope-from luigi@FreeBSD.org) Received: (from luigi@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6JI6UAO095851; Sun, 19 Jul 2015 18:06:30 GMT (envelope-from luigi@FreeBSD.org) Message-Id: <201507191806.t6JI6UAO095851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luigi set sender to luigi@FreeBSD.org using -f From: Luigi Rizzo Date: Sun, 19 Jul 2015 18:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285698 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2015 18:06:31 -0000 Author: luigi Date: Sun Jul 19 18:06:30 2015 New Revision: 285698 URL: https://svnweb.freebsd.org/changeset/base/285698 Log: properly destroy persistent vale ports Modified: head/sys/dev/netmap/netmap_vale.c Modified: head/sys/dev/netmap/netmap_vale.c ============================================================================== --- head/sys/dev/netmap/netmap_vale.c Sun Jul 19 18:05:49 2015 (r285697) +++ head/sys/dev/netmap/netmap_vale.c Sun Jul 19 18:06:30 2015 (r285698) @@ -506,17 +506,6 @@ netmap_vp_dtor(struct netmap_adapter *na } } -/* nm_dtor callback for persistent VALE ports */ -static void -netmap_persist_vp_dtor(struct netmap_adapter *na) -{ - struct ifnet *ifp = na->ifp; - - netmap_vp_dtor(na); - na->ifp = NULL; - nm_vi_detach(ifp); -} - /* remove a persistent VALE port from the system */ static int nm_vi_destroy(const char *name) @@ -546,6 +535,7 @@ nm_vi_destroy(const char *name) */ if_rele(ifp); netmap_detach(ifp); + nm_vi_detach(ifp); return 0; err: @@ -587,7 +577,6 @@ nm_vi_create(struct nmreq *nmr) } /* persist-specific routines */ vpna->up.nm_bdg_ctl = netmap_vp_bdg_ctl; - vpna->up.nm_dtor = netmap_persist_vp_dtor; netmap_adapter_get(&vpna->up); NMG_UNLOCK(); D("created %s", ifp->if_xname); @@ -1823,6 +1812,11 @@ netmap_vp_create(struct nmreq *nmr, stru D("max frame size %u", vpna->mfs); na->na_flags |= NAF_BDG_MAYSLEEP; + /* persistent VALE ports look like hw devices + * with a native netmap adapter + */ + if (ifp) + na->na_flags |= NAF_NATIVE; na->nm_txsync = netmap_vp_txsync; na->nm_rxsync = netmap_vp_rxsync; na->nm_register = netmap_vp_reg;