On Tue, Jun 07, 2016 at 10:53:52PM -0700, William Tu wrote: > The patch adds a new action to support packet truncation. The new action > is formatted as 'output(port=n,max_len=m)', as output to port n, with > packet size being MIN(original_size, m). > > One use case is to enable port mirroring to send smaller packets to the > destination port so that only useful packet information is mirrored/copied, > saving some performance overhead of copying entire packet payload. Example > use case is below as well as shown in the testcases: > > - Output to port 1 with max_len 100 bytes. > - The output packet size on port 1 will be MIN(original_packet_size, 100). > # ovs-ofctl add-flow br0 'actions=output(port=1,max_len=100)' > > - The scope of max_len is limited to output action itself. The following > packet size of output:1 and output:2 will be intact. > # ovs-ofctl add-flow br0 \ > 'actions=output(port=1,max_len=100),output:1,output:2' > - The Datapath actions shows: > # Datapath actions: trunc(100),1,1,2 > > Signed-off-by: William Tu <u9012...@gmail.com>
I'm a bit nervous about cutlen. Can a packet change, for example by popping a VLAN header, after cutlen is set? If so, can this cause the packet length to drop below 0, or below 14? xlate_output_trunc_action() disallows all special OFPP_* ports. Is there a reason to disallow output_trunc to OFPP_LOCAL or OFPP_IN_PORT? If special OFPP_* ports are disallowed, should we disallow them at action decode time, in ofp-actions.c, instead of waiting until action translation? In xlate_output_trunc_action(), s/unipredicable/unpredictable/. Also in the same error message it's probably worth giving the name or the number of the output port. Thanks, Ben. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev