lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090601.031104.187911913.davem@davemloft.net>
Date:	Mon, 01 Jun 2009 03:11:04 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	afleming@...escale.com
Cc:	netdev@...r.kernel.org
Subject: Re: NIU driver unmap_page call

From: Andy Fleming <afleming@...escale.com>
Date: Fri, 29 May 2009 17:38:50 -0500

> I'm trying to figure out what this code does:
> 
>                if ((page->index + rp->rbr_block_size) - rcr_size == addr) {
>                        *link = (struct page *) page->mapping;
>                        np->ops->unmap_page(np->device, page->index,
>                                            PAGE_SIZE, DMA_FROM_DEVICE);
>                        page->index = 0;
>                        page->mapping = NULL;
>                        rp->rbr_refill_pending++;
>                } else
>                        get_page(page);
> 
> It's clear it's taking the opportunity to remove the page from the
> hash table, and to unmap the page, but I'm not familiar enough with
> this nic to understand what the if statement is looking for.  My first
> thought was that it was looking to see if this was the first buffer in
> the page?

It's looking to see if this is the LAST chunk in the page, not the
first.

rcr_size is the size of the sub-buffers within the page that the
chip is carving out of the page.

Since when we allocated the page initially this obtained on reference
to the page, we increment for every chunk given out to an SKB except
the last one.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ