Skip to contentSkip to conversation

Flow Control and Port Mirroring

ovs-dev Simon Horman 2 participants 3 messages Oct 30, 2010 – Nov 8, 2010 2 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

[ CCed VHOST contacts ]

Quoted 10 lines · Jesse Gross
Quoted 8 lines · Simon Horman

My reasoning is that in the non-mirroring case the guest is limited by the external interface through wich the packets eventually flow - that is 1Gbit/s. But in the mirrored either there is no flow control or the flow control is acting on the rate of dummy0, which is essentailly infinate.

Before investigating this any further I wanted to ask if this behaviour is intentional.

Quoted 8 lines

It's not intentional but I can take a guess at what is happening.

When we send the packet to a mirror, the skb is cloned but only the original skb is charged to the sender. If the original packet is delivered to localhost then it will be freed quickly and no longer accounted for, despite the fact that the "real" packet is still sitting in the transmit queue on the NIC. The UDP stack will then send the next packet, limited only by the speed of the CPU.

That would explain what I have observed.

Quoted 6 lines

Normally, this would be tracked by accounting for the memory charged to the socket. However, I know that Xen tracks whether the actual pages of memory have been freed, which should avoid this problem since the memory won't be released util the last packet has been sent. I don't know what KVM virtio does but I'm guessing that it similar to the former, since this problem is occurring.

I am also familiar of how Xen tracks pages but less sure of the virtio side of things.

Quoted 3 lines

While it would be easy to charge the socket for all clones, I also want to be careful about over accounting of the same data, leading to a very small effective socket buffer.

Agreed, we don't want to see over-charging.

#3 lore raw
Quoted 15 lines · Simon Horman

[ CCed VHOST contacts ]

Quoted 12 lines · Jesse Gross
Quoted 8 lines · Simon Horman

My reasoning is that in the non-mirroring case the guest is limited by the external interface through wich the packets eventually flow - that is 1Gbit/s. But in the mirrored either there is no flow control or the flow control is acting on the rate of dummy0, which is essentailly infinate.

Before investigating this any further I wanted to ask if this behaviour is intentional.

It's not intentional but I can take a guess at what is happening.

Quoted 8 lines
Quoted 6 lines

When we send the packet to a mirror, the skb is cloned but only the original skb is charged to the sender. If the original packet is delivered to localhost then it will be freed quickly and no longer accounted for, despite the fact that the "real" packet is still sitting in the transmit queue on the NIC. The UDP stack will then send the next packet, limited only by the speed of the CPU.

That would explain what I have observed.

I can't find the thread (what is ovs-dev?), but I think the tap device has this fundamental feature: you can blast as many packets as you want through it.

If that's a bad thing, we have to look harder...

Cheers,
Rusty.

#4 lore raw
Quoted 23 lines · Rusty Russell
Quoted 22 lines · Simon Horman

[ CCed VHOST contacts ]

Quoted 18 lines · Jesse Gross
Quoted 8 lines · Simon Horman

My reasoning is that in the non-mirroring case the guest is limited by the external interface through wich the packets eventually flow - that is 1Gbit/s. But in the mirrored either there is no flow control or the flow control is acting on the rate of dummy0, which is essentailly infinate.

Before investigating this any further I wanted to ask if this behaviour is intentional.

It's not intentional but I can take a guess at what is happening.

When we send the packet to a mirror, the skb is cloned but only the original skb is charged to the sender. If the original packet is delivered to localhost then it will be freed quickly and no longer accounted for, despite the fact that the "real" packet is still sitting in the transmit queue on the NIC. The UDP stack will then send the next packet, limited only by the speed of the CPU.

Quoted 3 lines
Quoted 1 line

That would explain what I have observed.

I can't find the thread (what is ovs-dev?),

Sorry, yes its on ovs-dev.
http://openvswitch.org/pipermail/dev_openvswitch.org/2010-October/003806.html

Quoted 5 lines

but I think the tap device
has this fundamental feature: you can blast as many packets as you want through it.

If that's a bad thing, we have to look harder...

There does seem to be flow control in the non-mirrored case. So I suspect its occurring at the skb level but that breaks down when a clone occurs. It would seem that fragment level flow control would help this problem (which is basically what Xen's netback/netfront has), but by this point I am speculating wildly. I'll try and find out exactly where the problem is occurring in order for us to have a more informed discussion.