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)
commit0182d0788cd66292cb1698b48dd21887d93c68ed
treea53197977f48295215c05a2dd69a5ff6acc16319
parentb9c56ccb436d1e952bb1fc0ddf752669a116b310
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