<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin: 0px;">Hi,Stephen</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">There are some things I don't quite understand.Hope you can answer that.</div><div style="margin: 0px;">This will help me avoid similar errors in subsequent patch submissions.Thanks!</div><div style="margin: 0px;"><br></div><div style="margin: 0px;">There are places where rte_memcpy functions are used£º</div><div style="margin: 0px;">============================================</div><div style="margin: 0px;">In test_ipfrag.c£º</div><div style="margin: 0px;"><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px; font-size: 13.3333px;"><code><b>from func test_get_ipv4_opt: </b></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(expected_opt->data,expected_first_frag_ipv4_opts_copied,sizeof(expected_first_frag_ipv4_opts_copied));</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code>rte_memcpy(expected_opt>data,expected_first_frag_ipv4_opts_nocopied,sizeof(expected_first_frag_ipv4_opts_nocopied));</code></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code>rte_memcpy(expected_opt->data,expected_sub_frag_ipv4_opts_copied,sizeof(expected_sub_frag_ipv4_opts_copied));</code></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code>rte_memcpy(expected_opt->data,expected_sub_frag_ipv4_opts_nocopied,sizeof(expected_sub_frag_ipv4_opts_nocopied));</code></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func v4_allocate_packet_of:</b></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(hdr + 1, opt.data, opt.len);</code></pre></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func test_get_frag_opt:</b></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(opt->data, iph_opt, opt_len);</code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;">In <a href="http://git.dpdk.org/dpdk/tree/lib/ip_frag/rte_ipv4_fragmentation.c" style="font-family: sans-serif; white-space: normal; color: rgb(0, 0, 0);">r</a>te_ipv4_fragmentation.c:</pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func v4_allocate_packet_of:</b></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(dst, src, header_len);</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func __create_ipopt_frag_hdr:</b></code><br></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(ipopt_frag_hdr, iph, sizeof(struct rte_ipv4_hdr));</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code><code><code><code><code>rte_memcpy(ipopt_frag_hdr + ipopt_len, p_opt, p_opt[1]);</code></code></code></code></code></code></pre></code></pre></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>============================================</code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><br></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code><code><code><b>These are the compilation errors:</b></code></code></code></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code><code><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>============================================</code></pre></code></code></code></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;">test_ipfrag.c:230</pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Arial; white-space: normal;">In test_ipfrag.c£º</span></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;"><pre style="font-size: 14px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func v4_allocate_packet_of:</b></code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>rte_memcpy(hdr + 1, opt.data, opt.len);</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;">rte_ipv4_fragmentation.c:68</pre></code></pre></code></pre></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;"><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;">In <a href="http://git.dpdk.org/dpdk/tree/lib/ip_frag/rte_ipv4_fragmentation.c" style="font-family: sans-serif; white-space: normal; color: rgb(0, 0, 0);">r</a>te_ipv4_fragmentation.c:</pre></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><b>from func __create_ipopt_frag_hdr:</b></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code><code><code><code><code>rte_memcpy(ipopt_frag_hdr + ipopt_len, p_opt, p_opt[1]);</code></code></code></code></code></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><code><code><code><code><code><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code>============================================</code></pre><pre style="font-size: 13.3333px; padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code><br></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;">1.Do I need to replace all rte_memcpy with memcpy or only the two rte_memcpy that compile the error are replaced by memcpy?</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;">2.</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;"><pre class="content" style="font-family: Menlo, Monaco, Consolas, "Courier New", monospace; box-sizing: border-box; overflow: auto; font-size: 13px; padding: 9.5px; margin-top: 0px; margin-bottom: 10px; line-height: 14.3px; color: rgb(51, 51, 51); word-break: break-all; border: 0px; border-radius: 0px;">>Since the copies will all be short why bother using rte_memcpy() all over
>the place.  Especially in the test code, just use memcpy().</pre></code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;">For example,in app/test-pmd/cmdline.c:from func cmd_set_vxlan_parsed:rte_memcpy(vxlan_encap_conf.vni, &id.vni[1], 3);Why this place can be used rte_memcpy?</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;">3.For example, how such a compilation error occurs:</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;">../app/test/test_ipfrag.c:57:17: note: at offset [5, 40] into object¡®data¡¯ of size 40</pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><code style="font-size: 13.3333px;">4.Under what circumstances can we use rte_memcpy?</code></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><br></pre><pre style="padding: 0px; margin-top: 0px; margin-bottom: 0px;"><font face="monospace"><span style="font-size: 13.3333px;">Huichao,Cai</span></font></pre></code></code></code></code></code></code></pre></code></pre></code></pre></code></pre></code></pre></code></pre></code></pre></code></pre></code></pre></code></pre></div></div>