]> git.baikalelectronics.ru Git - kernel.git/commit
octeontx2-pf: Simplify the receive buffer size calculation
authorSubbaraya Sundeep <sbhatta@marvell.com>
Sun, 10 Oct 2021 10:09:35 +0000 (15:39 +0530)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 Oct 2021 10:46:54 +0000 (11:46 +0100)
commit7355b783b9a7313177590261314726863602ddbf
treea53197977f48295215c05a2dd69a5ff6acc16319
parent90aa8185b07f5675625eee7a420ea7efe2d3ffe1
octeontx2-pf: Simplify the receive buffer size calculation

This patch separates the logic of configuring hardware
maximum transmit frame size and receive frame size.
This simplifies the logic to calculate receive buffer
size and using cqe descriptor of different size.
Also additional size of skb_shared_info structure is
allocated for each receive buffer pointer given to
hardware which is not necessary. Hence change the
size calculation to remove the size of
skb_shared_info. Add a check for array out of
bounds while adding fragments to the network stack.

Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.h