Page MenuHomeFreeBSD

Under RSS, assign a TCP flow's inp_flowid anyway.
ClosedPublic

Authored by cc on May 11 2023, 1:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 9:15 PM
Unknown Object (File)
Sat, Apr 20, 5:37 PM
Unknown Object (File)
Fri, Apr 19, 8:10 AM
Unknown Object (File)
Fri, Apr 19, 2:41 AM
Unknown Object (File)
Sun, Apr 7, 12:48 AM
Unknown Object (File)
Sat, Apr 6, 4:35 PM
Unknown Object (File)
Mon, Apr 1, 1:27 AM
Unknown Object (File)
Mar 7 2024, 11:00 AM

Details

Summary

This brings some benefit of a tcp flow identification for some kernel
modules, such as siftr.

Test Plan

Tested in an Emulab testbed.

before this change:
cc@s1:~ % netstat -nRp tcp
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address flowid ftype
tcp6 28 0 fd00::2.41352 fd00::3.5001 00000000 0
tcp6 28 0 fd00::2.10845 fd00::3.5001 00000000 0
tcp6 28 0 fd00::2.28532 fd00::3.5001 00000000 0
tcp6 28 0 fd00::2.34124 fd00::3.5001 00000000 0
tcp4 0 0 127.0.0.1.16505 127.0.0.1.57268 00000000 0
tcp4 0 0 127.0.0.1.57268 127.0.0.1.16505 00000000 0
tcp4 0 0 127.0.0.1.16505 127.0.0.1.37918 00000000 0
tcp4 0 0 127.0.0.1.37918 127.0.0.1.16505 00000000 0

after this change:
cc@s1:~ % netstat -nRp tcp
Active Internet connections
Proto Recv-Q Send-Q Local Address Foreign Address flowid ftype
tcp6 28 0 fd00::2.43004 fd00::3.5001 8458ef94 132
tcp6 28 0 fd00::2.59450 fd00::3.5001 f96e24cf 132
tcp6 28 0 fd00::2.25706 fd00::3.5001 70119d2f 132
tcp6 28 0 fd00::2.27760 fd00::3.5001 8a1ed781 132
tcp4 0 0 127.0.0.1.16505 127.0.0.1.30417 e34c3361 130
tcp4 0 0 127.0.0.1.30417 127.0.0.1.16505 58b6e0bb 130
tcp4 0 0 127.0.0.1.16505 127.0.0.1.18519 c47bf08d 130
tcp4 0 0 127.0.0.1.18519 127.0.0.1.16505 9b5a6416 130

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cc requested review of this revision.May 11 2023, 1:13 PM
sys/netinet/tcp_input.c
973

Would it make sense to organize the code above and below like:

if ((inp->inp_flowtype == M_HASHTYPE_NONE) &&
    !SOLISTENING(inp->inp_socket)) {
        if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) {
                inp->inp_flowid = m->m_pkthdr.flowid;
		inp->inp_flowtype = M_HASHTYPE_GET(m);
#ifdef RSS
	} else {
                /* assign flowid by software RSS hash */
                ...
#endif
        }
}
sys/netinet/tcp_input.c
973

Good idea. Will change. Thanks.

cleanup change and fix a bug in this change

This revision is now accepted and ready to land.May 18 2023, 3:10 PM
sys/netinet/tcp_input.c
947

Why not do

#ifdef RSS
       } else {
...
#endif
       }
sys/netinet/tcp_input.c
947

I see what you mean now. I will clean it up. Thanks.

This revision now requires review to proceed.May 18 2023, 6:26 PM
cc marked an inline comment as done.May 18 2023, 6:45 PM
This revision is now accepted and ready to land.May 18 2023, 6:48 PM
This revision was automatically updated to reflect the committed changes.