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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9528682b-93bb-2797-6bd5-0f40710d306c@intel.com>
Date: Wed, 21 Jun 2023 12:09:07 -0700
From: "Linga, Pavan Kumar" <pavan.kumar.linga@...el.com>
To: Jakub Kicinski <kuba@...nel.org>, Tony Nguyen <anthony.l.nguyen@...el.com>
CC: <davem@...emloft.net>, <pabeni@...hat.com>, <edumazet@...gle.com>,
	<netdev@...r.kernel.org>, Alan Brady <alan.brady@...el.com>,
	<emil.s.tantilov@...el.com>, <jesse.brandeburg@...el.com>,
	<sridhar.samudrala@...el.com>, <shiraz.saleem@...el.com>,
	<sindhu.devale@...el.com>, <willemb@...gle.com>, <decot@...gle.com>,
	<andrew@...n.ch>, <leon@...nel.org>, <mst@...hat.com>,
	<simon.horman@...igine.com>, <shannon.nelson@....com>,
	<stephen@...workplumber.org>, Joshua Hay <joshua.a.hay@...el.com>, "Madhu
 Chittim" <madhu.chittim@...el.com>, Phani Burra <phani.r.burra@...el.com>
Subject: Re: [PATCH net-next v2 12/15] idpf: add RX splitq napi poll support



On 6/17/2023 12:01 AM, Jakub Kicinski wrote:
> On Wed, 14 Jun 2023 10:14:25 -0700 Tony Nguyen wrote:
>> +static bool idpf_rx_can_reuse_page(struct idpf_rx_buf *rx_buf)
>> +{
>> +	unsigned int last_offset = PAGE_SIZE - rx_buf->buf_size;
>> +	struct idpf_page_info *pinfo;
>> +	unsigned int pagecnt_bias;
>> +	struct page *page;
>> +
>> +	pinfo = &rx_buf->page_info[rx_buf->page_indx];
>> +	pagecnt_bias = pinfo->pagecnt_bias;
>> +	page = pinfo->page;
>> +
>> +	if (unlikely(!dev_page_is_reusable(page)))
>> +		return false;
>> +
>> +	if (PAGE_SIZE < 8192) {
>> +		/* For 2K buffers, we can reuse the page if we are the
>> +		 * owner. For 4K buffers, we can reuse the page if there are
>> +		 * no other others.
>> +		 */
>> +		if (unlikely((page_count(page) - pagecnt_bias) >
>> +			     pinfo->reuse_bias))
>> +			return false;
>> +	} else if (pinfo->page_offset > last_offset) {
>> +		return false;
>> +	}
>> +
>> +	/* If we have drained the page fragment pool we need to update
>> +	 * the pagecnt_bias and page count so that we fully restock the
>> +	 * number of references the driver holds.
>> +	 */
>> +	if (unlikely(pagecnt_bias == 1)) {
>> +		page_ref_add(page, USHRT_MAX - 1);
>> +		pinfo->pagecnt_bias = USHRT_MAX;
>> +	}
>> +
>> +	return true;
>> +}
> 
> If you want to do local recycling you must use the page pool first,
> and then share the analysis of how much and why the recycling helps.

We are working on refactoring all the Intel drivers to use the page pool 
API in a unified way and our plan is to update IDPF driver as well, as 
part of that effort.

Thanks,
Pavan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ