net/xdp: use shift instead of 64 bit division
Subsystems (3)
PATCH 1/1 net/xdp: use shift instead of 64 bit division
64bit division is kind of expensive, and shift should do the job here.
Signed-off-by Pavel Machek (CIP) <[email protected]>
---
Now with patch. Sorry about that.
net/xdp/xdp_umem.c +1 -1
@@ -372,7 +372,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)if ((addr + size) < addr)return -EINVAL ; - npgs =div_u64 (size,PAGE_SIZE ); + npgs = size >>PAGE_SHIFT ;if (npgs >U32_MAX )return -EINVAL ;
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
David Miller
maintainerFrom: Pavel Machek <[email protected]>
Date: Thu, 4 Jun 2020 23:42:59 +0200
Quoted 3 lines
64bit division is kind of expensive, and shift should do the job here.
Signed-off-by Pavel Machek (CIP) <[email protected]>
I'll take this, applied, thanks.