Page MenuHomeFreeBSD

ena: Properly unmap last socket chain in netmap
Needs ReviewPublic

Authored by osamaabb_amazon.com on Aug 20 2024, 8:47 AM.
Tags
None
Referenced Files
F142393922: D46365.diff
Mon, Jan 19, 12:58 PM
Unknown Object (File)
Sat, Dec 27, 6:02 PM
Unknown Object (File)
Dec 15 2025, 3:05 AM
Unknown Object (File)
Nov 11 2025, 10:19 PM
Unknown Object (File)
Oct 30 2025, 2:03 AM
Unknown Object (File)
Oct 20 2025, 2:51 AM
Unknown Object (File)
Oct 20 2025, 2:50 AM
Unknown Object (File)
Oct 19 2025, 12:25 PM
Subscribers

Details

Reviewers
cperciva
Summary

In case ena_com_prepare_tx() fails within the netmap tx flow,
the driver will unmap the last socket chain.
Currently, the driver unmaps the wrong socket within
ena_netmap_unmap_last_socket_chain().

Illustration of the flow:

1- ena_netmap_tx_frames()
2- ena_netmap_tx_frame()
3- ena_netmap_tx_map_slots()
3.1- Map slot
3.2- Advance to the next socket
4- ena_com_prepare_tx()
4.1- ena_com_prepare_tx() fails
5- ena_netmap_unmap_last_socket_chain()

In step 5, where the driver unmaps the socket, the netmap
index already points at the next entry, meaning we're unmapping the
wrong socket in case ena_com_prepare_tx() fails.
In order to fix that, the driver should first update the netmap index to
point at the previous entry and only then update the socket parameters.

Approved by: cperciva
MFC after: 2 weeks
Sponsored by: Amazon, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 59094
Build 55981: arc lint + arc unit