зеркало из https://github.com/microsoft/msquic.git
Update DocFx after documentation changes.
This commit is contained in:
Родитель
f5dc62d123
Коммит
6f93368e02
|
@ -212,6 +212,54 @@ to install CMake.</p>
|
||||||
<pre><code>sudo dnf install openssl-devel
|
<pre><code>sudo dnf install openssl-devel
|
||||||
sudo dnf install libatomic
|
sudo dnf install libatomic
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
<h4 id="linux-xdp">Linux XDP</h4>
|
||||||
|
<p>Linux XDP is experimentally supported on amd64 && Ubuntu 22.04LTS.<br>
|
||||||
|
Commands below automatically install dependencies and setup runtime environment.</p>
|
||||||
|
<pre><code class="lang-sh">pwsh ./scripts/prepare-machine.ps1 -UseXdp
|
||||||
|
pwsh ./scripts/build.ps1
|
||||||
|
export MSQUIC_ENABLE_XDP=1
|
||||||
|
</code></pre>
|
||||||
|
<p><code>./scripts/prepare-machine.ps1</code> internally does the below commands:</p>
|
||||||
|
<pre><code class="lang-sh"># for libxdp v1.4.2
|
||||||
|
sudo apt-add-repository "deb http://mirrors.kernel.org/ubuntu noble main" -y
|
||||||
|
|
||||||
|
# install runtime dependencies
|
||||||
|
sudo apt-get install -y libxdp1 libbpf1 libnl-3-200 libnl-route-3-200 libnl-genl-3-200
|
||||||
|
|
||||||
|
# install build dependencies
|
||||||
|
sudo apt-get --no-install-recommends -y install libxdp-dev libbpf-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev zlib1g-dev zlib1g pkg-config m4 clang libpcap-dev libelf-dev libc6-dev-i386
|
||||||
|
|
||||||
|
# Optional. This is required when you run test with duonic (XDP capable virtual nic pair)
|
||||||
|
sudo apt-get -y install iproute2 iptables
|
||||||
|
sudo ./scripts/duonic.sh install
|
||||||
|
</code></pre>
|
||||||
|
<p>Test</p>
|
||||||
|
<pre><code class="lang-sh"># "sudo" and MSQUIC_ENABLE_XDP=1 required
|
||||||
|
# You can explicitly specify directory of datapath_raw_xdp_kern.o by MSQUIC_XDP_OBJECT_PATH
|
||||||
|
# By default, libmsquic.so searchs for same directory as its executable
|
||||||
|
# If something failed, fallback to normal socket
|
||||||
|
sudo MSQUIC_ENABLE_XDP=1 ./artifacts/bin/linux/x64_Debug_openssl3/msquictest --duoNic
|
||||||
|
</code></pre>
|
||||||
|
<p><strong>Q&A</strong></p>
|
||||||
|
<ul>
|
||||||
|
<li>Q: Is this workload really running on XDP?<br>
|
||||||
|
A: If you have the <code>xdp-dump</code> command, try using <code>sudo xdp-dump --list-interfaces</code>. The <code>xdp_main</code> function is located in <code>src/platform/datapath_raw_xdp_linux_kern.c</code>. If none of the interfaces load the XDP program, something must be wrong.</li>
|
||||||
|
</ul>
|
||||||
|
<pre><code>$ sudo ./xdp-tools/xdp-dump/xdpdump --list-interfaces
|
||||||
|
Interface Prio Program name Mode ID Tag Chain actions
|
||||||
|
--------------------------------------------------------------------------------------
|
||||||
|
lo <No XDP program loaded!>
|
||||||
|
eth0 <No XDP program loaded!>
|
||||||
|
docker0 <No XDP program loaded!>
|
||||||
|
duo2 xdp_dispatcher native 608211 4d7e87c0d30db711
|
||||||
|
=> 50 xdp_main 608220 c8fcabdd9e3895f3 XDP_PASS
|
||||||
|
duo1 xdp_dispatcher native 608225 4d7e87c0d30db711
|
||||||
|
=> 50 xdp_main 608228 c8fcabdd9e3895f3 XDP_PASS
|
||||||
|
</code></pre>
|
||||||
|
<ul>
|
||||||
|
<li>Q: Is Ubuntu 20.04LTS supported?<br>
|
||||||
|
A: Not officially, but you can still <strong>build</strong> it by running <code>apt-get upgrade linux-libc-dev</code>. Please be aware of potential side effects from the <strong>upgrade</strong>.</li>
|
||||||
|
</ul>
|
||||||
<h3 id="macos">macOS</h3>
|
<h3 id="macos">macOS</h3>
|
||||||
<p>The build needs CMake and compiler.</p>
|
<p>The build needs CMake and compiler.</p>
|
||||||
<pre><code>brew install cmake
|
<pre><code>brew install cmake
|
||||||
|
|
|
@ -114,6 +114,24 @@
|
||||||
</ol>
|
</ol>
|
||||||
<h2 id="logging">Logging</h2>
|
<h2 id="logging">Logging</h2>
|
||||||
<p>See <a href="Diagnostics.html#Built-in-Tracing">Tracing</a></p>
|
<p>See <a href="Diagnostics.html#Built-in-Tracing">Tracing</a></p>
|
||||||
|
<h3 id="linux-xdp-logging">Linux XDP logging?</h3>
|
||||||
|
<p>For XDP layer, enable <code>DEBUG</code> flag in <code>src/platform/CMakeLists.txt</code>.<br>
|
||||||
|
You can see incomming packets information by <code>sudo cat /sys/kernel/debug/tracing/trace_pipe</code>.<br>
|
||||||
|
<strong>Your workload must become too slow.</strong></p>
|
||||||
|
<pre><code>msquictest-3797496 [005] ..s1. 2079546.776875: bpf_trace_printk: ========> To ifacename : [duo2], RxQueueID:0
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.776875: bpf_trace_printk: Eth[244] SRC: 00:00:00:00:00:00 => DST:22:22:22:22:00:02
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.776876: bpf_trace_printk: Ipv4 TotalLen:[230] Src: 192.168.1.11 => Dst: 192.168.1.12
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.776877: bpf_trace_printk: UDP[202]: SRC: 43829 DST:58141
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.776877: bpf_trace_printk: [ec 00 00 00 01 00 09 c0 30 3d 49 a2]
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.776878: bpf_trace_printk: Redirect to QUIC service. IpMatch:1, PortMatch:1, SocketExists:1, Redirection:4
|
||||||
|
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777235: bpf_trace_printk: ========> To ifacename : [duo1], RxQueueID:0
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777310: bpf_trace_printk: Eth[1262] SRC: 00:00:00:00:00:00 => DST:22:22:22:22:00:01
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777323: bpf_trace_printk: Ipv4 TotalLen:[1248] Src: 192.168.1.12 => Dst: 192.168.1.11
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777323: bpf_trace_printk: UDP[1220]: SRC: 58141 DST:43829
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777324: bpf_trace_printk: [c0 00 00 00 01 09 c0 30 3d 49 a2 56]
|
||||||
|
msquictest-3797496 [005] ..s1. 2079546.777325: bpf_trace_printk: Redirect to QUIC service. IpMatch:1, PortMatch:1, SocketExists:1, Redirection:4
|
||||||
|
</code></pre>
|
||||||
<h2 id="understanding-error-codes">Understanding Error Codes</h2>
|
<h2 id="understanding-error-codes">Understanding Error Codes</h2>
|
||||||
<p>Some error codes are MsQuic specific (<code>QUIC_STATUS_*</code>), and some are simply a passthrough from the platform. You can find the MsQuic specific error codes in the platform specific header (<a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_posix.h">msquic_posix.h</a>, <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winkernel.h">msquic_winkernel.h</a>, or <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winuser.h">msquic_winuser.h</a>).</p>
|
<p>Some error codes are MsQuic specific (<code>QUIC_STATUS_*</code>), and some are simply a passthrough from the platform. You can find the MsQuic specific error codes in the platform specific header (<a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_posix.h">msquic_posix.h</a>, <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winkernel.h">msquic_winkernel.h</a>, or <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winuser.h">msquic_winuser.h</a>).</p>
|
||||||
<p>From <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winuser.h">msquic_winuser.h</a>:</p>
|
<p>From <a href="https://github.com/microsoft/msquic/tree/main/src/inc/msquic_winuser.h">msquic_winuser.h</a>:</p>
|
||||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Загрузка…
Ссылка в новой задаче