Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'nfp-fix-retcode-and-disable-netpoll-on-representors'

Jakub Kicinski says:

====================
nfp: fix retcode and disable netpoll on representors

This series avoids a potential crash on nfp representor devices
when netpoll is in use. If transmitting the frame through underlying
vNIC fails we'd return an error code (by passing on error code from
__dev_queue_xmit()) and cause double free in netpoll code.

Fix the error code and disable netpoll on reprs altogether.
IRQ-safety of locking the queues and calling __dev_queue_xmit()
is questionable.

Big thanks to John Hurley for debugging and narrowing down
the trace log after I gave up! :)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+2 -2
+2 -2
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c
··· 195 195 ret = dev_queue_xmit(skb); 196 196 nfp_repr_inc_tx_stats(netdev, len, ret); 197 197 198 - return ret; 198 + return NETDEV_TX_OK; 199 199 } 200 200 201 201 static int nfp_repr_stop(struct net_device *netdev) ··· 383 383 netdev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6); 384 384 netdev->gso_max_segs = NFP_NET_LSO_MAX_SEGS; 385 385 386 - netdev->priv_flags |= IFF_NO_QUEUE; 386 + netdev->priv_flags |= IFF_NO_QUEUE | IFF_DISABLE_NETPOLL; 387 387 netdev->features |= NETIF_F_LLTX; 388 388 389 389 if (nfp_app_has_tc(app)) {