zephyr/subsys/net/l2
Daniel Glöckner 5ef825fdf6 net: pkt: fix race condition in packet reference counting
It has been observed that some network drivers, f.ex. the SAM E70 GMAC,
call net_pkt_unref from inside the interrupt that signals the successful
transmission of a packet. This conflicts with the net_pkt_unref call
made by ethernet_send after the packet has been given to the driver.

We fix this by using an atomic_t to hold the reference count as there
might be other, difficult to find cases of net_pkt_(un)ref being used
across threads and interrupts.

The name of the element has been changed from "ref" to "atomic_ref" to
cause a compile error when code still has not been converted to use the
atomic_* functions.

Fixes #12708

Signed-off-by: Daniel Glöckner <dg@emlix.com>
2019-01-29 09:22:14 +02:00
..
bluetooth net/pkt: Remove parameters to "reserve" some headroom 2018-12-14 14:16:37 +01:00
dummy net/l2: Finally get rid of reserve concept from L2 2018-12-14 14:16:37 +01:00
ethernet net: pkt: fix race condition in packet reference counting 2019-01-29 09:22:14 +02:00
ieee802154 net: ieee802154: Fix ack check 2019-01-17 11:16:26 +02:00
openthread net: openthread: Set mesh_local flag in mesh-local OT addresses 2019-01-28 21:24:26 -05:00
wifi net: wifi: Add Access Point mode interface 2019-01-19 07:20:36 -05:00
CMakeLists.txt net: l2: Move individual L2 to dedicated directories 2018-07-30 09:02:02 -04:00
Kconfig net: l2: Fix NET_L2_BT dependency in KConfig 2018-11-10 12:38:29 -05:00