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-next>] [day] [month] [year] [list]
Message-Id: <71C5D403-0A82-45E6-8FEF-2911B7BB9C24@freescale.com>
Date:	Fri, 29 May 2009 17:38:50 -0500
From:	Andy Fleming <afleming@...escale.com>
To:	netdev@...r.kernel.org
Subject: NIU driver unmap_page call

I'm working on a driver for a nic which has a hardware buffer  
management feature, and I'm patterning some of the management of that  
feature off the niu driver. 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?  But that can't be right...   And why the get_page? I  
thought the add_page code took care of incrementing the reference  
count.  Lastly, the unmap_page call concerns me.  I'm on a 32-bit  
platform with support for 36-bit physical addresses, which means I  
need to unmap the memory before I give it to the stack.

I suppose the easier solution would be to kmalloc the buffers I put in  
the pool, but that would take longer, so I'm hoping I can use the same  
method as the NIU driver.

Thanks,
Andy
--
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