Re: [PATCH net v5 2/2] net: atl1c: free the RX buffer when the descriptor reports an error
From: Federico Musto
Date: Mon Nov 30 2026 - 15:08:39 EST
Thank you for the review.
[Medium] A legitimate multi-RFD frame becomes a controller reset.
The arithmetic is correct. For an MTU of 1501 to 1522
atl1c_set_rxbufsize() leaves rx_buffer_len at AT_RX_BUF_SIZE (1522),
while atl1c_configure_mac() programs REG_MTU with mtu + 22, that is
1523 to 1544. A frame the MAC accepts can then be larger than one RFD.
I have not confirmed whether the device splits such a frame over two
RFDs or truncates it into one: the card I test on has only been run at
MTU 1500 and 1600.
Either way the reset should not depend on that. In v6:
- an RRD whose RFD count is 2 to 15 and whose index matches
rfd_ring->next_to_clean is dropped: every RFD of the frame is
unmapped, freed and recycled, each slot being checked for a buffer
first, and RX carries on;
- the reset is kept for a real loss of sync only: a count of 0, an
index that differs from next_to_clean, or a slot with no buffer.
Sizing rx_buffer_len from the same expression as REG_MTU looks right as
well, but it changes the buffer size for those MTUs and is a separate
patch.
Before posting v6 I will run the card at MTU 1508 with frames of about
1530 bytes and report what the device does with them.
The reply to the review of patch 1 carries the pw-bot line and a
question to the maintainers about the direction for v6:
https://lore.kernel.org/netdev/20261130200709.34802-1-federico@xxxxxxxxxxxxx/