summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-mirror.h
Commit message (Collapse)AuthorAgeFilesLines
* mirror: Allow concurrent lookups.Jarno Rajahalme2017-03-221-10/+17
| | | | | | | | | | | | | | | | | | | | | | Handler threads use a selection of mirror functions with the assumption that the data referred to is RCU protected, while the implementation has not provided for this, which can lead to an OVS crash. This patch fixes this by making the mbundle lookup RCU-safe by using cmap instead of hmap and postponing mbundle memory free, as wells as postponing the frees of the mirrors and the vlan bitmaps of each mirror. Note that mirror stats update is still not accurate if multiple threads do it simultaneously. A less complete version of this patch (using cmap and RCU postpone just for the mbridge itself) was tested by Yunjian Wang and was found to fix the observed crash when running a script that adds and deletes a port repeatedly. Reported-by: Yunjian Wang <wangyunjian@huawei.com> Signed-off-by: Jarno Rajahalme <jarno@ovn.org>
* ofproto-dpif-mirror: Add mirror snaplen support.William Tu2016-07-031-2/+2
| | | | | | | | | | 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. Tested-at: https://travis-ci.org/williamtu/ovs-travis/builds/141186839 Signed-off-by: William Tu <u9012063@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.Ben Pfaff2015-07-271-4/+4
| | | | | | | | | | | When a mirror was restricted to particular VLANs, this code was allocating, copying, and freeing a 512-byte block of memory just to check the value of a single bit in the block. This fixes the problem. Found by inspection. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
* ofproto-dpif: Get rid of mirror_mask_ffs() function.Ben Pfaff2013-12-181-6/+0
| | | | | | | | | There's no need for it because we have the equivalent (actually more convenient) function raw_ctz(), which works with any integer type. Signed-off-by: Ben Pfaff <blp@nicira.com> CC: Alin Serdean <aserdean@cloudbasesolutions.com> CC: Gurucharan Shetty <shettyg@nicira.com>
* ofproto-dpif: Modularize mirror code.Ethan Jackson2013-07-071-0/+61
This code modularizes ofproto-dpif's mirror code by moving it to ofproto-dpif-mirror. Not only does this shorten ofproto-dpif and hide complexity, but its also necessary for future patches which modularize ofproto-dpif-xlate in preparation for multi-threading. Signed-off-by: Ethan Jackson <ethan@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>