Skip to content

Commit

Permalink
ixgbe: Don't call kmap() on page allocated with GFP_ATOMIC
Browse files Browse the repository at this point in the history
Pages allocated with GFP_ATOMIC cannot come from Highmem. This is why
there is no need to call kmap() on them.

Therefore, don't call kmap() on rx_buffer->page() and instead use a
plain page_address() to get the kernel address.

Suggested-by: Ira Weiny <[email protected]>
Suggested-by: Alexander Duyck <[email protected]>
Signed-off-by: Fabio M. De Francesco <[email protected]>
Reviewed-by: Ira Weiny <[email protected]>
Reviewed-by: Alexander Duyck <[email protected]>
Tested-by: Gurucharan <[email protected]> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <[email protected]>
  • Loading branch information
xp4ns3 authored and anguy11 committed Aug 18, 2022
1 parent e34cfee commit 03f5171
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1964,15 +1964,13 @@ static bool ixgbe_check_lbtest_frame(struct ixgbe_rx_buffer *rx_buffer,

frame_size >>= 1;

data = kmap(rx_buffer->page) + rx_buffer->page_offset;
data = page_address(rx_buffer->page) + rx_buffer->page_offset;

if (data[3] != 0xFF ||
data[frame_size + 10] != 0xBE ||
data[frame_size + 12] != 0xAF)
match = false;

kunmap(rx_buffer->page);

return match;
}

Expand Down

0 comments on commit 03f5171

Please sign in to comment.