Page MenuHomeFreeBSD

netfront: shrink MAX_TX_REQ_FRAGS by one
AbandonedPublic

Authored by liuw_liuw.name on Oct 14 2015, 2:49 PM.
Referenced Files
F83392970: D3893.id9380.diff
Thu, May 9, 9:11 PM
Unknown Object (File)
Dec 29 2023, 12:03 AM
Unknown Object (File)
Dec 20 2023, 12:30 AM
Unknown Object (File)
Nov 5 2023, 6:53 PM
Unknown Object (File)
Sep 14 2023, 6:46 PM
Unknown Object (File)
Aug 27 2023, 10:43 PM
Unknown Object (File)
Aug 12 2023, 8:15 PM
Unknown Object (File)
May 23 2023, 3:17 PM
Subscribers

Details

Reviewers
royger
Group Reviewers
network
Summary

MAX_TX_REQ_FRAGS is derived from Linux backend driver.

There is nothing wrong with the original value, but nowadays Linux backend copes more efficiently with the new value.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

liuw_liuw.name retitled this revision from to netfront: shrink MAX_TX_REQ_FRAGS by one.
liuw_liuw.name updated this object.
liuw_liuw.name edited the test plan for this revision. (Show Details)
liuw_liuw.name added reviewers: royger, network.
liuw_liuw.name set the repository for this revision to rS FreeBSD src repository - subversion.
liuw_liuw.name added a project: network.

I think some other fixups are needed if MAX_TX_REQ_FRAGS is changed.

sys/dev/xen/netfront/netfront.c
112

AFAICT changing this requires some other fixups in the code,

For example in xn_assemble_tx_request shouldn't we add a +1 to the check:

if (nfrags > MAX_TX_REQ_FRAGS) {
sys/dev/xen/netfront/netfront.c
112

I don't think so.

It wouldn't hurt to do that, but then that restores the same behaviour that makes driver domain less efficient.

sys/dev/xen/netfront/netfront.c
112

I don't know much about netfront, but AFAICT Linux is doing this check like:

if (unlikely(slots > MAX_SKB_FRAGS + 1)) {

Can you elaborate on why does this affect driver domains specifically?

sys/dev/xen/netfront/netfront.c
112

So this is an independent issue in FreeBSD netfront.

I don't know enough of how a packet in FreeBSD is assembled, but it indeed looks like it should be MAX_TX_REQ_FRAGS+1, regardless of what the value of MAX_TX_REQ_FRAGS is.

Do you want another patch for that?

sys/dev/xen/netfront/netfront.c
112

TBH, I don't know that much, but for example I'm wondering whether:

ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS;

Should then also be adjusted to:

ifp->if_hw_tsomaxsegcount = MAX_TX_REQ_FRAGS + 1;

And also I'm not sure about the following line:

	return (RING_FREE_REQUESTS(&np->tx) > (MAX_TX_REQ_FRAGS + 2));

Because AFAICT we only need one extra request per mbuf chain (to account for the netif_extra_info request payload).

sys/dev/xen/netfront/netfront.c
112

I think it's better we just drop this patch and revisit it later when I have better understanding of FreeBSD network stack.