Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9383b337 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

nfp: don't tell FW about the reserved buffer space



Since commit c0f031bc ("nfp_net: use alloc_frag() and build_skb()")
we are allocating buffers which have to hold both the data and skb to
be created in place by build_skb().

FW should only be told about the buffer space it can DMA to, that
is without the build_skb() headroom and tailroom.  Note: firmware
applications should validate the buffers against both MTU and
free list buffer size so oversized packets would not pass through
the NIC anyway.

Fixes: c0f031bc ("nfp: use alloc_frag() and build_skb()")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2859980
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2198,7 +2198,8 @@ static int __nfp_net_set_config_and_enable(struct nfp_net *nn)
	nfp_net_write_mac_addr(nn);
	nfp_net_write_mac_addr(nn);


	nn_writel(nn, NFP_NET_CFG_MTU, nn->netdev->mtu);
	nn_writel(nn, NFP_NET_CFG_MTU, nn->netdev->mtu);
	nn_writel(nn, NFP_NET_CFG_FLBUFSZ, nn->fl_bufsz);
	nn_writel(nn, NFP_NET_CFG_FLBUFSZ,
		  nn->fl_bufsz - NFP_NET_RX_BUF_NON_DATA);


	/* Enable device */
	/* Enable device */
	new_ctrl |= NFP_NET_CFG_CTRL_ENABLE;
	new_ctrl |= NFP_NET_CFG_CTRL_ENABLE;