Date: Sun, 17 Aug 2014 10:25:28 +0000 (UTC) From: Luigi Rizzo <luigi@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270097 - head/sys/dev/netmap Message-ID: <201408171025.s7HAPSj4026843@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: luigi Date: Sun Aug 17 10:25:27 2014 New Revision: 270097 URL: http://svnweb.freebsd.org/changeset/base/270097 Log: staticize two functions, and use proper format for a struct sglist (reported by bz) Modified: head/sys/dev/netmap/if_vtnet_netmap.h Modified: head/sys/dev/netmap/if_vtnet_netmap.h ============================================================================== --- head/sys/dev/netmap/if_vtnet_netmap.h Sun Aug 17 09:44:42 2014 (r270096) +++ head/sys/dev/netmap/if_vtnet_netmap.h Sun Aug 17 10:25:27 2014 (r270097) @@ -42,7 +42,7 @@ * and need to be freed; * - buffers queued by netmap return the txq/rxq, and do not need work */ -void +static void vtnet_netmap_free_bufs(struct SOFTC_T* sc) { int i, nmb = 0, n = 0, last; @@ -80,7 +80,7 @@ vtnet_netmap_free_bufs(struct SOFTC_T* s } /* Register and unregister. */ -int +static int vtnet_netmap_reg(struct netmap_adapter *na, int onoff) { struct ifnet *ifp = na->ifp; @@ -237,7 +237,7 @@ vtnet_refill_rxq(struct netmap_kring *kr /* use a local sglist, default might be short */ struct sglist_seg ss[2]; - struct sglist sg[1] = { ss, 0, 0, 2}; + struct sglist sg = { ss, 0, 0, 2 }; for (n = 0; nm_i != head; n++) { static struct virtio_net_hdr_mrg_rxbuf hdr; @@ -252,11 +252,11 @@ vtnet_refill_rxq(struct netmap_kring *kr } slot->flags &= ~NS_BUF_CHANGED; - sglist_reset(sg); // cheap - err = sglist_append(sg, &hdr, sc->vtnet_hdr_size); - err = sglist_append_phys(sg, paddr, NETMAP_BUF_SIZE(na)); + sglist_reset(&sg); // cheap + err = sglist_append(&sg, &hdr, sc->vtnet_hdr_size); + err = sglist_append_phys(&sg, paddr, NETMAP_BUF_SIZE(na)); /* writable for the host */ - err = virtqueue_enqueue(vq, rxq, sg, 0, sg->sg_nseg); + err = virtqueue_enqueue(vq, rxq, &sg, 0, sg.sg_nseg); if (err < 0) { D("virtqueue_enqueue failed"); break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408171025.s7HAPSj4026843>