|
@@ -1588,9 +1588,8 @@ static bool i40e_alloc_mapped_page(struct i40e_ring *rx_ring,
|
|
bi->dma = dma;
|
|
bi->dma = dma;
|
|
bi->page = page;
|
|
bi->page = page;
|
|
bi->page_offset = i40e_rx_offset(rx_ring);
|
|
bi->page_offset = i40e_rx_offset(rx_ring);
|
|
-
|
|
|
|
- /* initialize pagecnt_bias to 1 representing we fully own page */
|
|
|
|
- bi->pagecnt_bias = 1;
|
|
|
|
|
|
+ page_ref_add(page, USHRT_MAX - 1);
|
|
|
|
+ bi->pagecnt_bias = USHRT_MAX;
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -1956,8 +1955,8 @@ static bool i40e_can_reuse_rx_page(struct i40e_rx_buffer *rx_buffer)
|
|
* the pagecnt_bias and page count so that we fully restock the
|
|
* the pagecnt_bias and page count so that we fully restock the
|
|
* number of references the driver holds.
|
|
* number of references the driver holds.
|
|
*/
|
|
*/
|
|
- if (unlikely(!pagecnt_bias)) {
|
|
|
|
- page_ref_add(page, USHRT_MAX);
|
|
|
|
|
|
+ if (unlikely(pagecnt_bias == 1)) {
|
|
|
|
+ page_ref_add(page, USHRT_MAX - 1);
|
|
rx_buffer->pagecnt_bias = USHRT_MAX;
|
|
rx_buffer->pagecnt_bias = USHRT_MAX;
|
|
}
|
|
}
|
|
|
|
|