Date: Thu, 4 Jul 2013 17:57:27 +0000 (UTC) From: Bryan Venteicher <bryanv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252707 - in head: share/man/man4 sys/dev/virtio sys/dev/virtio/balloon sys/dev/virtio/block sys/dev/virtio/network sys/dev/virtio/pci sys/dev/virtio/scsi Message-ID: <201307041757.r64HvRfL087607@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bryanv Date: Thu Jul 4 17:57:26 2013 New Revision: 252707 URL: http://svnweb.freebsd.org/changeset/base/252707 Log: Merge virtio changes from projects/virtio Contains projects/virtio commits: r245738: virtio: Minor man page tweaks r246060: virtio: Cleanup feature description printing r246306: virtio: Remove old debugging flag r247238: virtio: Remove PRIx64 macros from format strings r247239: virtio: Constify some fields r247240: virtio: Minor code simplifications r249962: virtio: Update to my freebsd.org email address MFC after: 1 month Modified: head/share/man/man4/virtio.4 head/share/man/man4/virtio_balloon.4 head/share/man/man4/virtio_blk.4 head/share/man/man4/virtio_scsi.4 head/share/man/man4/vtnet.4 head/sys/dev/virtio/balloon/virtio_balloon.c head/sys/dev/virtio/block/virtio_blk.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/virtio/network/if_vtnetvar.h head/sys/dev/virtio/pci/virtio_pci.c head/sys/dev/virtio/scsi/virtio_scsi.c head/sys/dev/virtio/scsi/virtio_scsivar.h head/sys/dev/virtio/virtio.c head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_bus_if.m head/sys/dev/virtio/virtio_if.m head/sys/dev/virtio/virtqueue.c head/sys/dev/virtio/virtqueue.h Modified: head/share/man/man4/virtio.4 ============================================================================== --- head/share/man/man4/virtio.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -53,10 +53,10 @@ This emulation is often inefficient. .Pp VirtIO defines an interface for efficient I/O between the hypervisor and VM. The -.Xr virtio 4 +.Nm module provides a shared memory transport called a virtqueue. The -.Xr virtio_pci 4 +.Xr virtio_pci device driver represents an emulated PCI device that the hypervisor makes available to the VM. This device provides the probing, configuration, and @@ -94,4 +94,4 @@ Support for VirtIO first appeared in .An -nosplit .Fx support for VirtIO was first added by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . Modified: head/share/man/man4/virtio_balloon.4 ============================================================================== --- head/share/man/man4/virtio_balloon.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_balloon.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -59,6 +59,6 @@ The hypervisor can later signal the ball The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . Modified: head/share/man/man4/virtio_blk.4 ============================================================================== --- head/share/man/man4/virtio_blk.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_blk.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -87,6 +87,6 @@ be toggled between writethrough and writ The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . Modified: head/share/man/man4/virtio_scsi.4 ============================================================================== --- head/share/man/man4/virtio_scsi.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/virtio_scsi.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -87,6 +87,6 @@ Enable tracing prints. The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 10.0 . Modified: head/share/man/man4/vtnet.4 ============================================================================== --- head/share/man/man4/vtnet.4 Thu Jul 4 17:55:58 2013 (r252706) +++ head/share/man/man4/vtnet.4 Thu Jul 4 17:57:26 2013 (r252707) @@ -89,7 +89,7 @@ The default value is 0. The .Nm driver was written by -.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +.An Bryan Venteicher Aq bryanv@FreeBSD.org . It first appeared in .Fx 9.0 . .Sh CAVEATS Modified: head/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/balloon/virtio_balloon.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/block/virtio_blk.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/network/if_vtnet.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/network/if_vtnetvar.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/pci/virtio_pci.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -487,9 +487,6 @@ vtpci_alloc_virtqueues(device_t dev, int if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) - sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (idx = 0; idx < nvqs; idx++) { vqx = &sc->vtpci_vqx[idx]; info = &vq_info[idx]; Modified: head/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/scsi/virtio_scsi.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2012, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/scsi/virtio_scsivar.h ============================================================================== --- head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/scsi/virtio_scsivar.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2012, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtio.c ============================================================================== --- head/sys/dev/virtio/virtio.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include <machine/bus.h> #include <machine/resource.h> -#include <machine/_inttypes.h> #include <sys/bus.h> #include <sys/rman.h> @@ -49,8 +48,8 @@ static int virtio_modevent(module_t, int static const char *virtio_feature_name(uint64_t, struct virtio_feature_desc *); static struct virtio_ident { - uint16_t devid; - char *name; + uint16_t devid; + const char *name; } virtio_ident_table[] = { { VIRTIO_ID_NETWORK, "Network" }, { VIRTIO_ID_BLOCK, "Block" }, @@ -87,9 +86,29 @@ virtio_device_name(uint16_t devid) return (NULL); } +static const char * +virtio_feature_name(uint64_t val, struct virtio_feature_desc *desc) +{ + int i, j; + struct virtio_feature_desc *descs[2] = { desc, + virtio_common_feature_desc }; + + for (i = 0; i < 2; i++) { + if (descs[i] == NULL) + continue; + + for (j = 0; descs[i][j].vfd_val != 0; j++) { + if (val == descs[i][j].vfd_val) + return (descs[i][j].vfd_str); + } + } + + return (NULL); +} + void virtio_describe(device_t dev, const char *msg, - uint64_t features, struct virtio_feature_desc *feature_desc) + uint64_t features, struct virtio_feature_desc *desc) { struct sbuf sb; uint64_t val; @@ -98,13 +117,12 @@ virtio_describe(device_t dev, const char int n; if ((buf = malloc(512, M_TEMP, M_NOWAIT)) == NULL) { - device_printf(dev, "%s features: 0x%"PRIx64"\n", msg, - features); + device_printf(dev, "%s features: %#jx\n", msg, (uintmax_t) features); return; } sbuf_new(&sb, buf, 512, SBUF_FIXEDLEN); - sbuf_printf(&sb, "%s features: 0x%"PRIx64, msg, features); + sbuf_printf(&sb, "%s features: %#jx", msg, (uintmax_t) features); for (n = 0, val = 1ULL << 63; val != 0; val >>= 1) { /* @@ -119,15 +137,9 @@ virtio_describe(device_t dev, const char else sbuf_cat(&sb, ","); - name = NULL; - if (feature_desc != NULL) - name = virtio_feature_name(val, feature_desc); + name = virtio_feature_name(val, desc); if (name == NULL) - name = virtio_feature_name(val, - virtio_common_feature_desc); - - if (name == NULL) - sbuf_printf(&sb, "0x%"PRIx64, val); + sbuf_printf(&sb, "%#jx", (uintmax_t) val); else sbuf_cat(&sb, name); } @@ -147,18 +159,6 @@ virtio_describe(device_t dev, const char free(buf, M_TEMP); } -static const char * -virtio_feature_name(uint64_t val, struct virtio_feature_desc *feature_desc) -{ - int i; - - for (i = 0; feature_desc[i].vfd_val != 0; i++) - if (val == feature_desc[i].vfd_val) - return (feature_desc[i].vfd_str); - - return (NULL); -} - /* * VirtIO bus method wrappers. */ @@ -251,13 +251,12 @@ virtio_modevent(module_t mod, int type, { int error; - error = 0; - switch (type) { case MOD_LOAD: case MOD_QUIESCE: case MOD_UNLOAD: case MOD_SHUTDOWN: + error = 0; break; default: error = EOPNOTSUPP; Modified: head/sys/dev/virtio/virtio.h ============================================================================== --- head/sys/dev/virtio/virtio.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio.h Thu Jul 4 17:57:26 2013 (r252707) @@ -99,7 +99,7 @@ struct vq_alloc_info; struct virtio_feature_desc { uint64_t vfd_val; - char *vfd_str; + const char *vfd_str; }; const char *virtio_device_name(uint16_t devid); Modified: head/sys/dev/virtio/virtio_bus_if.m ============================================================================== --- head/sys/dev/virtio/virtio_bus_if.m Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio_bus_if.m Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> +# Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -50,9 +50,6 @@ METHOD int alloc_virtqueues { int nvqs; struct vq_alloc_info *info; }; -HEADER { -#define VIRTIO_ALLOC_VQS_DISABLE_MSIX 0x1 -}; METHOD int setup_intr { device_t dev; Modified: head/sys/dev/virtio/virtio_if.m ============================================================================== --- head/sys/dev/virtio/virtio_if.m Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtio_if.m Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ #- -# Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> +# Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtqueue.c ============================================================================== --- head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtqueue.c Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/virtio/virtqueue.h ============================================================================== --- head/sys/dev/virtio/virtqueue.h Thu Jul 4 17:55:58 2013 (r252706) +++ head/sys/dev/virtio/virtqueue.h Thu Jul 4 17:57:26 2013 (r252707) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011, Bryan Venteicher <bryanv@daemoninthecloset.org> + * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307041757.r64HvRfL087607>