linux-yocto/drivers/net/ethernet/marvell
Aleksandr Mishin eb592008f7 octeon_ep: Add SKB allocation failures handling in __octep_oq_process_rx()
build_skb() returns NULL in case of a memory allocation failure so handle
it inside __octep_oq_process_rx() to avoid NULL pointer dereference.

__octep_oq_process_rx() is called during NAPI polling by the driver. If
skb allocation fails, keep on pulling packets out of the Rx DMA queue: we
shouldn't break the polling immediately and thus falsely indicate to the
octep_napi_poll() that the Rx pressure is going down. As there is no
associated skb in this case, don't process the packets and don't push them
up the network stack - they are skipped.

Helper function is implemented to unmmap/flush all the fragment buffers
used by the dropped packet. 'alloc_failures' counter is incremented to
mark the skb allocation error in driver statistics.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 37d79d0596 ("octeon_ep: add Tx/Rx processing and interrupt support")
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
2024-10-19 16:20:07 -05:00
..
mvpp2 net: mvpp2: Remove setting of RX software timestamp 2024-09-03 15:17:49 -07:00
octeon_ep octeon_ep: Add SKB allocation failures handling in __octep_oq_process_rx() 2024-10-19 16:20:07 -05:00
octeon_ep_vf The usual shower of singleton fixes and minor series all over MM, 2024-05-19 09:21:03 -07:00
octeontx2 octeontx2-af: Fix potential integer overflows on integer shifts 2024-10-15 13:32:22 +02:00
prestera netdev_features: convert NETIF_F_NETNS_LOCAL to dev->netns_local 2024-09-03 11:36:43 +02:00
Kconfig octeon_ep_vf: Add driver framework and device initialization 2024-02-12 09:01:52 +00:00
Makefile octeon_ep_vf: Add driver framework and device initialization 2024-02-12 09:01:52 +00:00
mv643xx_eth.c net: mv643xx_eth: Simplify with scoped for each OF child loop 2024-09-03 12:54:43 +02:00
mvmdio.c treewide: Fix wrong singular form of jiffies in comments 2024-09-08 20:47:40 +02:00
mvneta_bm.c net: ethernet: marvell: Convert to platform remove callback returning void 2023-09-20 09:06:39 +01:00
mvneta_bm.h
mvneta.c net: mvneta: Use __be16 for l3_proto parameter of mvneta_txq_desc_csum() 2024-08-13 19:17:27 -07:00
pxa168_eth.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
skge.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
skge.h
sky2.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
sky2.h sky2: Make sure there is at least one frag_addr available 2023-10-02 08:03:52 +01:00