[nvmewin] SGL bug update

Robles, Raymond C raymond.c.robles at intel.com
Wed Apr 18 15:24:27 PDT 2012


I've reviewed Paul's change and I believe that it addresses the issue that Alex brought up.

Thanks,
Ray

From: nvmewin-bounces at lists.openfabrics.org [mailto:nvmewin-bounces at lists.openfabrics.org] On Behalf Of Luse, Paul E
Sent: Wednesday, April 18, 2012 3:10 PM
To: Chang, Alex; nvmewin at lists.openfabrics.org
Subject: Re: [nvmewin] SGL bug update

Here's what I'm testing now.  Changes are only to the element < page_size case, I was mistaken with where I thought I saw the issue before, that code was correct.  I'm running various other data integrity tools and now all formats work, before some quick formats didn't work right and I've already confirmed that this was definitely due to the bug.  What I do below, please anyone chime in if you know a better way, is determine the starting address of the next page and then add the address we're dealing and the element size and if its > the address of the next page then I bump up the number of required PRP entries by 1.

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 {
            numImplicitEntries = (sgElementSize / PAGE_SIZE);
            /* Check to see if there is residual data past a page boundary */
            numImplicitEntries +=
                ((sgElementSize % PAGE_SIZE) != 0) ? 1 : 0;
        }

From: Chang, Alex [mailto:Alex.Chang at idt.com]<mailto:[mailto:Alex.Chang at idt.com]>
Sent: Wednesday, April 18, 2012 3:04 PM
To: Luse, Paul E; nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
Subject: RE: SGL bug update

Thanks a lot, Paul.
I recall there were at least couple of changes for the translation after code review. And you and Ray did some changes on it. We just need to ensure it gets tested with all different cases.

Regards,
Alex

________________________________
From: nvmewin-bounces at lists.openfabrics.org<mailto:nvmewin-bounces at lists.openfabrics.org> [mailto:nvmewin-bounces at lists.openfabrics.org]<mailto:[mailto:nvmewin-bounces at lists.openfabrics.org]> On Behalf Of Luse, Paul E
Sent: Wednesday, April 18, 2012 12:43 PM
To: nvmewin at lists.openfabrics.org<mailto:nvmewin at lists.openfabrics.org>
Subject: [nvmewin] SGL bug update
So Alex-

I'm with you - hard to believe this ever worked!  I talked with Ray about it and both recall we caught this in inspection but somehow never got back to reworking it because at the time I think we ad bigger fish to fry.  Anyway, I have a fix in place and my quick format always works now (before was intermittent) and I confirmed that the case we didn't handle indeed happens quite often.  I think the data integrity tools we smoke test with don't do too many unaligned things.  I'm doing some more exhaustive testing now and will share the updated code once I'm confident that it works.

Thx
Paul

____________________________________
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/20120418/423ebe9a/attachment.html>


More information about the nvmewin mailing list