<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>DPDK 原理与实践 - 系列 - Hugo笔记</title>
        <link>http://lovelycabin.dpdns.org/blog/series/dpdk-%E5%8E%9F%E7%90%86%E4%B8%8E%E5%AE%9E%E8%B7%B5/</link>
        <description>DPDK 原理与实践 - 系列 - Hugo笔记</description>
        <generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>ein_crimson@163.com (lilac)</managingEditor>
            <webMaster>ein_crimson@163.com (lilac)</webMaster><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Mon, 26 Dec 2022 11:26:00 &#43;0800</lastBuildDate><atom:link href="http://lovelycabin.dpdns.org/blog/series/dpdk-%E5%8E%9F%E7%90%86%E4%B8%8E%E5%AE%9E%E8%B7%B5/" rel="self" type="application/rss+xml" /><item>
    <title>DPDK 原理与实践</title>
    <link>http://lovelycabin.dpdns.org/blog/posts/series/dpdk/</link>
    <pubDate>Fri, 23 Sep 2022 13:16:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/posts/series/dpdk/</guid>
    <description><![CDATA[]]></description>
</item><item>
    <title>多队列网卡环境初始化</title>
    <link>http://lovelycabin.dpdns.org/blog/20220928/1664346420/</link>
    <pubDate>Wed, 28 Sep 2022 14:27:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20220928/1664346420/</guid>
    <description><![CDATA[<h2 id="基于wsl搭建未实现" class="headerLink">
    <a href="#%e5%9f%ba%e4%ba%8ewsl%e6%90%ad%e5%bb%ba%e6%9c%aa%e5%ae%9e%e7%8e%b0" class="header-mark"></a>7 基于WSL搭建（未实现）</h2><p>一、步骤总结</p>
<ol>
<li>创建虚拟网卡（使用hyper-v管理器创建虚拟交换设备）</li>
<li>将虚拟网卡绑定到WSL（有开源组件能够将多网卡对WSL进行绑定）</li>
<li>需要设置网卡类型，用于多队列支持（暂无头绪）
1）可尝试虚拟机队列（VMQ），目前不在WSL的可配置范围内</li>
</ol>
<blockquote>
  <p>由于wsl虚拟网卡相关资料较少，最后迁移到VMware上
WSL，VMware需要同时使用时，VMware的版本需要高一些，实测12.x不兼容，16.x能够兼容</p>]]></description>
</item><item>
    <title>网络设备与Linux</title>
    <link>http://lovelycabin.dpdns.org/blog/20220928/1664354160/</link>
    <pubDate>Wed, 28 Sep 2022 16:36:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20220928/1664354160/</guid>
    <description><![CDATA[<p>网络设备通常位于 <code>/sys/class/net/&lt;interface&gt;</code> 下。</p>
<ol>
<li>查看网卡是否支持多队列</li>
</ol>
<div class="code-block highlight is-closed show-line-numbers  tw-group tw-my-2">
  <div class="
    
    tw-flex 
    tw-flex-row
    tw-flex-1 
    tw-justify-between 
    tw-w-full tw-bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw-mx-2 
        tw-flex
        tw-flex-row
        tw-flex-1"
      aria-hidden="true">
          <div class="group-[.is-open]:tw-rotate-90 tw-transition-[transform] tw-duration-500 tw-ease-in-out print:!tw-hidden tw-w-min tw-h-min tw-my-1 tw-mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></div>
          <p class="tw-select-none !tw-my-1">text</p>]]></description>
</item><item>
    <title>DPDK入门</title>
    <link>http://lovelycabin.dpdns.org/blog/20221011/1665484620/</link>
    <pubDate>Tue, 11 Oct 2022 18:37:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221011/1665484620/</guid>
    <description><![CDATA[<ol>
<li>解决的问题，产生的由来</li>
</ol>]]></description>
</item><item>
    <title>DPDK常用结构体解析</title>
    <link>http://lovelycabin.dpdns.org/blog/20221011/1665488340/</link>
    <pubDate>Tue, 11 Oct 2022 19:39:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221011/1665488340/</guid>
    <description><![CDATA[<div class="code-block highlight is-open show-line-numbers  tw-group tw-my-2">
  <div class="
    
    tw-flex 
    tw-flex-row
    tw-flex-1 
    tw-justify-between 
    tw-w-full tw-bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw-mx-2 
        tw-flex
        tw-flex-row
        tw-flex-1"
      aria-hidden="true">
          <div class="group-[.is-open]:tw-rotate-90 tw-transition-[transform] tw-duration-500 tw-ease-in-out print:!tw-hidden tw-w-min tw-h-min tw-my-1 tw-mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></div>
          <p class="tw-select-none !tw-my-1">text</p>
      </button>

   <div class="tw-flex">
      <button 
        class="
          line-number-button
          tw-mx-2 
          tw-hidden 
          group-[.is-open]:tw-block 
          group-[.show-line-numbers]:tw-text-fgColor-link 
          print:!tw-hidden" 
        title="Toggle line numbers"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M61.77 401l17.5-20.15a19.92 19.92 0 0 0 5.07-14.19v-3.31C84.34 356 80.5 352 73 352H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8h22.83a157.41 157.41 0 0 0-11 12.31l-5.61 7c-4 5.07-5.25 10.13-2.8 14.88l1.05 1.93c3 5.76 6.29 7.88 12.25 7.88h4.73c10.33 0 15.94 2.44 15.94 9.09 0 4.72-4.2 8.22-14.36 8.22a41.54 41.54 0 0 1-15.47-3.12c-6.49-3.88-11.74-3.5-15.6 3.12l-5.59 9.31c-3.72 6.13-3.19 11.72 2.63 15.94 7.71 4.69 20.38 9.44 37 9.44 34.16 0 48.5-22.75 48.5-44.12-.03-14.38-9.12-29.76-28.73-34.88zM496 224H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM16 160h64a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H64V40a8 8 0 0 0-8-8H32a8 8 0 0 0-7.14 4.42l-8 16A8 8 0 0 0 24 64h8v64H16a8 8 0 0 0-8 8v16a8 8 0 0 0 8 8zm-3.91 160H80a8 8 0 0 0 8-8v-16a8 8 0 0 0-8-8H41.32c3.29-10.29 48.34-18.68 48.34-56.44 0-29.06-25-39.56-44.47-39.56-21.36 0-33.8 10-40.46 18.75-4.37 5.59-3 10.84 2.8 15.37l8.58 6.88c5.61 4.56 11 2.47 16.12-2.44a13.44 13.44 0 0 1 9.46-3.84c3.33 0 9.28 1.56 9.28 8.75C51 248.19 0 257.31 0 304.59v4C0 316 5.08 320 12.09 320z"/></svg></button>

      <button 
        class="
          wrap-code-button
          tw-select-none 
          tw-mx-2 
          tw-hidden 
          group-[.is-open]:tw-block 
          group-[.is-wrap]:tw-text-fgColor-link 
          print:!tw-hidden" 
        title="Toggle code wrap"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"/></svg></button>
      
      <button 
        class="
          copy-code-button
          tw-select-none
          tw-mx-2 
          tw-hidden
          group-[.is-open]:tw-block
          hover:tw-text-fgColor-link 
          print:!tw-hidden"
        title="Copy code">
          <span class="copy-icon tw-block"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M433.941 65.941l-51.882-51.882A48 48 0 0 0 348.118 0H176c-26.51 0-48 21.49-48 48v48H48c-26.51 0-48 21.49-48 48v320c0 26.51 21.49 48 48 48h224c26.51 0 48-21.49 48-48v-48h80c26.51 0 48-21.49 48-48V99.882a48 48 0 0 0-14.059-33.941zM266 464H54a6 6 0 0 1-6-6V150a6 6 0 0 1 6-6h74v224c0 26.51 21.49 48 48 48h96v42a6 6 0 0 1-6 6zm128-96H182a6 6 0 0 1-6-6V54a6 6 0 0 1 6-6h106v88c0 13.255 10.745 24 24 24h88v202a6 6 0 0 1-6 6zm6-256h-64V48h9.632c1.591 0 3.117.632 4.243 1.757l48.368 48.368a6 6 0 0 1 1.757 4.243V112z"/></svg></span>
          <span class="check-icon tw-hidden"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg></span>
      </button>
        
      <button 
        class="
          tw-select-none 
          tw-mx-2 
          tw-block 
          group-[.is-open]:tw-hidden 
          print:!tw-hidden" 
        disabled
        aria-hidden="true"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M328 256c0 39.8-32.2 72-72 72s-72-32.2-72-72 32.2-72 72-72 72 32.2 72 72zm104-72c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72zm-352 0c-39.8 0-72 32.2-72 72s32.2 72 72 72 72-32.2 72-72-32.2-72-72-72z"/></svg></button>
    </div>
  </div>
  <pre style="counter-reset: codeblock;" class="tw-block tw-m-0 tw-p-0"><code 
    id="codeblock-id-13" 
    class="
      chroma 
      !tw-block 
      tw-p-0
      tw-m-0
      tw-transition-[max-height] 
      tw-duration-500 
      tw-ease-in-out 
      group-[.is-closed]:!tw-max-h-0 
      group-[.is-wrap]:tw-text-wrap
      tw-overflow-y-hidden
      tw-overflow-x-auto
      tw-scrollbar-thin
      "><span class="line"><span class="cl">/**
</span></span><span class="line"><span class="cl"> * A structure used to configure an Ethernet port.
</span></span><span class="line"><span class="cl"> * Depending upon the Rx multi-queue mode, extra advanced
</span></span><span class="line"><span class="cl"> * configuration settings may be needed.
</span></span><span class="line"><span class="cl"> */
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">struct rte_eth_conf {
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">}</span></span></code></pre>
</div>
<p>配置以太网端口的结构。</p>]]></description>
</item><item>
    <title>DPDK基础结构</title>
    <link>http://lovelycabin.dpdns.org/blog/20221013/1665662400/</link>
    <pubDate>Thu, 13 Oct 2022 20:00:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221013/1665662400/</guid>
    <description><![CDATA[<h2 id="mbuf" class="headerLink">
    <a href="#mbuf" class="header-mark"></a>1 mbuf</h2><p>rte_mempool_objhdr
rte_mbuf
priv_data
headroom
data
rte_mempool_objtlr</p>
<h2 id="mempool" class="headerLink">
    <a href="#mempool" class="header-mark"></a>2 mempool</h2><p>rte_mempool
rte_mempool_cache
&hellip;
rte_mempool_cache
priv_data</p>
<blockquote>
  <p>cache 块和 lcore 一一对应，减少alloc和free的冲突，提高效率</p>

</blockquote><h2 id="用户空间中断" class="headerLink">
    <a href="#%e7%94%a8%e6%88%b7%e7%a9%ba%e9%97%b4%e4%b8%ad%e6%96%ad" class="header-mark"></a>3 用户空间中断</h2><p>事件驱动编程：基于epoll，监控uio/vfio设备文件。启动配置时，将网卡等硬件向量映射到对应的文件中（数据包到达，触发文件fd），此时epoll能监控到变化，进行收包。</p>]]></description>
</item><item>
    <title>DPDK示例片段解读</title>
    <link>http://lovelycabin.dpdns.org/blog/20221019/1666149720/</link>
    <pubDate>Wed, 19 Oct 2022 11:22:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221019/1666149720/</guid>
    <description><![CDATA[<h2 id="l2fwd" class="headerLink">
    <a href="#l2fwd" class="header-mark"></a>7 l2fwd</h2><h3 id="片段一" class="headerLink">
    <a href="#%e7%89%87%e6%ae%b5%e4%b8%80" class="header-mark"></a>7.1 片段一</h3><div class="code-block highlight is-open show-line-numbers  tw-group tw-my-2">
  <div class="
    
    tw-flex 
    tw-flex-row
    tw-flex-1 
    tw-justify-between 
    tw-w-full tw-bg-bgColor-secondary
    ">      
    <button 
      class="
        code-block-button
        tw-mx-2 
        tw-flex
        tw-flex-row
        tw-flex-1"
      aria-hidden="true">
          <div class="group-[.is-open]:tw-rotate-90 tw-transition-[transform] tw-duration-500 tw-ease-in-out print:!tw-hidden tw-w-min tw-h-min tw-my-1 tw-mx-1"><svg class="icon"
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"/></svg></div>
          <p class="tw-select-none !tw-my-1">text</p>]]></description>
</item><item>
    <title>DPDK - KNI</title>
    <link>http://lovelycabin.dpdns.org/blog/20221022/1666414980/</link>
    <pubDate>Sat, 22 Oct 2022 13:03:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221022/1666414980/</guid>
    <description><![CDATA[<p><a href="https://www.cnblogs.com/mysky007/p/12305257.html" title="KNI 接口学习" target="_blank" rel="noopener noreferrer">KNI 接口学习</a></p>
<p>使用 kni 接口时，需要插入 rte_kni.ko 库到内核中，插入时有部分参数可以进行调整，下面简单描述一下参数的用途：</p>
<ul>
<li>carrier：默认设置为<code>off</code>，表示载波状态（Carrier Status）关闭，能够设置<code>on</code>来开启。当使用<code>off</code>时，需要使用<code>rte_kni_update_link</code>函数来设置 KNI 接口的载波状态</li>
<li>lo_mode：环回模式关闭设置为<code>lo_mode_none</code>，此时KNI接口发送的数据包会被传递给Linux内核网络栈，随后根据路由表等网络配置发送到外部网络。通常在测试环境下，设置<code>lo_mode_fifo</code>或<code>lo_mode_fifo_skb</code>，模式开启时，KNI模块会在内核空间创建一个虚拟的环回路径，此配置下数据包发到内核时，并不真正的发到外部网络，而是在内核中被“环回”；其中<code>lo_mode_fifo_skb</code>模式，还会涉及到 sk_buff 缓冲区的拷贝，模拟了数据包在内核中的处理过程，更接近于真实的网络环境</li>
<li>kthread_mode：默认配置为<code>single</code>，内核侧只为所有 KNI 设备创建一个内核线程来接收数据包。在<code>multiple</code>模式下，每个 KNI 接口都会创建一个单独的内核线程来接收数据包</li>
</ul>
<blockquote>
  <p>载波状态是网络接口的物理链路状态，表明接口是否连接到网络并能够传输数据，对应 ifconfig 查询到的 UP/DOWN 状态</p>]]></description>
</item><item>
    <title>DPDK - testpmd 使用</title>
    <link>http://lovelycabin.dpdns.org/blog/20221109/1667981640/</link>
    <pubDate>Wed, 09 Nov 2022 16:14:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221109/1667981640/</guid>
    <description><![CDATA[<p>DPDK 提供了不少工具，帮助用户优化操作、测试等..</p>
<p>具体的使用手册可以参考：<a href="https://doc.dpdk.org/guides/testpmd_app_ug/testpmd_funcs.html" title="Testpmd Runtime Functions" target="_blank" rel="noopener noreferrer">Testpmd Runtime Functions</a></p>
<ol>
<li>查看转发配置</li>
</ol>
<p>还能继续填充 pktgen 模块的使用</p>]]></description>
</item><item>
    <title>DPDK - timer</title>
    <link>http://lovelycabin.dpdns.org/blog/20221110/1668072660/</link>
    <pubDate>Thu, 10 Nov 2022 17:31:00 &#43;0800</pubDate><author>
        <name>lilac</name>
    </author><guid>http://lovelycabin.dpdns.org/blog/20221110/1668072660/</guid>
    <description><![CDATA[<h2 id="简介" class="headerLink">
    <a href="#%e7%ae%80%e4%bb%8b" class="header-mark"></a>13 简介</h2><p>DPDK 提供了 timer 库封装了定时器的实现，如果应用不需要定时器，可以在编译时，通过禁用 <code>rte_timer_manage</code> 来提供性能。</p>
<blockquote>
  <p>定时器根据每个核心来跟踪，所有待核准的计时器都将被维护，按照跳表(Skip List)中的到期定时器进行排序，其中跳表有 10 级</p>]]></description>
</item></channel>
</rss>
