On Wed, Jun 29, 2016 at 02:38:02PM -0700, William Tu wrote:
> This patch adds a 'snaplen' config for mirroring table.  A mirrored packet
> with size larger than snaplen bytes will be truncated in datapath before
> sending to the mirror output port.  A snaplen of 0 equals 65535, which means
> no truncation applied.
> 
> Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/141186839
> Signed-off-by: William Tu <u9012...@gmail.com>

Thanks.  I folded in the following (note that a snaplen of 0 isn't
possible since the minimum snaplen is 14) and applied this to master.

--8<--------------------------cut here-------------------------->8--

diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c
index 1d5145c..1977b6b 100644
--- a/ofproto/ofproto-dpif-xlate.c
+++ b/ofproto/ofproto-dpif-xlate.c
@@ -3239,14 +3239,13 @@ compose_output_action__(struct xlate_ctx *ctx, 
ofp_port_t ofp_port,
                     /* Handle truncation of the mirrored packet. */
                     if (ctx->mirror_snaplen > 0 &&
                         ctx->mirror_snaplen < UINT16_MAX) {
-                        bool support_trunc = ctx->xbridge->support.trunc;
                         struct ovs_action_trunc *trunc;
 
                         trunc = nl_msg_put_unspec_uninit(ctx->odp_actions,
-                                    OVS_ACTION_ATTR_TRUNC,
-                                    sizeof *trunc);
+                                                         OVS_ACTION_ATTR_TRUNC,
+                                                         sizeof *trunc);
                         trunc->max_len = ctx->mirror_snaplen;
-                        if (!support_trunc) {
+                        if (!ctx->xbridge->support.trunc) {
                             ctx->xout->slow |= SLOW_ACTION;
                         }
                     }
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index ad01d6c..072fef4 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -3701,11 +3701,11 @@
       </column>
 
       <column name="snaplen">
-        <p>Maximum per mirrored packet size in bytes.</p>
+        <p>Maximum per-packet number of bytes to mirror.</p>
         <p>A mirrored packet with size larger than <ref column="snaplen"/>
            will be truncated in datapath to <ref column="snaplen"/> bytes
-           before sending to the mirror output port.  A snaplen of 0 equals
-           65535, which means no truncation applied.
+           before sending to the mirror output port.  If omitted, packets
+           are not truncated.
         </p>
       </column>
     </group>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to