summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif-mirror.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove last mentions of 'facet' from comments.Ben Pfaff2018-02-061-6/+5
| | | | | | How did these survive so long?! OVS hasn't had facets since 2013. Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif-mirror: Fix issue of reseting snaplen in mirroringZhenyu Gao2017-04-031-1/+2
| | | | | | | | | | Currently, the mirror code doesn't check new value of snaplen when try to reconfigure snaplen. This patch fix this issue and add testings to reconfigure snaplen. Signed-off-by: Zhenyu Gao <sysugaozhenyu@gmail.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: Andy Zhou <azhou@ovn.org>
* mirror: Allow concurrent lookups.Jarno Rajahalme2017-03-221-24/+50
| | | | | | | | | | | | | | | | | | | | | | 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>
* json: Move from lib to include/openvswitch.Terry Wilson2016-07-221-1/+1
| | | | | | | | | | | | | | | To easily allow both in- and out-of-tree building of the Python wrapper for the OVS JSON parser (e.g. w/ pip), move json.h to include/openvswitch. This also requires moving lib/{hmap,shash}.h. Both hmap.h and shash.h were #include-ing "util.h" even though the headers themselves did not use anything from there, but rather from include/openvswitch/util.h. Fixing that required including util.h in several C files mostly due to OVS_NOT_REACHED and things like xmalloc. Signed-off-by: Terry Wilson <twilson@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* ofproto-dpif-mirror: Add mirror snaplen support.William Tu2016-07-031-1/+8
| | | | | | | | | | 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 bug that flag "need_revalidate" is never reset.Huanle Han2016-02-051-2/+4
| | | | | | | | | Flag "need_revalidate" on mbridge is set to true when an ofbundle destroy. And it's never reset. It causes the backer revalidate and the mac learning flush every time 'ofproto_run' is called. Signed-off-by: Huanle Han <hanxueluo@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-6/+12
| | | | | | | | | | | 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>
* lib: Move vlog.h to <openvswitch/vlog.h>Thomas Graf2014-12-151-1/+1
| | | | | | | | A new function vlog_insert_module() is introduced to avoid using list_insert() from the vlog.h header. Signed-off-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
* mirror: Use 'struct ref_count' for refcounting.Joe Stringer2014-03-111-17/+13
| | | | | Signed-off-by: Joe Stringer <joestringer@nicira.com> Signed-off-by: Ben Pfaff <blp@nicira.com>
* ofproto-dpif: Get rid of mirror_mask_ffs() function.Ben Pfaff2013-12-181-2/+1
| | | | | | | | | 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-mirror: Fix memory leak in mbridge_unref().Ben Pfaff2013-09-041-0/+1
| | | | | | | Found by valgrind. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ethan Jackson <ethan@nicira.com>
* ofproto-dpif: Modularize mirror code.Ethan Jackson2013-07-071-0/+500
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>