[nvmewin] nvmewin Digest, Vol 4, Issue 27
Harris, James R
james.r.harris at intel.com
Wed Apr 18 17:46:59 PDT 2012
You shouldn't need the "if" part here. The "else" part will handle the "less than PAGE_SIZE" case.
-Jim
>-----Original Message-----
>From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On
>Behalf Of nvmewin-request at lists.openfabrics.org
>Sent: Wednesday, April 18, 2012 5:55 PM
>To: nvmewin at lists.openfabrics.org
>Subject: nvmewin Digest, Vol 4, Issue 27
>
>Send nvmewin mailing list submissions to
> nvmewin at lists.openfabrics.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/nvmewin
>or, via email, send a message with subject or body 'help' to
> nvmewin-request at lists.openfabrics.org
>
>You can reach the person managing the list at
> nvmewin-owner at lists.openfabrics.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of nvmewin digest..."
>
>
>Today's Topics:
>
> 1. updated SGL conversion routine (Luse, Paul E)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Thu, 19 Apr 2012 00:43:02 +0000
>From: "Luse, Paul E" <paul.e.luse at intel.com>
>To: "nvmewin at lists.openfabrics.org" <nvmewin at lists.openfabrics.org>
>Subject: [nvmewin] updated SGL conversion routine
>Message-ID:
> <82C9F782B054C94B9FC04A331649C77A0BAFC5 at FMSMSX106.amr.corp.intel.com>
>Content-Type: text/plain; charset="us-ascii"
>
>OK, the else has now been updated (thanks Jim, needed some tweaks though but I saw what you
>were going for of course). There's so many way to handle this problem, I'm sure we can find
>something more efficient than this but its pretty good I think and easy to follow.
>
>Please review, I have this under test now and am heading out....
>
>Thx
>Paul
>
>
> physicalAddress.QuadPart = pSgl->List[index].PhysicalAddress.QuadPart;
>
> if (sgElementSize <= PAGE_SIZE) {
> ULONG nextPage = 0;
>
> /* Must transfer at least one full page */
> numImplicitEntries = 1;
> /*
> * since we may be offset into the page, look to determine
> * address to determine if a 2nd PRP entry is needed
> */
> nextPage = physicalAddress.LowPart + PAGE_SIZE;
> nextPage = nextPage & ~PAGE_MASK;
> numImplicitEntries +=
> ((physicalAddress.LowPart + sgElementSize) > nextPage) ? 1 : 0;
> } else {
> PHYSICAL_ADDRESS startAddr, endAddr;
>
> startAddr.QuadPart = physicalAddress.QuadPart;
> endAddr.QuadPart = startAddr.QuadPart + sgElementSize;
> numImplicitEntries = 0;
>
> /* account for an entry becaue of an offset start */
> if (startAddr.QuadPart % PAGE_SIZE) {
> numImplicitEntries += 1;
> /* bump the start address to the next page boundary */
> startAddr.QuadPart += PAGE_SIZE;
> startAddr.QuadPart &= ~PAGE_MASK;
> }
>
> /* account for an entry becaue of tail */
> if (endAddr.QuadPart % PAGE_SIZE) {
> numImplicitEntries += 1;
> /* lop off the tail */
> endAddr.QuadPart &= ~PAGE_MASK;
> }
> /* now account for the whole pages if any */
> numImplicitEntries += (ULONG)((endAddr.QuadPart - startAddr.QuadPart) / PAGE_SIZE);
> }
>
>____________________________________
>Paul Luse
>Sr. Staff Engineer
>PCG Server Software Engineering
>Desk: 480.554.3688, Mobile: 480.334.4630
>
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL:
><http://lists.openfabrics.org/pipermail/nvmewin/attachments/20120419/2959ab31/attachment.html>
>-------------- next part --------------
>An embedded and charset-unspecified text was scrubbed...
>Name: nvmeSnti.c
>URL:
><http://lists.openfabrics.org/pipermail/nvmewin/attachments/20120419/2959ab31/attachment.c>
>
>------------------------------
>
>_______________________________________________
>nvmewin mailing list
>nvmewin at lists.openfabrics.org
>http://lists.openfabrics.org/cgi-bin/mailman/listinfo/nvmewin
>
>
>End of nvmewin Digest, Vol 4, Issue 27
>**************************************
More information about the nvmewin
mailing list