On Wed, Jan 02, 2019 at 05:52:20PM +0000, Eli Britstein wrote:
> 
> On 1/2/2019 6:02 PM, Ben Pfaff wrote:
> > On Wed, Jan 02, 2019 at 03:23:14PM +0000, Eli Britstein wrote:
> >> Hello,
> >>
> >>
> >>
> >> Simple bridge, with 2 ports:
> >>
> >>
> >>
> >> ovs-vsctl show
> >>
> >> 66abf37d-391e-45ba-b740-d2d0f414cd15
> >>
> >>      Bridge "br1"
> >>
> >>          Port "enp4s0f0_1"
> >>
> >>              Interface "enp4s0f0_1"
> >>
> >>          Port "enp4s0f0_0"
> >>
> >>              Interface "enp4s0f0_0"
> >>
> >>          Port "br1"
> >>
> >>              Interface "br1"
> >>
> >>                  type: internal
> >>
> >>      ovs_version: "2.10.90"
> >>
> >>
> >>
> >> master version, last commit:
> >>
> >> 46df7fac7 netdev-tc-offloads: Support IPv6 hlimit rewrite
> >>
> >>
> >>
> >>
> >>
> >> Single OF rule. Match on a SRCIP and rewrite to the same value:
> >>
> >> ovs-ofctl del-flows br1
> >> ovs-ofctl add-flow br1 
> >> in_port=1,dl_dst=e4:11:22:33:44:51,dl_type=0x0800,nw_src=4.4.4.10,nw_dst=4.4.4.11,actions=mod_dl_dst=e4:11:22:33:aa:bb,mod_nw_src=4.4.4.10,mod_nw_dst=4.6.4.51,output:2
> >>
> >> ovs-ofctl dump-flows br1
> >> cookie=0x0, duration=0.010s, table=0, n_packets=0, n_bytes=0, 
> >> ip,in_port="enp4s0f0_0",dl_dst=e4:11:22:33:44:51,nw_src=4.4.4.10,nw_dst=4.4.4.11
> >>  
> >> actions=mod_dl_dst:e4:11:22:33:aa:bb,mod_nw_src:4.4.4.10,mod_nw_dst:4.6.4.51,output:"enp4s0f0_1"
> >>
> >> ovs-dpctl dump-flows --names
> >> in_port(enp4s0f0_0),eth(dst=e4:11:22:33:44:51),eth_type(0x0800),ipv4(src=4.4.4.10,dst=4.4.4.11,proto=1,frag=no),
> >>  packets:3, bytes:294, used:3.510s, 
> >> actions:set(eth(dst=e4:11:22:33:aa:bb)),set(ipv4(src=4.4.4.10,dst=4.6.4.51)),enp4s0f0_1
> >>
> >> Rewrite to the same value of a matched field is not required. Can it be 
> >> filtered?
> > The "set" actions are required because the Ethernet destination and IPv4
> > destination actually change.
> That is correct that there are changed fields. However, the src ip match 
> (nw_src=4.4.4.10) and the rewrite request (mod_nw_src:4.4.4.10) have the 
> same value. It's pointless to do a rewrite to the same value.

OVS has masked set logic for these fields in commit_set_ipv4_action() in
odp-util.c.  If you track down why it's not active for you, please send
a patch.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to