On Fri, Jun 24, 2016 at 7:42 AM, William Tu <u9012...@gmail.com> 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
>
> Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/140037134
> Signed-off-by: William Tu <u9012...@gmail.com>
> ---
>  NEWS                              |   4 +
>  include/openvswitch/ofp-actions.h |  10 ++
>  lib/dp-packet.c                   |   2 +
>  lib/dp-packet.h                   |  65 ++++++++++
>  lib/dpif-netdev.c                 |  33 ++++-
>  lib/dpif.c                        |  25 +++-
>  lib/dpif.h                        |   1 +
>  lib/netdev-bsd.c                  |   3 +
>  lib/netdev-dpdk.c                 |  15 +++
>  lib/netdev-dummy.c                |   2 +
>  lib/netdev-linux.c                |   3 +
>  lib/netdev.c                      |   5 +-
>  lib/odp-execute.c                 |  12 ++
>  lib/odp-util.c                    |  23 ++++
>  lib/ofp-actions.c                 | 106 ++++++++++++++++
>  ofproto/ofproto-dpif-sflow.c      |   1 +
>  ofproto/ofproto-dpif-xlate.c      |  57 +++++++++
>  ofproto/ofproto-dpif.c            |  79 ++++++++++++
>  ofproto/ofproto-dpif.h            |   3 +
>  tests/odp.at                      |   1 +
>  tests/ofp-actions.at              |   3 +
>  tests/ofproto-dpif.at             | 124 +++++++++++++++++++
>  tests/ovs-ofctl.at                |   8 ++
>  tests/system-kmod-macros.at       |   7 ++
>  tests/system-traffic.at           | 247 
> ++++++++++++++++++++++++++++++++++++++
>  tests/system-userspace-macros.at  |   7 ++
>  utilities/ovs-ofctl.8.in          |   7 ++
>  27 files changed, 849 insertions(+), 4 deletions(-)
>
> diff --git a/NEWS b/NEWS
> index 4cf66f9..3d9742b 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -17,6 +17,8 @@ Post-v2.5.0
>       * New OpenFlow extension NXM_NX_MPLS_TTL to provide access to MPLS TTL.
>       * New "sampling_port" option for "sample" action to allow sampling
>         ingress and egress tunnel metadata.
> +     * New output option, output(port=N,max_len=M), to allow truncating a
> +       packet to size M bytes when outputting to port N.
>     - ovs-ofctl:
>       * queue-get-config command now allows a queue ID to be specified.
>       * '--bundle' option can now be used with OpenFlow 1.3.
> @@ -44,6 +46,7 @@ Post-v2.5.0
>       bitrot.
>     - ovs-appctl:
>       * New "vlog/close" command.
> +     * New "dpif/disable-truncate" command.

Since this is test related command, I removed its reference from NEWS.
Otherwise looked good to me. I pushed both patches to master.

Thanks for incorporating all comments.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to