Skip to content

Commit a7c0b8b

Browse files
Michal Hockodavem330
authored andcommitted
amd-xgbe: use PAGE_ALLOC_COSTLY_ORDER in xgbe_map_rx_buffer
xgbe_map_rx_buffer is rather confused about what PAGE_ALLOC_COSTLY_ORDER means. It uses PAGE_ALLOC_COSTLY_ORDER-1 assuming that PAGE_ALLOC_COSTLY_ORDER is the first costly order which is not the case actually because orders larger than that are costly. And even that applies only to sleeping allocations which is not the case here. We simply do not perform any costly operations like reclaim or compaction for those. Simplify the code by dropping the order calculation and use PAGE_ALLOC_COSTLY_ORDER directly. Signed-off-by: Michal Hocko <[email protected]> Acked-by: Tom Lendacky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f733ee commit a7c0b8b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/net/ethernet/amd/xgbe/xgbe-desc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ static int xgbe_map_rx_buffer(struct xgbe_prv_data *pdata,
324324
struct xgbe_ring *ring,
325325
struct xgbe_ring_data *rdata)
326326
{
327-
int order, ret;
327+
int ret;
328328

329329
if (!ring->rx_hdr_pa.pages) {
330330
ret = xgbe_alloc_pages(pdata, &ring->rx_hdr_pa, GFP_ATOMIC, 0);
@@ -333,9 +333,8 @@ static int xgbe_map_rx_buffer(struct xgbe_prv_data *pdata,
333333
}
334334

335335
if (!ring->rx_buf_pa.pages) {
336-
order = max_t(int, PAGE_ALLOC_COSTLY_ORDER - 1, 0);
337336
ret = xgbe_alloc_pages(pdata, &ring->rx_buf_pa, GFP_ATOMIC,
338-
order);
337+
PAGE_ALLOC_COSTLY_ORDER);
339338
if (ret)
340339
return ret;
341340
}

0 commit comments

Comments
 (0)