svn commit: r366255 - stable/12/sys/dev/nvme

David Bright dab at FreeBSD.org
Tue Sep 29 14:59:42 UTC 2020


Author: dab
Date: Tue Sep 29 14:59:41 2020
New Revision: 366255
URL: https://svnweb.freebsd.org/changeset/base/366255

Log:
  MFC r365946:
  
  Add an ioctl to get an NVMe device's maximum transfer size
  
  Sponsored by:	Dell EMC Isilon

Modified:
  stable/12/sys/dev/nvme/nvme.h
  stable/12/sys/dev/nvme/nvme_ctrlr.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/nvme/nvme.h
==============================================================================
--- stable/12/sys/dev/nvme/nvme.h	Tue Sep 29 14:02:42 2020	(r366254)
+++ stable/12/sys/dev/nvme/nvme.h	Tue Sep 29 14:59:41 2020	(r366255)
@@ -41,6 +41,7 @@
 #define	NVME_PASSTHROUGH_CMD		_IOWR('n', 0, struct nvme_pt_command)
 #define	NVME_RESET_CONTROLLER		_IO('n', 1)
 #define	NVME_GET_NSID			_IOR('n', 2, struct nvme_get_nsid)
+#define	NVME_GET_MAX_XFER_SIZE		_IOR('n', 3, uint64_t)
 
 #define	NVME_IO_TEST			_IOWR('n', 100, struct nvme_io_test)
 #define	NVME_BIO_TEST			_IOWR('n', 101, struct nvme_io_test)

Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- stable/12/sys/dev/nvme/nvme_ctrlr.c	Tue Sep 29 14:02:42 2020	(r366254)
+++ stable/12/sys/dev/nvme/nvme_ctrlr.c	Tue Sep 29 14:59:41 2020	(r366255)
@@ -1309,6 +1309,9 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_
 		gnsid->nsid = 0;
 		break;
 	}
+	case NVME_GET_MAX_XFER_SIZE:
+		*(uint64_t *)arg = ctrlr->max_xfer_size;
+		break;
 	default:
 		return (ENOTTY);
 	}


More information about the svn-src-all mailing list