Hello All,

I am using the async API to install flow rules to perform modify_field action 
to change content of packets’ headers, especially the src address in a IPv6 
header.  But I am 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].

<Command to start test-pmd>
sudo ./dpdk-testpmd -a 3b:00.0,dv_flow_en=2,representor=pf0vf0 -- -i --rxq=1 
--txq=1 --flow-isolate-all
</Command to start test-pmd>

<Install async rules changing ipv6 src address>
port stop all
flow configure 0 queues_number 1 queues_size 10 counters_number 0 
aging_counters_number 0 meters_number 0 flags 0
flow configure 1 queues_number 1 queues_size 10 counters_number 0 
aging_counters_number 0 meters_number 0 flags 0
port start all

flow pattern_template 0 create pattern_template_id 10  transfer template 
represented_port ethdev_port_id is 0 / eth / ipv6 / end
flow actions_template 0 create transfer actions_template_id 10  template  jump 
/ end mask jump / end

flow pattern_template 0 create pattern_template_id 11  transfer template eth / 
ipv6 / end
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 FFFFFFFFFFFF 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

flow template_table 0 create group 0 priority 0 transfer wire_orig table_id 0x1 
rules_number 8 pattern_template 10 actions_template 10
flow template_table 0 create group 2 priority 0 transfer table_id 0x3 
rules_number 8 pattern_template 11 actions_template 13

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
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

flow push 0 queue 0
</Install async rules changing ipv6 src address>


It is observed that, the src IPv6 address is changed but with the value of 
FFFF:FFFF:FFFF::, which is identical to the value used in the action template 
creation. Setting src_value to 0 would change the src IPv6 address to :: , 
which does not provide a generalized modify_field action template either.

<Packet trace>
11:42:57.922978 90:3c:b3:33:72:fb > 04:3f:72:e8:cf:ca, ethertype IPv6 (0x86dd), 
length 82: ffff:ffff:ffff:: > 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
</Packet trace>


Thus, I would like to ask the community, if it is possible or how to create a 
generalized modify_field action template to allow installation of flow rules 
with different src IPv6 address values, as experimented above.
Many thanks in advance.

[1] https://inbox.dpdk.org/dev/[email protected]/

Best regards,
Tao

Reply via email to