User Details
- User Since
- May 28 2014, 2:27 PM (633 w, 4 d)
Fri, Jul 17
- Don't forget to clear the bit on inpcb disconnect/free. Thanks, Vova!
Some performance data. The test that pushes local port allocation to the corner run on CURRENT as base, then D58131 as unlock and then on D58131 and this revision combined as cache. Using virtual machine with 8 CPUs.
x base
+ unlock
* cache
+------------------------------------------------------------------------------+
|* |
|* |
|* |
|* |
|* |
|* |
|* + |
|* ++ |
|* ++ |
|* +++++ xx x x x xx x x x|
|A |A| |____________M__A______________| |
+------------------------------------------------------------------------------+
N Min Max Median Avg Stddev
x 10 14.44 36.24 21.28 22.525 7.2199696
+ 10 2.39 4.14 2.835 3.021 0.59897041
Difference at 95.0% confidence
-19.504 +/- 4.81339
-86.5882% +/- 3.35841%
(Student's t, pooled s = 5.12283)
* 10 0.14 0.21 0.14 0.147 0.022135944
Difference at 95.0% confidence
-22.378 +/- 4.79693
-99.3474% +/- 0.153552%
(Student's t, pooled s = 5.10531)Thu, Jul 16
IMHO, the check shall be located in in_pcbbind_avail() in the block that has the comment * Is the address a local IP address?. We need ifa_ifwithaddr() version that has fibnum argument. Many other functions in the ifa_if* family already have it. The IPv6 version is similar.
The struct in_endpoints can also be anonymized easily, but that would highly likely affect something outside of FreeBSD. Another level of #define to be removed. Let me know what you think about this and I will dig deeper into this if we all agree.
Note: union in_dependaddr can be anonymized after small cleanup of lbgroup code and siftr(4). This removes another level of of defines for both IPv6 and IPv4. This may need universe/exp-run, though.
Wed, Jul 15
- Rebase. Should now apply to main.
I got another naive benchmark. It exercises situation when we create as much as possible connections from us to a single peer:port eventually running out of ports. This exercises the worst case of the cycle in in_pcb_lport_dest(), which at the end of the test is executed for 10^4 times to find a port. While the cycle itself is not optimized at all, on a virtual machine with 8 CPUs the test passes 6-7 times faster than before the change.
Tue, Jul 14
Committed 57cc01057bb21fec37fa4fb7416b4a1f29a211c0
Sun, Jul 12
Thanks! Note that when doing such cleanups it is important to pay attention to the fact that bcopy(9) allows overlapping memory regions and memcpy(9) does not. In this particular patch everything looks fine.
Fri, Jul 10
Thu, Jul 9
I got naive microbenchmark. It allocates ncpu threads, and each threads creates n UDP sockets that are connect(2)-ed to a random valid address:port. In a test virtual machine with 8 CPUs and 10000 sockets per thread I got 6x-7x speedup. If the test is adjusted to close(2) sockets when 50% allocation is reached, so that both insertions and removals are exercised at the same time, the speedup is roughly the same. I didn't yet do any real tests on hardware, but benefits are clear.
No objections left from me.
Let me suggest a better KPI for wlock iterator. Instead of adding a wrapper function, just add const bool wlock member to struct nhop_iter. In that case all you need is to set it true in the initializer. Use same function to start and stop the iterator.
Wed, Jul 8
Didn't know about this one. Why didn't you push?
+ ObsoleteFiles.inc
Can you please make the pad variables unsigned? (and while here the associated length variables as well)
Tue, Jul 7
Thanks!
I decided to put this change on hold for a while.
I decided to put this change on hold for a while.
Mon, Jul 6
Duplicate of D57986
Fri, Jul 3
Yes, I was afraid of such problem when did this. Thanks for fixing!
I understand the change to pf_route(), but I do not understand the change to pf_test(). Why the second one is required? pf(4) definitely can test (read IP/TCP level headers) of mbuf chains that have M_EXTPG later in paylod.
Thu, Jul 2
I still can't understand :(
Wed, Jul 1
Thanks a lot! Didn't review the awk/sed code, since not an expert in it.
Cause we actually plan in the opposite direction: packets known to be valid (never went over a wire) shall not be checked.
Thanks! Stupid question: how did that happen that after Timo's change the loopback actually does check checksums?
- Add tunable to fallback to old behavior.
- Adjust tests.
- Document.
Tue, Jun 30
Mon, Jun 29
I don't want this library to dictate naming of enums all around. The whole idea of using text parser to parse C files is fragile. Clang delivers a proper solution. Hopefully gcc will catch up.
Sun, Jun 28
Yes, patch as is doesn't improve anything. The comment above the function clearly marks the intent: the function checks if packet should be dropped and if so provides error code. It doesn't provide error code in case packet shouldn't be dropped.
Can you please review my version instead? :) https://reviews.freebsd.org/D57865
Sat, Jun 27
Hi Neel,
Fri, Jun 26
- Pushed one to final version. Fixup.
bpf_attach() uses M_WAITOK (that's why it doesn't fail). This lock should be sx(9). IMHO, it should be asserted both in call to pflog_create() and pflog_destroy(). The startup calls to pflog_create() should also acquire the lock, just for consistency.
Note that there is a parent revision!
