dpaa2: Perform bus_dma pre-write sync before enqueue operation
Without a proper synchronization payload of the egress TCP segments
can be corrupted as tuexen@ described in
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292006#c31.
This patch is indirectly related to 292006 because a properly enabled
and announced support for the TX checksum offloading hides potentially
corrupted frame payload.
PR: 292006
Reported by: tuexen@
Reviewed by: tuexen@
Tested by: dsl@, tuexen@
Differential Revision: https://reviews.freebsd.org/D56144
MFC after: 3 days
(cherry picked from commit 5812415bee55a9063508b02fda9418b0eadb0bb4)
tunefs: Don't combine GEOM journaling with SU
GEOM journaling shouldn't be used at the same time as soft updates, so
don't enable one if the other is already in use.
MFC after: 1 week
PR: 293896
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D56002
(cherry picked from commit b1f72dd2a9a5e69a310b9e76b55f16cff433b8da)
newfs: Don't combine GEOM journaling with SU
GEOM journaling shouldn't be used at the same time as soft updates, so
don't enable soft updates if GEOM journaling has been requested, and
error out if both are explicitly requested.
MFC after: 1 week
PR: 293896
Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D55999
(cherry picked from commit e30fcdaae2e68458da83d5420e6034c5f384e5f2)
tcp: retire TF_SENTSYN
This TF_-flag is only used in the RACK stack and not really needed.
So replace it, since glebius@ needs a TF_ flag and right now all
of them are taken.
No functional change intended.
Reviewed by: rrs, glebius, rscheff, Nick Banks
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D56025
timerfd: Add tests
Take Jan Kokemuller's timerfd tests from the epoll-shim project,
stripping out code that isn't directly related to FreeBSD.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55789
MFC after: 2 weeks
(cherry picked from commit 834c1ba793d900b791e19ff449b1e0b96fb494a0)
timerfd: Expect periodic timer performance failures
The current timerfd implementation fails to correctly count events on a
nanosecond callout interval. The timerfd__periodic_timer_performance
test detects this and reports failure.
Mark this test as an expected failure so it isn't flagged by CI. A link
to the bug report is attached to the test for reference.
While we're here, clean up some minor style and Make issues.
Fixes: 834c1ba793d9 ("timerfd: Add tests")
MFC after: 1 week
(cherry picked from commit cb692380f1e05ffc4184877844e93051f24ed302)
timerfd: Use saturating sbintime conversions
Some timerfd consumers set expirations with timespec tv_sec components
larger than 2^31 - 1. In such cases, converting that timespec to
sbintime results in data loss or sign flip, yielding a shorter
expiration than desired.
To avoid this problem, use saturating timespec-to-sbintime conversion
functions. These will clamp the converted sbintime to SBT_MAX under
circumstances where the normal conversion functions would overflow.
Saturating conversions still result in data loss, but the consequences
are less severe, causing problems only after SBT_MAX (~68 years) of
system uptime elapses.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D55792
MFC after: 2 weeks
(cherry picked from commit 0e8f351be7935729bf67dc1b7aa4d178cf154931)
timerfd: Wake up on discontinuous jump
If a discontinous realtime clock change occurs and sets any TFD_JUMPED
bits on the timerfd, then wake up waiting readers. This fixes failures
from the timerfd_root__clock_change_notification test case.
MFC after: 2 weeks
(cherry picked from commit b11fba41265ae132acfb05587a6dbf60334d3279)
sys/time: Add saturating sbt conversions
When converting from timespec to sbintime, the timespec's 64-bit tv_sec
component is shifted to the left 32 bits, causing any information in the
upper 32 bits to be lost.
This data loss during conversion can turn timespecs with very large
tv_sec counters into sbintimes that represent much smaller time
durations.
Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of
tstosbt and tvtosbt. With these routines, any overflow resulting from
the conversion is clamped to [-SBT_MAX - 1, SBT_MAX].
Reviewed by: imp, markj
Differential Revision: https://reviews.freebsd.org/D55791
MFC after: 2 weeks
(cherry picked from commit e3799530b3ba38567f8052b9e107884609fc71ea)
timerfd: Suppress kqueue readability after jump read
Do not report EVFILT_READ after reading a discontinuous clock jump.
This makes the kqueue filter consistent with Linux epoll behavior
and timerfd_poll(), which already checks tfd_jumped != TFD_READ before
reporting POLLIN.
MFC after: 2 weeks
(cherry picked from commit 33345b8834859cf1ad7f1256f3a34b4a7c83e8e8)
timerfd: Guard expected performance failure
During the timerfd__periodic_timer_performance test, only expect
failures when the expiration count is less than 400000000. This
prevents the test from being reported as a true failure in environments
where scheduling latency is high enough to delay timerfd wakeups.
Fixes: cb692380f1e0 ("timerfd: Expect periodic timer ...")
MFC after: 1 week
(cherry picked from commit 4b16ff49bf4bf875997fe4c80a0afc0d440b7aac)
timerfd: Fix interval callout scheduling
When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.
Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.
This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D55790
MFC after: 2 weeks
(cherry picked from commit 85c0f1a87da1fd1eb3e646e86f70e630c48da91a)