QUIC requires end to end encryption of the data. The application usually
prepares the data in clear text, encrypts and calls send() which implies
multiple copies of the data before the packets hit the networking stack.
Similar to kTLS, QUIC kernel offload of cryptography reduces the memory
pressure by reducing the number of copies.
The scope of kernel support is limited to the symmetric cryptography,
leaving the handshake to the user space library. For QUIC in particular,
the application packets that require symmetric cryptography are the 1RTT
packets with short headers. Kernel will encrypt the application packets
on transmission and decrypt on receive. This series implements Tx only,
because in QUIC server applications Tx outweighs Rx by orders of
magnitude.
Supporting the combination of QUIC and GSO requires the application to
correctly place the data and the kernel to correctly slice it. The
encryption process appends an arbitrary number of bytes (tag) to the end
of the message to authenticate it. The GSO value should include this
overhead, the offload would then subtract the tag size to parse the
input on Tx before chunking and encrypting it.
With the kernel cryptography, the buffer copy operation is conjoined
with the encryption operation. The memory bandwidth is reduced by 5-8%.
When devices supporting QUIC encryption in hardware come to the market,
we will be able to free further 7% of CPU utilization which is used
today for crypto operations.
Adel Abouchaev (6):
Documentation on QUIC kernel Tx crypto.
Define QUIC specific constants, control and data plane structures
Add UDP ULP operations, initialization and handling prototype
functions.
Implement QUIC offload functions
Add flow counters and Tx processing error counter
Add self tests for ULP operations, flow setup and crypto tests
Documentation/networking/index.rst | 1 +
Documentation/networking/quic.rst | 185 ++++
include/net/inet_sock.h | 2 +
include/net/netns/mib.h | 3 +
include/net/quic.h | 63 ++
include/net/snmp.h | 6 +
include/net/udp.h | 33 +
include/uapi/linux/quic.h | 60 +
include/uapi/linux/snmp.h | 9 +
include/uapi/linux/udp.h | 4 +
net/Kconfig | 1 +
net/Makefile | 1 +
net/ipv4/Makefile | 3 +-
net/ipv4/udp.c | 15 +
net/ipv4/udp_ulp.c | 192 ++++
net/quic/Kconfig | 16 +
net/quic/Makefile | 8 +
net/quic/quic_main.c | 1417 ++++++++++++++++++++++++
net/quic/quic_proc.c | 45 +
tools/testing/selftests/net/.gitignore | 4 +-
tools/testing/selftests/net/Makefile | 3 +-
tools/testing/selftests/net/quic.c | 1153 +++++++++++++++++++
tools/testing/selftests/net/quic.sh | 46 +
23 files changed, 3267 insertions(+), 3 deletions(-)
create mode 100644 Documentation/networking/quic.rst
create mode 100644 include/net/quic.h
create mode 100644 include/uapi/linux/quic.h
create mode 100644 net/ipv4/udp_ulp.c
create mode 100644 net/quic/Kconfig
create mode 100644 net/quic/Makefile
create mode 100644 net/quic/quic_main.c
create mode 100644 net/quic/quic_proc.c
create mode 100644 tools/testing/selftests/net/quic.c
create mode 100755 tools/testing/selftests/net/quic.sh
base-commit: fd78d07c7c35de260eb89f1be4a1e7487b8092ad
--
2.30.2
Page_idle uses {ptep/pmdp}_clear_young_notify which in turn calls
the mmu notifier callback ->clear_young(), which purposefully
does not flush the TLB.
When running the test in a nested guest, point 1. of the test
doc header is violated, because KVM TLB is unbounded by size
and since no flush is forced, KVM does not update the sptes
accessed/idle bits resulting in guest assertion failure.
More precisely, only the first ACCESS_WRITE in run_test() actually
makes visible changes, because sptes are created and the accessed
bit is set to 1 (or idle bit is 0). Then the first mark_memory_idle()
passes since access bit is still one, and sets all pages as idle
(or not accessed). When the next write is performed, the update
is not flushed therefore idle is still 1 and next mark_memory_idle()
fails.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit(a)redhat.com>
---
.../selftests/kvm/access_tracking_perf_test.c | 25 ++++++++++++-------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/tools/testing/selftests/kvm/access_tracking_perf_test.c b/tools/testing/selftests/kvm/access_tracking_perf_test.c
index 1c2749b1481a..87b0bd5ebc65 100644
--- a/tools/testing/selftests/kvm/access_tracking_perf_test.c
+++ b/tools/testing/selftests/kvm/access_tracking_perf_test.c
@@ -31,8 +31,9 @@
* These limitations are worked around in this test by using a large enough
* region of memory for each vCPU such that the number of translations cached in
* the TLB and the number of pages held in pagevecs are a small fraction of the
- * overall workload. And if either of those conditions are not true this test
- * will fail rather than silently passing.
+ * overall workload. And if either of those conditions are not true (for example
+ * in nesting, where TLB size is unlimited) this test will print a warning
+ * rather than silently passing.
*/
#include <inttypes.h>
#include <limits.h>
@@ -172,17 +173,23 @@ static void mark_vcpu_memory_idle(struct kvm_vm *vm,
vcpu_idx, no_pfn, pages);
/*
- * Test that at least 90% of memory has been marked idle (the rest might
- * not be marked idle because the pages have not yet made it to an LRU
- * list or the translations are still cached in the TLB). 90% is
+ * Check that at least 90% of memory has been marked idle (the rest
+ * might not be marked idle because the pages have not yet made it to an
+ * LRU list or the translations are still cached in the TLB). 90% is
* arbitrary; high enough that we ensure most memory access went through
* access tracking but low enough as to not make the test too brittle
* over time and across architectures.
+ *
+ * Note that when run in nested virtualization, this check will trigger
+ * much more frequently because TLB size is unlimited and since no flush
+ * happens, much more pages are cached there and guest won't see the
+ * "idle" bit cleared.
*/
- TEST_ASSERT(still_idle < pages / 10,
- "vCPU%d: Too many pages still idle (%"PRIu64 " out of %"
- PRIu64 ").\n",
- vcpu_idx, still_idle, pages);
+ if (still_idle < pages / 10)
+ printf("WARNING: vCPU%d: Too many pages still idle (%"PRIu64 "
+ out of %" PRIu64 "), this will affect performance results
+ .\n",
+ vcpu_idx, still_idle, pages);
close(page_idle_fd);
close(pagemap_fd);
--
2.31.1
>
> On 26.09.22 15:03, Zhao Gongyi wrote:
> > Add checking for online_memory_expect_success()/
> > offline_memory_expect_success()/offline_memory_expect_fail(), or
> the
> > test would exit 0 although the functions return 1.
> >
> > Signed-off-by: Zhao Gongyi <zhaogongyi(a)huawei.com>
> > ---
> > .../selftests/memory-hotplug/mem-on-off-test.sh | 15
> ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
> > b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
> > index 46a97f318f58..3edda1f13f7b 100755
> > --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
> > +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh
> > @@ -266,7 +266,10 @@ done
> > #
> > echo $error >
> $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
> > for memory in `hotpluggable_offline_memory`; do
> > - online_memory_expect_fail $memory
> > + online_memory_expect_fail $memory || {
> > + echo "online memory $memory: unexpected success"
>
> The functions themself already print an error, isn't it sufficient to set
> retval=1?
Indeed, this function is only called once. It is no need to add the log info.
>
> > + retval=1
> > + }
> > done
> >
> > #
> > @@ -274,7 +277,10 @@ done
> > #
> > echo 0 >
> $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_ONLINE/error
> > for memory in `hotpluggable_offline_memory`; do
> > - online_memory_expect_success $memory
> > + online_memory_expect_success $memory || {
> > + echo "online memory $memory: unexpected fail"
> > + retval=1
> > + }
> > done
> >
> > #
> > @@ -283,7 +289,10 @@ done
> > echo $error >
> $NOTIFIER_ERR_INJECT_DIR/actions/MEM_GOING_OFFLINE/error
> > for memory in `hotpluggable_online_memory`; do
> > if [ $((RANDOM % 100)) -lt $ratio ]; then
> > - offline_memory_expect_fail $memory
> > + offline_memory_expect_fail $memory || {
> > + echo "offline memory $memory: unexpected success"
> > + retval=1
> > + }
>
> These functions return 0 if the result is as expected and 1 if the result is
> unexpected.
>
> ... but wouldn't we evaluate the right hand side only if the result is "0" --
> expected? I might be wrong.
>
Yes, if offline_memory_expect_fail's return value is not zero, then it will set 'retval=1'
>
> Wouldn't it be simpler do it as in "Online all hot-pluggable memory again"
>
> if ! online_memory_expect_success $memory; then
> retval=1
> fi
>
> (similarly adjusting the function name)
I will send a new version of the patch to fix it.
Kind regards,
Gongyi
In test_sockmap.c, the testcase sets socket nonblock first, and then
calls select() and recvmsg() to receive data.
If some error occur, nonblock setting will make recvmsg() return
immediately, rather than blocking forever.
However, the way to call fcntl() to set nonblock is wrong.
To set socket noblock, we need to use
> fcntl(fd, F_SETFL, O_NONBLOCK);
rather than:
> fcntl(fd, O_NONBLOCK);
Signed-off-by: Qiao Ma <mqaio(a)linux.alibaba.com>
---
tools/testing/selftests/bpf/test_sockmap.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 0fbaccdc8861..abb4102f33b0 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -598,7 +598,12 @@ static int msg_loop(int fd, int iov_count, int iov_length, int cnt,
struct timeval timeout;
fd_set w;
- fcntl(fd, fd_flags);
+ err = fcntl(fd, F_SETFL, fd_flags);
+ if (err < 0) {
+ perror("fcntl failed");
+ goto out_errno;
+ }
+
/* Account for pop bytes noting each iteration of apply will
* call msg_pop_data helper so we need to account for this
* by calculating the number of apply iterations. Note user
--
1.8.3.1
For this patchset, test cases of the qdisc modules are added to the
tc-testing test suite.
After a test case is added locally, the test result is as follows:
./tdc.py -c atm
ok 1 7628 - Create ATM with default setting
ok 2 390a - Delete ATM with valid handle
ok 3 32a0 - Show ATM class
ok 4 6310 - Dump ATM stats
./tdc.py -c choke
ok 1 8937 - Create CHOKE with default setting
ok 2 48c0 - Create CHOKE with min packet setting
ok 3 38c1 - Create CHOKE with max packet setting
ok 4 234a - Create CHOKE with ecn setting
ok 5 4380 - Create CHOKE with burst setting
ok 6 48c7 - Delete CHOKE with valid handle
ok 7 4398 - Replace CHOKE with min setting
ok 8 0301 - Change CHOKE with limit setting
./tdc.py -c codel
ok 1 983a - Create CODEL with default setting
ok 2 38aa - Create CODEL with limit packet setting
ok 3 9178 - Create CODEL with target setting
ok 4 78d1 - Create CODEL with interval setting
ok 5 238a - Create CODEL with ecn setting
ok 6 939c - Create CODEL with ce_threshold setting
ok 7 8380 - Delete CODEL with valid handle
ok 8 289c - Replace CODEL with limit setting
ok 9 0648 - Change CODEL with limit setting
./tdc.py -c etf
ok 1 34ba - Create ETF with default setting
ok 2 438f - Create ETF with delta nanos setting
ok 3 9041 - Create ETF with deadline_mode setting
ok 4 9a0c - Create ETF with skip_sock_check setting
ok 5 2093 - Delete ETF with valid handle
./tdc.py -c fq
ok 1 983b - Create FQ with default setting
ok 2 38a1 - Create FQ with limit packet setting
ok 3 0a18 - Create FQ with flow_limit setting
ok 4 2390 - Create FQ with quantum setting
ok 5 845b - Create FQ with initial_quantum setting
ok 6 9398 - Create FQ with maxrate setting
ok 7 342c - Create FQ with nopacing setting
ok 8 6391 - Create FQ with refill_delay setting
ok 9 238b - Create FQ with low_rate_threshold setting
ok 10 7582 - Create FQ with orphan_mask setting
ok 11 4894 - Create FQ with timer_slack setting
ok 12 324c - Create FQ with ce_threshold setting
ok 13 424a - Create FQ with horizon time setting
ok 14 89e1 - Create FQ with horizon_cap setting
ok 15 32e1 - Delete FQ with valid handle
ok 16 49b0 - Replace FQ with limit setting
ok 17 9478 - Change FQ with limit setting
./tdc.py -c gred
ok 1 8942 - Create GRED with default setting
ok 2 5783 - Create GRED with grio setting
ok 3 8a09 - Create GRED with limit setting
ok 4 48cb - Create GRED with ecn setting
ok 5 763a - Change GRED setting
ok 6 8309 - Show GRED class
./tdc.py -c hhf
ok 1 4812 - Create HHF with default setting
ok 2 8a92 - Create HHF with limit setting
ok 3 3491 - Create HHF with quantum setting
ok 4 ba04 - Create HHF with reset_timeout setting
ok 5 4238 - Create HHF with admit_bytes setting
ok 6 839f - Create HHF with evict_timeout setting
ok 7 a044 - Create HHF with non_hh_weight setting
ok 8 32f9 - Change HHF with limit setting
ok 9 385e - Show HHF class
./tdc.py -c pfifo_fast
ok 1 900c - Create pfifo_fast with default setting
ok 2 7470 - Dump pfifo_fast stats
ok 3 b974 - Replace pfifo_fast with different handle
ok 4 3240 - Delete pfifo_fast with valid handle
ok 5 4385 - Delete pfifo_fast with invalid handle
./tdc.py -c plug
ok 1 3289 - Create PLUG with default setting
ok 2 0917 - Create PLUG with block setting
ok 3 483b - Create PLUG with release setting
ok 4 4995 - Create PLUG with release_indefinite setting
ok 5 389c - Create PLUG with limit setting
ok 6 384a - Delete PLUG with valid handle
ok 7 439a - Replace PLUG with limit setting
ok 8 9831 - Change PLUG with limit setting
./tdc.py -c sfb
ok 1 3294 - Create SFB with default setting
ok 2 430a - Create SFB with rehash setting
ok 3 3410 - Create SFB with db setting
ok 4 49a0 - Create SFB with limit setting
ok 5 1241 - Create SFB with max setting
ok 6 3249 - Create SFB with target setting
ok 7 30a9 - Create SFB with increment setting
ok 8 239a - Create SFB with decrement setting
ok 9 9301 - Create SFB with penalty_rate setting
ok 10 2a01 - Create SFB with penalty_burst setting
ok 11 3209 - Change SFB with rehash setting
ok 12 5447 - Show SFB class
./tdc.py -c sfq
ok 1 7482 - Create SFQ with default setting
ok 2 c186 - Create SFQ with limit setting
ok 3 ae23 - Create SFQ with perturb setting
ok 4 a430 - Create SFQ with quantum setting
ok 5 4539 - Create SFQ with divisor setting
ok 6 b089 - Create SFQ with flows setting
ok 7 99a0 - Create SFQ with depth setting
ok 8 7389 - Create SFQ with headdrop setting
ok 9 6472 - Create SFQ with redflowlimit setting
ok 10 8929 - Show SFQ class
./tdc.py -c skbprio
ok 1 283e - Create skbprio with default setting
ok 2 c086 - Create skbprio with limit setting
ok 3 6733 - Change skbprio with limit setting
ok 4 2958 - Show skbprio class
./tdc.py -c taprio
ok 1 ba39 - Add taprio Qdisc to multi-queue device (8 queues)
ok 2 9462 - Add taprio Qdisc with multiple sched-entry
ok 3 8d92 - Add taprio Qdisc with txtime-delay
ok 4 d092 - Delete taprio Qdisc with valid handle
ok 5 8471 - Show taprio class
ok 6 0a85 - Add taprio Qdisc to single-queue device
./tdc.py -c tbf
ok 1 6430 - Create TBF with default setting
ok 2 0518 - Create TBF with mtu setting
ok 3 320a - Create TBF with peakrate setting
ok 4 239b - Create TBF with latency setting
ok 5 c975 - Create TBF with overhead setting
ok 6 948c - Create TBF with linklayer setting
ok 7 3549 - Replace TBF with mtu
ok 8 f948 - Change TBF with latency time
ok 9 2348 - Show TBF class
./tdc.py -c teql
ok 1 84a0 - Create TEQL with default setting
ok 2 7734 - Create TEQL with multiple device
ok 3 34a9 - Delete TEQL with valid handle
ok 4 6289 - Show TEQL stats
---
v2: modify subject prefix
---
Zhengchao Shao (15):
selftests/tc-testing: add selftests for atm qdisc
selftests/tc-testing: add selftests for choke qdisc
selftests/tc-testing: add selftests for codel qdisc
selftests/tc-testing: add selftests for etf qdisc
selftests/tc-testing: add selftests for fq qdisc
selftests/tc-testing: add selftests for gred qdisc
selftests/tc-testing: add selftests for hhf qdisc
selftests/tc-testing: add selftests for pfifo_fast qdisc
selftests/tc-testing: add selftests for plug qdisc
selftests/tc-testing: add selftests for sfb qdisc
selftests/tc-testing: add selftests for sfq qdisc
selftests/tc-testing: add selftests for skbprio qdisc
selftests/tc-testing: add selftests for taprio qdisc
selftests/tc-testing: add selftests for tbf qdisc
selftests/tc-testing: add selftests for teql qdisc
.../tc-testing/tc-tests/qdiscs/atm.json | 94 +++++
.../tc-testing/tc-tests/qdiscs/choke.json | 188 +++++++++
.../tc-testing/tc-tests/qdiscs/codel.json | 211 ++++++++++
.../tc-testing/tc-tests/qdiscs/etf.json | 117 ++++++
.../tc-testing/tc-tests/qdiscs/fq.json | 395 ++++++++++++++++++
.../tc-testing/tc-tests/qdiscs/gred.json | 164 ++++++++
.../tc-testing/tc-tests/qdiscs/hhf.json | 210 ++++++++++
.../tc-tests/qdiscs/pfifo_fast.json | 119 ++++++
.../tc-testing/tc-tests/qdiscs/plug.json | 188 +++++++++
.../tc-testing/tc-tests/qdiscs/sfb.json | 279 +++++++++++++
.../tc-testing/tc-tests/qdiscs/sfq.json | 232 ++++++++++
.../tc-testing/tc-tests/qdiscs/skbprio.json | 95 +++++
.../tc-testing/tc-tests/qdiscs/taprio.json | 135 ++++++
.../tc-testing/tc-tests/qdiscs/tbf.json | 211 ++++++++++
.../tc-testing/tc-tests/qdiscs/teql.json | 97 +++++
15 files changed, 2735 insertions(+)
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/atm.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/choke.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/codel.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/etf.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/fq.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/gred.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/hhf.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/pfifo_fast.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/plug.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfb.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/sfq.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/skbprio.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/taprio.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/tbf.json
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/qdiscs/teql.json
--
2.17.1