svn commit: r253471 - in head/sys: dev/drm2/i915 kern vm

2013-07-19 Thread John Baldwin
Author: jhb
Date: Fri Jul 19 19:06:15 2013
New Revision: 253471
URL: http://svnweb.freebsd.org/changeset/base/253471

Log:
  Be more aggressive in using superpages in all mappings of objects:
  - Add a new address space allocation method (VMFS_OPTIMAL_SPACE) for
vm_map_find() that will try to alter the alignment of a mapping to match
any existing superpage mappings of the object being mapped.  If no
suitable address range is found with the necessary alignment,
vm_map_find() will fall back to using the simple first-fit strategy
(VMFS_ANY_SPACE).
  - Change mmap() without MAP_FIXED, shmat(), and the GEM mapping ioctl to
use VMFS_OPTIMAL_SPACE instead of VMFS_ANY_SPACE.
  
  Reviewed by:  alc (earlier version)
  MFC after:2 weeks

Modified:
  head/sys/dev/drm2/i915/i915_gem.c
  head/sys/kern/sysv_shm.c
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_mmap.c

Modified: head/sys/dev/drm2/i915/i915_gem.c
==
--- head/sys/dev/drm2/i915/i915_gem.c   Fri Jul 19 12:43:20 2013
(r253470)
+++ head/sys/dev/drm2/i915/i915_gem.c   Fri Jul 19 19:06:15 2013
(r253471)
@@ -1289,7 +1289,7 @@ i915_gem_mmap_ioctl(struct drm_device *d
vm_object_reference(obj->vm_obj);
DRM_UNLOCK(dev);
rv = vm_map_find(map, obj->vm_obj, args->offset, &addr, args->size,
-   VMFS_ANY_SPACE, VM_PROT_READ | VM_PROT_WRITE,
+   VMFS_OPTIMAL_SPACE, VM_PROT_READ | VM_PROT_WRITE,
VM_PROT_READ | VM_PROT_WRITE, MAP_SHARED);
if (rv != KERN_SUCCESS) {
vm_object_deallocate(obj->vm_obj);

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cFri Jul 19 12:43:20 2013(r253470)
+++ head/sys/kern/sysv_shm.cFri Jul 19 19:06:15 2013(r253471)
@@ -414,7 +414,7 @@ kern_shmat(td, shmid, shmaddr, shmflg)
vm_object_reference(shmseg->object);
rv = vm_map_find(&p->p_vmspace->vm_map, shmseg->object,
0, &attach_va, size, (flags & MAP_FIXED) ? VMFS_NO_SPACE :
-   VMFS_ANY_SPACE, prot, prot, MAP_INHERIT_SHARE);
+   VMFS_OPTIMAL_SPACE, prot, prot, MAP_INHERIT_SHARE);
if (rv != KERN_SUCCESS) {
vm_object_deallocate(shmseg->object);
error = ENOMEM;

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cFri Jul 19 12:43:20 2013(r253470)
+++ head/sys/vm/vm_map.cFri Jul 19 19:06:15 2013(r253471)
@@ -1444,19 +1444,29 @@ vm_map_find(vm_map_t map, vm_object_t ob
vm_size_t length, int find_space, vm_prot_t prot,
vm_prot_t max, int cow)
 {
-   vm_offset_t start;
+   vm_offset_t start, initial_addr;
int result;
 
-   start = *addr;
+   if (find_space == VMFS_OPTIMAL_SPACE && (object == NULL ||
+   (object->flags & OBJ_COLORED) == 0))
+   find_space = VMFS_ANY_SPACE;
+   initial_addr = *addr;
+again:
+   start = initial_addr;
vm_map_lock(map);
do {
if (find_space != VMFS_NO_SPACE) {
if (vm_map_findspace(map, start, length, addr)) {
vm_map_unlock(map);
+   if (find_space == VMFS_OPTIMAL_SPACE) {
+   find_space = VMFS_ANY_SPACE;
+   goto again;
+   }
return (KERN_NO_SPACE);
}
switch (find_space) {
case VMFS_ALIGNED_SPACE:
+   case VMFS_OPTIMAL_SPACE:
pmap_align_superpage(object, offset, addr,
length);
break;
@@ -1473,11 +1483,11 @@ vm_map_find(vm_map_t map, vm_object_t ob
}
result = vm_map_insert(map, object, offset, start, start +
length, prot, max, cow);
-   } while (result == KERN_NO_SPACE && (find_space == VMFS_ALIGNED_SPACE
+   } while (result == KERN_NO_SPACE && (find_space == VMFS_ALIGNED_SPACE ||
 #ifdef VMFS_TLB_ALIGNED_SPACE
-   || find_space == VMFS_TLB_ALIGNED_SPACE
+   find_space == VMFS_TLB_ALIGNED_SPACE ||
 #endif
-   ));
+   find_space == VMFS_OPTIMAL_SPACE));
vm_map_unlock(map);
return (result);
 }

Modified: head/sys/vm/vm_map.h
==
--- head/sys/vm/vm_map.hFri Jul 19 12:43:20 2013(r253470)
+++ head/sys/vm/vm_map.hFri Jul 19 19:06:15 2013(r253471)
@@ -343,9 +343,10 @@ long vmspace_resident_count(struct vmspa
  */
 #defineVMFS_NO_SPACE 

Re: svn commit: r253471 - in head/sys: dev/drm2/i915 kern vm

2013-07-19 Thread John Baldwin
On Friday, July 19, 2013 3:06:16 pm John Baldwin wrote:
> Author: jhb
> Date: Fri Jul 19 19:06:15 2013
> New Revision: 253471
> URL: http://svnweb.freebsd.org/changeset/base/253471
> 
> Log:
>   Be more aggressive in using superpages in all mappings of objects:
>   - Add a new address space allocation method (VMFS_OPTIMAL_SPACE) for
> vm_map_find() that will try to alter the alignment of a mapping to match
> any existing superpage mappings of the object being mapped.  If no
> suitable address range is found with the necessary alignment,
> vm_map_find() will fall back to using the simple first-fit strategy
> (VMFS_ANY_SPACE).
>   - Change mmap() without MAP_FIXED, shmat(), and the GEM mapping ioctl to
> use VMFS_OPTIMAL_SPACE instead of VMFS_ANY_SPACE.

In particular, the first mapping of an object that uses superpages establishes
an overall offset within that object of each superpages.  Other mappings of 
the same object can only use superpages if their mappings use the same 
superpage-offset relative to the start of the object.  As a specific example:

Suppose process A maps a file F starting at offset 0 and the address assigned 
by mmap happens to be superpage aligned.  Then, the first superpage-sized 
bytes of F will be stored in a superpage, the second superpage-sized bytes in 
a superpage, etc.

If process B then maps the same file F at offset 0, but mmap() returns an 
address that is not superpage-aligned, then none of the potential superpage
mappings in B can work because the virtual "superpage" addresses are not 
aligned with the physical superpage addresses assigned to F by A's mapping.

What this change does is cause mmap() to first try to find an address that has
the same alignment as A during B's mmap() request so that both processes can 
use superpages for F.

In addition this may alleviate a known performance issue on certain AMD 
processors by forcing virtual aliases of text segments in binaries and shared 
libraries to use the same relative alignment.  The issue is documented in more 
detail here:

http://developer.amd.com/wordpress/media/2012/10/SharedL1InstructionCacheonAMD15hCPU.pdf

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253472 - head/sys/netinet

2013-07-19 Thread Michael Tuexen
Author: tuexen
Date: Fri Jul 19 21:16:59 2013
New Revision: 253472
URL: http://svnweb.freebsd.org/changeset/base/253472

Log:
  Get the code compiling without INET and INET6 being defined.
  This is not possible in FreeBSD, but in the upstream code.
  
  MFC after: 2 weeks

Modified:
  head/sys/netinet/sctp_output.c

Modified: head/sys/netinet/sctp_output.c
==
--- head/sys/netinet/sctp_output.c  Fri Jul 19 19:06:15 2013
(r253471)
+++ head/sys/netinet/sctp_output.c  Fri Jul 19 21:16:59 2013
(r253472)
@@ -4543,11 +4543,7 @@ sctp_send_initiate(struct sctp_inpcb *in
struct mbuf *m;
struct sctp_nets *net;
struct sctp_init_chunk *init;
-
-#if defined(INET) || defined(INET6)
struct sctp_supported_addr_param *sup_addr;
-
-#endif
struct sctp_adaptation_layer_indication *ali;
struct sctp_supported_chunk_types_param *pr_supported;
struct sctp_paramhdr *ph;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253473 - head/sys/dev/nvd

2013-07-19 Thread Jim Harris
Author: jimharris
Date: Fri Jul 19 21:30:53 2013
New Revision: 253473
URL: http://svnweb.freebsd.org/changeset/base/253473

Log:
  Do not call disk_create() until we have completed all initialization of our
  internal disk structure.
  
  Sponsored by: Intel
  Reviewed by:  carl
  MFC after:3 days

Modified:
  head/sys/dev/nvd/nvd.c

Modified: head/sys/dev/nvd/nvd.c
==
--- head/sys/dev/nvd/nvd.c  Fri Jul 19 21:16:59 2013(r253472)
+++ head/sys/dev/nvd/nvd.c  Fri Jul 19 21:30:53 2013(r253473)
@@ -318,8 +318,6 @@ nvd_new_disk(struct nvme_namespace *ns, 
min(sizeof(disk->d_descr), NVME_MODEL_NUMBER_LENGTH));
 #endif
 
-   disk_create(disk, DISK_VERSION);
-
ndisk->ns = ns;
ndisk->disk = disk;
ndisk->cur_depth = 0;
@@ -335,6 +333,8 @@ nvd_new_disk(struct nvme_namespace *ns, 
TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq);
TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq);
 
+   disk_create(disk, DISK_VERSION);
+
return (NULL);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253474 - in head: sbin/nvmecontrol sys/dev/nvme

2013-07-19 Thread Jim Harris
Author: jimharris
Date: Fri Jul 19 21:33:24 2013
New Revision: 253474
URL: http://svnweb.freebsd.org/changeset/base/253474

Log:
  Fix nvme(4) and nvd(4) to support non 512-byte sector sizes.
  
  Recent testing with QEMU that has variable sector size support for
  NVMe uncovered some of these issues.  Chatham prototype boards supported
  only 512 byte sectors.
  
  Sponsored by: Intel
  Reviewed by:  carl
  MFC after:3 days

Modified:
  head/sbin/nvmecontrol/devlist.c
  head/sys/dev/nvme/nvme_ns.c
  head/sys/dev/nvme/nvme_ns_cmd.c

Modified: head/sbin/nvmecontrol/devlist.c
==
--- head/sbin/nvmecontrol/devlist.c Fri Jul 19 21:30:53 2013
(r253473)
+++ head/sbin/nvmecontrol/devlist.c Fri Jul 19 21:33:24 2013
(r253474)
@@ -53,7 +53,7 @@ static inline uint32_t
 ns_get_sector_size(struct nvme_namespace_data *nsdata)
 {
 
-   return (1 << nsdata->lbaf[0].lbads);
+   return (1 << nsdata->lbaf[nsdata->flbas.format].lbads);
 }
 
 void

Modified: head/sys/dev/nvme/nvme_ns.c
==
--- head/sys/dev/nvme/nvme_ns.c Fri Jul 19 21:30:53 2013(r253473)
+++ head/sys/dev/nvme/nvme_ns.c Fri Jul 19 21:33:24 2013(r253474)
@@ -155,7 +155,7 @@ nvme_ns_get_max_io_xfer_size(struct nvme
 uint32_t
 nvme_ns_get_sector_size(struct nvme_namespace *ns)
 {
-   return (1 << ns->data.lbaf[0].lbads);
+   return (1 << ns->data.lbaf[ns->data.flbas.format].lbads);
 }
 
 uint64_t
@@ -310,6 +310,16 @@ nvme_ns_construct(struct nvme_namespace 
}
 #endif
 
+   /*
+* Note: format is a 0-based value, so > is appropriate here,
+*  not >=.
+*/
+   if (ns->data.flbas.format > ns->data.nlbaf) {
+   printf("lba format %d exceeds number supported (%d)\n",
+   ns->data.flbas.format, ns->data.nlbaf+1);
+   return (1);
+   }
+
if (ctrlr->cdata.oncs.dsm)
ns->flags |= NVME_NS_DEALLOCATE_SUPPORTED;
 

Modified: head/sys/dev/nvme/nvme_ns_cmd.c
==
--- head/sys/dev/nvme/nvme_ns_cmd.c Fri Jul 19 21:30:53 2013
(r253473)
+++ head/sys/dev/nvme/nvme_ns_cmd.c Fri Jul 19 21:33:24 2013
(r253474)
@@ -36,7 +36,8 @@ nvme_ns_cmd_read(struct nvme_namespace *
struct nvme_request *req;
struct nvme_command *cmd;
 
-   req = nvme_allocate_request_vaddr(payload, lba_count*512, cb_fn, 
cb_arg);
+   req = nvme_allocate_request_vaddr(payload,
+   lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg);
 
if (req == NULL)
return (ENOMEM);
@@ -89,8 +90,8 @@ nvme_ns_cmd_write(struct nvme_namespace 
struct nvme_request *req;
struct nvme_command *cmd;
 
-   req = nvme_allocate_request_vaddr(payload, lba_count*512, cb_fn,
-   cb_arg);
+   req = nvme_allocate_request_vaddr(payload,
+   lba_count*nvme_ns_get_sector_size(ns), cb_fn, cb_arg);
 
if (req == NULL)
return (ENOMEM);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253475 - in head/sys/dev: ahci ata ata/chipsets ichsmb ichwd

2013-07-19 Thread Jack F Vogel
Author: jfv
Date: Fri Jul 19 21:37:40 2013
New Revision: 253475
URL: http://svnweb.freebsd.org/changeset/base/253475

Log:
  Add new Coleto Creek device support: SATA, SMBus, and Watchdog devices.
  
  MFC after: 1 week

Modified:
  head/sys/dev/ahci/ahci.c
  head/sys/dev/ata/ata-pci.h
  head/sys/dev/ata/chipsets/ata-intel.c
  head/sys/dev/ichsmb/ichsmb_pci.c
  head/sys/dev/ichwd/ichwd.c
  head/sys/dev/ichwd/ichwd.h

Modified: head/sys/dev/ahci/ahci.c
==
--- head/sys/dev/ahci/ahci.cFri Jul 19 21:33:24 2013(r253474)
+++ head/sys/dev/ahci/ahci.cFri Jul 19 21:37:40 2013(r253475)
@@ -196,6 +196,7 @@ static struct {
{0x1e078086, 0x00, "Intel Panther Point",   0},
{0x1e0e8086, 0x00, "Intel Panther Point",   0},
{0x1e0f8086, 0x00, "Intel Panther Point",   0},
+   {0x23a38086, 0x00, "Intel Coleto Creek",0},
{0x8c028086, 0x00, "Intel Lynx Point",  0},
{0x8c038086, 0x00, "Intel Lynx Point",  0},
{0x8c048086, 0x00, "Intel Lynx Point",  0},

Modified: head/sys/dev/ata/ata-pci.h
==
--- head/sys/dev/ata/ata-pci.h  Fri Jul 19 21:33:24 2013(r253474)
+++ head/sys/dev/ata/ata-pci.h  Fri Jul 19 21:37:40 2013(r253475)
@@ -274,6 +274,10 @@ struct ata_pci_controller {
 #define ATA_ISCH0x811a8086
 #define ATA_DH89XXCC0x23238086
 
+#define ATA_COLETOCRK_AH1   0x23a38086
+#define ATA_COLETOCRK_S10x23a18086
+#define ATA_COLETOCRK_S20x23a68086
+
 #define ATA_ITE_ID  0x1283
 #define ATA_IT8211F 0x82111283
 #define ATA_IT8212F 0x82121283

Modified: head/sys/dev/ata/chipsets/ata-intel.c
==
--- head/sys/dev/ata/chipsets/ata-intel.c   Fri Jul 19 21:33:24 2013
(r253474)
+++ head/sys/dev/ata/chipsets/ata-intel.c   Fri Jul 19 21:37:40 2013
(r253475)
@@ -226,6 +226,9 @@ ata_intel_probe(device_t dev)
  { ATA_I31244,   0,  0, 2, ATA_SA150, "31244" },
  { ATA_ISCH, 0,  0, 1, ATA_UDMA5, "SCH" },
  { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" },
+ { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" },
+ { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" },
+ { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" },
  { 0, 0, 0, 0, 0, 0}};
 
 if (pci_get_vendor(dev) != ATA_INTEL_ID)

Modified: head/sys/dev/ichsmb/ichsmb_pci.c
==
--- head/sys/dev/ichsmb/ichsmb_pci.cFri Jul 19 21:33:24 2013
(r253474)
+++ head/sys/dev/ichsmb/ichsmb_pci.cFri Jul 19 21:37:40 2013
(r253475)
@@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$");
 #define ID_PATSBURG0x1d228086
 #define ID_CPT 0x1c228086
 #define ID_PPT 0x1e228086
+#define ID_COLETOCRK   0x23B08086 
 #define ID_LPT 0x8c228086
 
 #define PCIS_SERIALBUS_SMBUS_PROGIF0x00
@@ -192,6 +193,9 @@ ichsmb_pci_probe(device_t dev)
case ID_LPT:
device_set_desc(dev, "Intel Lynx Point SMBus controller");
break;
+   case ID_COLETOCRK:
+   device_set_desc(dev, "Intel Coleto Creek SMBus controller");
+   break;
default:
return (ENXIO);
}

Modified: head/sys/dev/ichwd/ichwd.c
==
--- head/sys/dev/ichwd/ichwd.c  Fri Jul 19 21:33:24 2013(r253474)
+++ head/sys/dev/ichwd/ichwd.c  Fri Jul 19 21:37:40 2013(r253475)
@@ -195,6 +195,7 @@ static struct ichwd_device ichwd_devices
{ DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 },
{ DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 },
{ DEVICEID_DH89XXCC_LPC,  "Intel DH89xxCC watchdog timer",  10 },
+   { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer",  10 },
{ 0, NULL, 0 },
 };
 

Modified: head/sys/dev/ichwd/ichwd.h
==
--- head/sys/dev/ichwd/ichwd.h  Fri Jul 19 21:33:24 2013(r253474)
+++ head/sys/dev/ichwd/ichwd.h  Fri Jul 19 21:37:40 2013(r253475)
@@ -126,6 +126,7 @@ struct ichwd_softc {
 #define DEVICEID_PPT30 0x1e5e
 #define DEVICEID_PPT31 0x1e5f
 #define DEVICEID_DH89XXCC_LPC  0x2310
+#define DEVICEID_COLETOCRK_LPC 0x2390
 #define DEVICEID_82801AA   0x2410
 #define DEVICEID_82801AB   0x2420
 #define DEVICEID_82801BA   0x2440
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-h

svn commit: r253477 - head/sys/dev/usb

2013-07-19 Thread Navdeep Parhar
Author: np
Date: Fri Jul 19 21:54:48 2013
New Revision: 253477
URL: http://svnweb.freebsd.org/changeset/base/253477

Log:
  There's nothing to free if the unit wasn't allocated.

Modified:
  head/sys/dev/usb/usb_pf.c

Modified: head/sys/dev/usb/usb_pf.c
==
--- head/sys/dev/usb/usb_pf.c   Fri Jul 19 21:40:57 2013(r253476)
+++ head/sys/dev/usb/usb_pf.c   Fri Jul 19 21:54:48 2013(r253477)
@@ -182,7 +182,6 @@ usbpf_clone_create(struct if_clone *ifc,
 
error = ifc_alloc_unit(ifc, &unit);
if (error) {
-   ifc_free_unit(ifc, unit);
device_printf(ubus->parent, "usbpf: Could not allocate "
"instance\n");
return (error);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253476 - in head: sbin/nvmecontrol sys/conf sys/dev/nvd sys/dev/nvme sys/modules/nvme

2013-07-19 Thread Jim Harris
Author: jimharris
Date: Fri Jul 19 21:40:57 2013
New Revision: 253476
URL: http://svnweb.freebsd.org/changeset/base/253476

Log:
  Add message when nvd disks are attached and detached.
  
  As part of this commit, add an nvme_strvis() function which borrows
  heavily from cam_strvis().  This will allow stripping of
  leading/trailing whitespace and also handle unprintable characters
  in model/serial numbers.  This function goes into a new nvme_util.c
  file which is used by both the driver and nvmecontrol.
  
  Sponsored by: Intel
  Reviewed by:  carl
  MFC after:3 days

Added:
  head/sys/dev/nvme/nvme_util.c   (contents, props changed)
Modified:
  head/sbin/nvmecontrol/Makefile
  head/sbin/nvmecontrol/devlist.c
  head/sbin/nvmecontrol/identify.c
  head/sys/conf/files.amd64
  head/sys/conf/files.i386
  head/sys/dev/nvd/nvd.c
  head/sys/dev/nvme/nvme.c
  head/sys/dev/nvme/nvme.h
  head/sys/modules/nvme/Makefile

Modified: head/sbin/nvmecontrol/Makefile
==
--- head/sbin/nvmecontrol/Makefile  Fri Jul 19 21:37:40 2013
(r253475)
+++ head/sbin/nvmecontrol/Makefile  Fri Jul 19 21:40:57 2013
(r253476)
@@ -2,7 +2,9 @@
 
 PROG=  nvmecontrol
 SRCS=  nvmecontrol.c devlist.c firmware.c identify.c logpage.c \
-   perftest.c reset.c
+   perftest.c reset.c nvme_util.c
 MAN=   nvmecontrol.8
 
+.PATH: ${.CURDIR}/../../sys/dev/nvme
+
 .include 

Modified: head/sbin/nvmecontrol/devlist.c
==
--- head/sbin/nvmecontrol/devlist.c Fri Jul 19 21:37:40 2013
(r253475)
+++ head/sbin/nvmecontrol/devlist.c Fri Jul 19 21:40:57 2013
(r253476)
@@ -62,6 +62,7 @@ devlist(int argc, char *argv[])
struct nvme_controller_data cdata;
struct nvme_namespace_data  nsdata;
charname[64];
+   uint8_t mn[64];
uint32_ti;
int ch, ctrlr, fd, found, ret;
 
@@ -91,7 +92,8 @@ devlist(int argc, char *argv[])
 
found++;
read_controller_data(fd, &cdata);
-   printf("%6s: %.*s\n", name, NVME_MODEL_NUMBER_LENGTH, cdata.mn);
+   nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH);
+   printf("%6s: %s\n", name, mn);
 
for (i = 0; i < cdata.nn; i++) {
sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr,

Modified: head/sbin/nvmecontrol/identify.c
==
--- head/sbin/nvmecontrol/identify.cFri Jul 19 21:37:40 2013
(r253475)
+++ head/sbin/nvmecontrol/identify.cFri Jul 19 21:40:57 2013
(r253476)
@@ -43,16 +43,18 @@ __FBSDID("$FreeBSD$");
 static void
 print_controller(struct nvme_controller_data *cdata)
 {
+   uint8_t str[128];
+
printf("Controller Capabilities/Features\n");
printf("\n");
printf("Vendor ID:  %04x\n", cdata->vid);
printf("Subsystem Vendor ID:%04x\n", cdata->ssvid);
-   printf("Serial Number:  %.*s\n",
-   NVME_SERIAL_NUMBER_LENGTH, cdata->sn);
-   printf("Model Number:   %.*s\n",
-   NVME_MODEL_NUMBER_LENGTH, cdata->mn);
-   printf("Firmware Version:   %.*s\n",
-   NVME_FIRMWARE_REVISION_LENGTH, cdata->fr);
+   nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH);
+   printf("Serial Number:  %s\n", str);
+   nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH);
+   printf("Model Number:   %s\n", str);
+   nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH);
+   printf("Firmware Version:   %s\n", str);
printf("Recommended Arb Burst:  %d\n", cdata->rab);
printf("IEEE OUI Identifier:%02x %02x %02x\n",
cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]);

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Fri Jul 19 21:37:40 2013(r253475)
+++ head/sys/conf/files.amd64   Fri Jul 19 21:40:57 2013(r253476)
@@ -234,6 +234,7 @@ dev/nvme/nvme_ns_cmd.c  optionalnvme
 dev/nvme/nvme_qpair.c  optionalnvme
 dev/nvme/nvme_sysctl.c optionalnvme
 dev/nvme/nvme_test.c   optionalnvme
+dev/nvme/nvme_util.c   optionalnvme
 dev/nvram/nvram.c  optionalnvram isa
 dev/random/ivy.c   optionalrandom rdrand_rng
 dev/random/nehemiah.c  optionalrandom padlock_rng

Modified: head/sys/conf/files.i386

svn commit: r253478 - head/sys/fs/fuse

2013-07-19 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jul 20 03:08:50 2013
New Revision: 253478
URL: http://svnweb.freebsd.org/changeset/base/253478

Log:
  Adjust outsizes:
  
  When birthtime was added (r253331) we missed adding the weight
  of the new fields in FUSE_COMPAT_ENTRY_OUT_SIZE and
  COMPAT_ATTR_OUT_SIZE. Adjust them accordingly.
  
  Pointed out by:   Jan Beich

Modified:
  head/sys/fs/fuse/fuse_kernel.h

Modified: head/sys/fs/fuse/fuse_kernel.h
==
--- head/sys/fs/fuse/fuse_kernel.h  Fri Jul 19 21:54:48 2013
(r253477)
+++ head/sys/fs/fuse/fuse_kernel.h  Sat Jul 20 03:08:50 2013
(r253478)
@@ -222,7 +222,7 @@ enum fuse_opcode {
 /* The read buffer is required to be at least 8k, but may be much larger */
 #define FUSE_MIN_READ_BUFFER 8192
 
-#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 122
 
 struct fuse_entry_out {
__u64   nodeid; /* Inode ID */
@@ -245,7 +245,7 @@ struct fuse_getattr_in {
__u64   fh;
 };
 
-#define FUSE_COMPAT_ATTR_OUT_SIZE 96
+#define FUSE_COMPAT_ATTR_OUT_SIZE 98
 
 struct fuse_attr_out {
__u64   attr_valid; /* Cache timeout for the attributes */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r253479 - head/sys/fs/fuse

2013-07-19 Thread Pedro F. Giffuni
Author: pfg
Date: Sat Jul 20 03:55:56 2013
New Revision: 253479
URL: http://svnweb.freebsd.org/changeset/base/253479

Log:
  Adjust outsizes:
  
  Recalculate FUSE_COMPAT_ENTRY_OUT_SIZE and COMPAT_ATTR_OUT_SIZE.
  These were wrong in the previous commit. They are actually unused
  in FreeBSD though.
  
  Pointed out by:   Jan Beich

Modified:
  head/sys/fs/fuse/fuse_kernel.h

Modified: head/sys/fs/fuse/fuse_kernel.h
==
--- head/sys/fs/fuse/fuse_kernel.h  Sat Jul 20 03:08:50 2013
(r253478)
+++ head/sys/fs/fuse/fuse_kernel.h  Sat Jul 20 03:55:56 2013
(r253479)
@@ -222,7 +222,7 @@ enum fuse_opcode {
 /* The read buffer is required to be at least 8k, but may be much larger */
 #define FUSE_MIN_READ_BUFFER 8192
 
-#define FUSE_COMPAT_ENTRY_OUT_SIZE 122
+#define FUSE_COMPAT_ENTRY_OUT_SIZE 128
 
 struct fuse_entry_out {
__u64   nodeid; /* Inode ID */
@@ -245,7 +245,7 @@ struct fuse_getattr_in {
__u64   fh;
 };
 
-#define FUSE_COMPAT_ATTR_OUT_SIZE 98
+#define FUSE_COMPAT_ATTR_OUT_SIZE 104
 
 struct fuse_attr_out {
__u64   attr_valid; /* Cache timeout for the attributes */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"