diff options
author | Ben Pfaff <blp@nicira.com> | 2015-07-24 15:30:58 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2015-07-27 15:13:45 -0700 |
commit | a45475400a44065efb8667f0ef2e3de91ed31ca0 (patch) | |
tree | 94896ddcd3d5c8467f783f6e70f75bcb4432ac19 /ofproto/ofproto-dpif-mirror.h | |
parent | 980904823303ef02af605e62a30c9bebda25f1ef (diff) | |
download | openvswitch-a45475400a44065efb8667f0ef2e3de91ed31ca0.tar.gz |
ofproto-dpif-mirror: Fix insane waste of memory and time in checking VLANs.
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>
Diffstat (limited to 'ofproto/ofproto-dpif-mirror.h')
-rw-r--r-- | ofproto/ofproto-dpif-mirror.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ofproto/ofproto-dpif-mirror.h b/ofproto/ofproto-dpif-mirror.h index 64c456123..6e0dc88cb 100644 --- a/ofproto/ofproto-dpif-mirror.h +++ b/ofproto/ofproto-dpif-mirror.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Nicira, Inc. +/* Copyright (c) 2013, 2015 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -12,8 +12,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef OFPROT_DPIF_MIRROR_H -#define OFPROT_DPIF_MIRROR_H 1 +#ifndef OFPROTO_DPIF_MIRROR_H +#define OFPROTO_DPIF_MIRROR_H 1 #include <stdint.h> @@ -48,7 +48,7 @@ int mirror_get_stats(struct mbridge *, void *aux, uint64_t *packets, uint64_t *bytes); void mirror_update_stats(struct mbridge*, mirror_mask_t, uint64_t packets, uint64_t bytes); -bool mirror_get(struct mbridge *, int index, unsigned long **vlans, +bool mirror_get(struct mbridge *, int index, const unsigned long **vlans, mirror_mask_t *dup_mirrors, struct ofbundle **out, int *out_vlan); |