Files
vpp/src/plugins/acl/types.h
Andrew Yourtchenko 8d2e9bd8d8 acl-plugin: tm: optimize multi-lookups and prepare to add tuplemerge
- instantiate the per-use mask type entry for a given hash ACE
  this prepares to adding tuplemerge where the applied ACE may
  have a different mask type due to relaxing of the tuples

- store the vector of the colliding rules for linear lookups
  rather than traversing the linked list.

- store the lowest rule index for a given mask type inside
  the structure. This allows to skip looking up at the later
  mask types if we already matched an entry that is in front
  of the very first entry in the new candidate mask type,
  thus saving a worthless hash table lookup.

- use a vector of mask type indices rather than bitmap,
  in the sorted order (by construction) of ascending
  lowest rule index - this allows to terminate the lookups
  early.

- adapt the debug cli outputs accordingly to show the data

- propagate the is_ip6 into the inner calls

Change-Id: I7a67b271e66785c6eab738b632b432d5886a0a8a
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
2018-06-26 13:35:24 +00:00

41 lines
1.0 KiB
C

/*
* Copyright (c) 2018 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef included_acl_types_h
#define included_acl_types_h
#include <vnet/vnet.h>
#include <vnet/ip/ip.h>
typedef struct
{
u8 is_permit;
u8 is_ipv6;
ip46_address_t src;
u8 src_prefixlen;
ip46_address_t dst;
u8 dst_prefixlen;
u8 proto;
u16 src_port_or_type_first;
u16 src_port_or_type_last;
u16 dst_port_or_code_first;
u16 dst_port_or_code_last;
u8 tcp_flags_value;
u8 tcp_flags_mask;
} acl_rule_t;
#endif // included_acl_types_h