Date: Fri, 5 Aug 2016 14:06:10 GMT From: vincenzo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r307232 - soc2016/vincenzo/head/usr.sbin/bhyve Message-ID: <201608051406.u75E6AaN000991@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vincenzo Date: Fri Aug 5 14:06:09 2016 New Revision: 307232 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307232 Log: bhyve: net_backends: fix get_ptnetmap implementation Modified: soc2016/vincenzo/head/usr.sbin/bhyve/net_backends.c soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c Modified: soc2016/vincenzo/head/usr.sbin/bhyve/net_backends.c ============================================================================== --- soc2016/vincenzo/head/usr.sbin/bhyve/net_backends.c Fri Aug 5 14:05:23 2016 (r307231) +++ soc2016/vincenzo/head/usr.sbin/bhyve/net_backends.c Fri Aug 5 14:06:09 2016 (r307232) @@ -445,8 +445,9 @@ { struct netmap_priv *priv; - /* Check that this is a netmap backend. */ - if (!be || be->set_cap != netmap_set_cap) { + /* Check that this is a ptnetmap backend. */ + if (!be || be->set_cap != netmap_set_cap || + !(priv->nmd->req.nr_flags & NR_PTNETMAP_HOST)) { return NULL; } @@ -613,11 +614,11 @@ goto err; } + priv->ptnetmap.netmap_priv = priv; + priv->ptnetmap.features = NET_PTN_FEATURES_BASE; + priv->ptnetmap.acked_features = 0; + priv->ptnetmap.running = 0; if (ptnetmap) { - priv->ptnetmap.netmap_priv = priv; - priv->ptnetmap.features = NET_PTN_FEATURES_BASE; - priv->ptnetmap.acked_features = 0; - priv->ptnetmap.running = 0; if (netmap_has_vnet_hdr_len(be, VNET_HDR_LEN)) { priv->ptnetmap.features |= NET_PTN_FEATURES_VNET_HDR; } Modified: soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c ============================================================================== --- soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c Fri Aug 5 14:05:23 2016 (r307231) +++ soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c Fri Aug 5 14:06:09 2016 (r307232) @@ -367,7 +367,6 @@ /* Initialize registers and data structures. */ memset(sc->ioregs, 0, sizeof(sc->ioregs)); sc->csb = NULL; - sc->ptbe = NULL; sc->ioregs[PTNET_IO_MAC_HI >> 2] = (macaddr[0] << 8) | macaddr[1]; sc->ioregs[PTNET_IO_MAC_LO >> 2] = (macaddr[2] << 24) | (macaddr[3] << 16) |
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608051406.u75E6AaN000991>