Page MenuHomeFreeBSD

if_awg tx path fixes/modifications
AbandonedPublic

Authored by guyyur_gmail.com on Sep 28 2017, 6:35 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 3:16 PM
Unknown Object (File)
Jan 17 2024, 7:01 AM
Unknown Object (File)
Dec 20 2023, 5:52 AM
Unknown Object (File)
Jun 22 2023, 7:07 PM
Unknown Object (File)
May 3 2023, 10:01 PM
Unknown Object (File)
Mar 7 2023, 12:31 AM
Unknown Object (File)
Mar 2 2023, 3:10 PM
Unknown Object (File)
Jan 15 2023, 4:06 AM
Subscribers

Details

Reviewers
manu
Summary

Several fixes/modifications for the tx path of if_awg based on if_nfe, if_vr drivers.

  1. Free the mbuf if m_collapse fails or dma map loading of m_collapsed buffer fails.

This avoids retrying sending the packet which can keep failing on m_collapse.

  1. Check for enough ring buf slots after mapping the dma and number of segments is known.

That is what if_nfe does. Alternatively the check for at least TX_MAX_SEGS free slots can be kept instead.

  1. For mbuf with multiple segments, set the valid bit on the first descriptor only after the descriptors for all the other segments were programmed to avoid the dma starting on the frame before all ring slots are programmed.
  1. Place the dma mapping to be unloaded and the mbuf to be freed in the last segment.

This might not be necessary, according to the data sheet as it mentions the valid bit is only cleared after a frame is transmitted.

  1. Rename awg_setup_txbuf to awg_encap and awg_txintr to awg_txeof to match other drivers and iflib names.
  1. Mark request for tx interrupt notification only on the last segment of a frame.

It appears the card doesn't trigger the interrupt if it is not on the last segment of a frame.
If packets every awg_tx_interval are all not last-segment frames the interrupt won't be triggered
and the tx queue will never be cleared.
This happens because I changed txeof to not be called for TX_BUF_UA_INT but even if it was
called it would do cleanups in large chunks instead of per awg_tx_interval frames.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

guyyur_gmail.com edited the summary of this revision. (Show Details)

Mark request for tx interrupt notification only on last segment.
Return ENOBUFS from awg_encap only if buffer is full so don't unset IFF_DRV_OACTIVE if m_collapse or dma loading failed.

changed to only increase opackets/oerrors on last segment