[ovs-dev] mirroring vs. mirror stats (and NetFlow)

Jarno Rajahalme jrajahalme at nicira.com
Sat Jul 25 00:34:53 UTC 2015


> On Jul 24, 2015, at 2:19 PM, Ben Pfaff <blp at nicira.com> wrote:
> 
> xlate_actions() has one set of criteria for mirroring:
> 
>    if (!xin->recirc &&
>        (special = process_special(&ctx, flow, in_port, ctx.xin->packet))) {
>        ctx.xout->slow |= special;
>    } else {
> ...
>        /* Only mirror fully processed packets. */
>        if (!exit_recirculates(&ctx)
>            && mbridge_has_mirrors(xbridge->mbridge)) {
>    }
> 
> and a different set of criteria for whether to count statistics for
> mirroring:
> 
>    /* Update mirror stats only for packets really received by the bridge. */
>    if (!xin->recirc && mbridge_has_mirrors(xbridge->mbridge)) {
> ...
>    }
> 

So this would update the stats on the original flow, and apply the mirror actions on the recirculated flow (i.e., later).

> Off-hand, this seems like a bug, since it seems to me that we should
> count statistics for mirroring in the same circumstances where we
> actually mirror the packet.  Do you know a reason why this is wrong?
> 

I have no reason, maybe you try updating the stats also when there is no further recirculation? However, action processing may change the packet size, so this may change the reported stats.

> It seems like there's a similar situation for NetFlow statistics.

Same packet size consideration here. It seem that netflow is done for the received packet regardless of if the packet is dropped, so it would be logical to report the packet size as it was when received.

  Jarno





More information about the dev mailing list