]> git.baikalelectronics.ru Git - kernel.git/commit
net: octeontx2: Make sure the buffer is 128 byte aligned
authorKevin Hao <haokexin@gmail.com>
Thu, 21 Jan 2021 07:09:06 +0000 (15:09 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 23 Jan 2021 02:03:42 +0000 (18:03 -0800)
commit8e8f84c672d563196542ab949a2d7156c721e6d1
treeb24439b0670ed1e5ce7ba53eec29fc9d727b71f4
parent66505f4d9483edb3e0d92df236c2c22980dfb881
net: octeontx2: Make sure the buffer is 128 byte aligned

The octeontx2 hardware needs the buffer to be 128 byte aligned.
But in the current implementation of napi_alloc_frag(), it can't
guarantee the return address is 128 byte aligned even the request size
is a multiple of 128 bytes, so we have to request an extra 128 bytes and
use the PTR_ALIGN() to make sure that the buffer is aligned correctly.

Fixes: d30d76fcf156 ("octeontx2-pf: Use the napi_alloc_frag() to alloc the pool buffers")
Reported-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Tested-by: Subbaraya Sundeep <sbhatta@marvell.com>
Link: https://lore.kernel.org/r/20210121070906.25380-1-haokexin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c