<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}
span.spelle
        {mso-style-name:spelle;}
span.grame
        {mso-style-name:grame;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-DE" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Hello All,</span><span style="mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US">I am using the async API to install flow rules to perform
<span class="spelle">modify_field</span> action to change content of packets’ <span class="grame">
headers, especially the src address in a IPv6 header.  But I am</span> facing the issue of being unable to generalize the action template for this purpose. The testpmd commands used to modify the src IPv6 address of an incoming packet from PF0, then forward
 it to a VM are as follows. These commands are inspired by the synchronous examples from [1].
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><br>
</span><b><span style="font-size:10.5pt;color:#212121"><Command to start test-pmd></span></b><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#212121">sudo ./dpdk-testpmd -a 3b:00.0,dv_flow_en=2,representor=pf0vf0 -- -i --rxq=1 --txq=1 --flow-isolate-all</span><o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;color:#212121"></Command to start test-pmd></span></b><o:p></o:p></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"> </span></b><o:p></o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;color:#212121"><</span></b><b><span lang="EN-US" style="font-size:10.5pt;color:#212121">Install async rules changing ipv6 src address</span></b><b><span style="font-size:10.5pt;color:#212121">></span></b><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">port stop all</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow configure 0 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow configure 1 queues_number 1 queues_size 10 counters_number 0 aging_counters_number 0 meters_number 0 flags 0</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">port start all</span><span lang="EN-US" style="font-size:10.5pt;color:#333333;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow pattern_template 0 create pattern_template_id 10  transfer template represented_port ethdev_port_id is 0 / eth / ipv6 / end</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow actions_template 0 create transfer actions_template_id 10  template  jump / end mask jump / end</span><span lang="EN-US" style="font-size:10.5pt;color:#333333;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow pattern_template 0 create pattern_template_id 11  transfer template eth / ipv6 / end</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow actions_template 0 create transfer actions_template_id 13 template modify_field op set dst_type ipv6_src dst_level 0 dst_offset 0 src_type value src_value
<b><i>FFFFFFFFFFFF</i></b> width 128 / represented_port / end mask modify_field op set dst_type ipv6_src dst_level 0xff dst_offset 0xffffffff src_type value src_value FFFFFFFFFFFF width 0xffffffff / represented_port / end</span><span lang="EN-US" style="font-size:10.5pt;color:#333333;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow template_table 0 create group 0 priority 0 transfer wire_orig table_id 0x1 rules_number 8 pattern_template 10 actions_template 10</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow template_table 0 create group 2 priority 0 transfer table_id 0x3 rules_number 8 pattern_template 11 actions_template 13</span><span lang="EN-US" style="font-size:10.5pt;color:#333333;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow queue 0 create 0 template_table 0x1 pattern_template 0 actions_template 0 postpone no pattern represented_port ethdev_port_id is 0 / eth / ipv6 / end actions  jump group
 2 /  end</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow queue 0 create 0 template_table 0x3 pattern_template 0 actions_template 0 postpone no pattern eth / ipv6  / end actions modify_field op set dst_type ipv6_src src_type
 value src_value 20010db8000000008a2e037073341234 width 128 / represented_port ethdev_port_id 1 / end</span><span lang="EN-US" style="font-size:10.5pt;color:#333333;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#333333;mso-ligatures:none">flow push 0 queue 0</span><span style="font-size:10.5pt;mso-ligatures:none"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;color:#212121"><</span></b><b><span lang="EN-US" style="font-size:10.5pt;color:#212121">/Install async rules changing ipv6 src address</span></b><b><span style="font-size:10.5pt;color:#212121">></span></b><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#212121">It is observed that, the src IPv6 address is changed but with the value of
</span><b><i><span style="color:#333333;mso-ligatures:none">FFFF</span></i></b><b><i><span lang="EN-US" style="color:#333333;mso-ligatures:none">:</span></i></b><b><i><span style="color:#333333;mso-ligatures:none">FFFF</span></i></b><b><i><span lang="EN-US" style="color:#333333;mso-ligatures:none">:</span></i></b><b><i><span style="color:#333333;mso-ligatures:none">FFFF</span></i></b><b><i><span lang="EN-US" style="color:#333333;mso-ligatures:none">::</span></i></b><span lang="EN-US" style="color:#333333;mso-ligatures:none">,
 which is identical to the value used in the action template creation. Setting src_value to 0 would change the src IPv6 address to
<b>:: </b>, which does not provide a generalized modify_field action template either.</span><span lang="EN-US" style="color:#212121"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"> <o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"><Packet trace><o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;color:#212121">11:42:57.922978 90:3c:b3:33:72:fb > 04:3f:72:e8:cf:ca, ethertype IPv6 (0x86dd), length 82:
<b>ffff:ffff:ffff::</b> > 7a2a:bcde:e0123:e301:0:1:0:1: 192.168.129.5 > 172.32.4.9: ICMP echo request, id 0, seq 0, length 8<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"></Packet trace><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.5pt;color:#212121"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;color:#212121"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thus, I would like to ask the community, if it is possible or how to create a generalized
</span><span lang="EN-US" style="color:#333333;mso-ligatures:none">modify_field action template to allow installation of flow rules with different src IPv6 address values, as experimented above.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#333333;mso-ligatures:none">Many thanks in advance.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;color:#212121"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">[1] <a href="https://inbox.dpdk.org/dev/20211012080631.28504-4-viacheslavo@nvidia.com/">
https://inbox.dpdk.org/dev/20211012080631.28504-4-viacheslavo@nvidia.com/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt">Tao</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>