Page MenuHomeFreeBSD

Cover ENA driver code with branch predictioning statements
ClosedPublic

Authored by mk_semihalf.com on Oct 31 2017, 1:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:36 AM
Unknown Object (File)
Sep 6 2023, 6:40 PM
Unknown Object (File)
Aug 29 2023, 3:52 AM
Unknown Object (File)
Aug 15 2023, 6:27 AM
Unknown Object (File)
Jul 25 2023, 3:55 PM
Unknown Object (File)
Jul 7 2023, 12:25 AM
Unknown Object (File)
Jul 4 2023, 12:08 AM
Unknown Object (File)
Jun 28 2023, 2:17 PM

Details

Summary

The driver was using it in only few places, so the rest of the code
was covered with those statement.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

My opinion is generally that branch predictions should be sparse. Is it really going to make any difference in setup/teardown functions, which many of the functions edited here appear to be?

That said, I tried to verify that none of the actual conditions changed, and I don't see any problems with this patch in that respect, so I don't have any objections.

sys/dev/ena/ena.c
1384–1387 ↗(On Diff #34524)

Is this one right?

1407 ↗(On Diff #34524)

This seems just to be a loop counter... Is there any point to predicting its value?

This revision is now accepted and ready to land.Nov 1 2017, 7:01 AM
sys/dev/ena/ena.c
1384–1387 ↗(On Diff #34524)

Yes, if it is true, it means that DMA mapping of the mbuf was successfull (we can predict that it will be almost always true).

1407 ↗(On Diff #34524)

This code is in hot path and the counter in the loop was added only to reduce latency on the RX. If TX cleanup would work in separate thread, there should be while(1). When the traffic will not be very high, we will rather call break inside the loop than hit budget == 0.

Fix conflicts with recent update to D12860

This revision now requires review to proceed.Nov 2 2017, 2:51 PM
This revision is now accepted and ready to land.Nov 7 2017, 2:19 PM
This revision was automatically updated to reflect the committed changes.