Skip to content

Commit 9383b33

Browse files
Jakub Kicinskidavem330
authored andcommitted
nfp: don't tell FW about the reserved buffer space
Since commit c0f031b ("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: c0f031b ("nfp: use alloc_frag() and build_skb()") Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e285998 commit 9383b33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/netronome/nfp/nfp_net_common.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2198,7 +2198,8 @@ static int __nfp_net_set_config_and_enable(struct nfp_net *nn)
21982198
nfp_net_write_mac_addr(nn);
21992199

22002200
nn_writel(nn, NFP_NET_CFG_MTU, nn->netdev->mtu);
2201-
nn_writel(nn, NFP_NET_CFG_FLBUFSZ, nn->fl_bufsz);
2201+
nn_writel(nn, NFP_NET_CFG_FLBUFSZ,
2202+
nn->fl_bufsz - NFP_NET_RX_BUF_NON_DATA);
22022203

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

0 commit comments

Comments
 (0)