svn commit: r368136 - head/sys/dev/nvme

Alexander Motin mav at FreeBSD.org
Sun Nov 29 00:57:19 UTC 2020


Author: mav
Date: Sun Nov 29 00:57:19 2020
New Revision: 368136
URL: https://svnweb.freebsd.org/changeset/base/368136

Log:
  Remove aligment requirements for passthrough buffer.
  
  After r368124 vmapbuf() should happily map misaligned maxphys-sized buffers
  thanks to extra page added to pbuf_zone.

Modified:
  head/sys/dev/nvme/nvme_ctrlr.c

Modified: head/sys/dev/nvme/nvme_ctrlr.c
==============================================================================
--- head/sys/dev/nvme/nvme_ctrlr.c	Sun Nov 29 00:54:13 2020	(r368135)
+++ head/sys/dev/nvme/nvme_ctrlr.c	Sun Nov 29 00:57:19 2020	(r368136)
@@ -1244,20 +1244,8 @@ nvme_ctrlr_passthrough_cmd(struct nvme_controller *ctr
 	struct mtx		*mtx;
 	struct buf		*buf = NULL;
 	int			ret = 0;
-	vm_offset_t		addr, end;
 
 	if (pt->len > 0) {
-		/*
-		 * vmapbuf calls vm_fault_quick_hold_pages which only maps full
-		 * pages. Ensure this request has fewer than maxphys bytes when
-		 * extended to full pages.
-		 */
-		addr = (vm_offset_t)pt->buf;
-		end = round_page(addr + pt->len);
-		addr = trunc_page(addr);
-		if (end - addr > maxphys)
-			return EIO;
-
 		if (pt->len > ctrlr->max_xfer_size) {
 			nvme_printf(ctrlr, "pt->len (%d) "
 			    "exceeds max_xfer_size (%d)\n", pt->len,


More information about the svn-src-all mailing list