Documentation
¶
Overview ¶
Package table implements RTE Table.
This tool is part of the DPDK Packet Framework tool suite and provides a standard interface to implement different types of lookup tables for data plane processing.
Virtually any search algorithm that can uniquely associate data to a lookup key can be fitted under this lookup table abstraction. For the flow table use-case, the lookup key is an n-tuple of packet fields that uniquely identifies a traffic flow, while data represents actions and action meta-data associated with the same traffic flow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( HashExtOps = (*Ops)(&C.rte_table_hash_ext_ops) HashLruOps = (*Ops)(&C.rte_table_hash_lru_ops) HashCuckooOps = (*Ops)(&C.rte_table_hash_cuckoo_ops) )
Table ops implementations.
var ( // LPMOps is the LPM IPv4 ops. LPMOps = (*Ops)(&C.rte_table_lpm_ops) // LPM6Ops is the LPM IPv6 ops. LPM6Ops = (*Ops)(&C.rte_table_lpm_ipv6_ops) )
Functions ¶
This section is empty.
Types ¶
type ACLField ¶
type ACLField [C.sizeof_struct_rte_acl_field / 8]uint64
ACLField describes a field to match.
func NewACLField16 ¶
NewACLField16 returns ACLField with 16-bit value and range mask.
func NewACLField32 ¶
NewACLField32 returns ACLField with 32-bit value and range mask.
func NewACLField64 ¶
NewACLField64 returns ACLField with 64-bit value and range mask.
func NewACLField8 ¶
NewACLField8 returns ACLField with 8-bit value and range mask.
type ACLFieldDef ¶
type ACLFieldDef struct {
Type uint8 // type - RTE_ACL_FIELD_TYPE_*.
Size uint8 // size of field 1,2,4, or 8.
FieldIndex uint8 // index of field inside the rule.
InputIndex uint8 // 0-N input index.
Offset uint32 // offset to start of field.
}
ACLFieldDef is the ACL Field definition. Each field in the ACL rule has an associate definition. It defines the type of field, its size, its offset in the input buffer, the field index, and the input index. For performance reasons, the inner loop of the search function is unrolled to process four input bytes at a time. This requires the input to be grouped into sets of 4 consecutive bytes. The loop processes the first input byte as part of the setup and then subsequent bytes must be in groups of 4 consecutive bytes.
type ACLParams ¶
type ACLParams struct {
Name string // Name.
Rules uint32 // Maximum number of ACL rules in the table.
FieldFormat []ACLFieldDef // Format specification of the fields of the ACL rule.
}
ACLParams is the ACL table parameters.
type ACLRuleAdd ¶
type ACLRuleAdd struct {
Priority int32
FieldValue [C.RTE_ACL_MAX_FIELDS]ACLField
}
ACLRuleAdd is the key for adding a key/value to a table.
type ACLRuleDelete ¶
type ACLRuleDelete struct {
FieldValue [C.RTE_ACL_MAX_FIELDS]ACLField
}
ACLRuleDelete is the key for deleting a key/value from a table.
type ArrayKey ¶
type ArrayKey struct {
Pos uint32
}
ArrayKey is the key for adding/deleting key from table.
type ArrayParams ¶
type ArrayParams struct {
// Number of array entries. Has to be a power of two.
Entries uint32
// Byte offset within input packet meta-data where lookup key
// (i.e. the array entry index) is located.
Offset uint32
}
ArrayParams is the Array table parameters.
type HashFunc ¶
type HashFunc C.rte_hash_function
HashFunc is the signature of hash function used for Cuckoo-Hash table implementation.
type HashOpHash ¶
type HashOpHash C.rte_table_hash_op_hash
HashOpHash is the signature of hash function used for Hash table implementation.
type HashParams ¶
type HashParams struct {
// Set this to desired Hash*Ops variable.
TableOps *Ops
// Name.
Name string
// Key size (number of bytes).
KeySize uint32
// Byte offset within packet meta-data where the key is located
KeyOffset uint32
// Key mask.
KeyMask []byte
// Number of keys.
KeysNum uint32
// Number of buckets.
BucketsNum uint32
// Hash function.
Hash struct {
Func HashOpHash
Seed uint64
}
// Hash function for HashCuckooOps.
CuckooHash struct {
Func HashFunc
Seed uint32
}
}
HashParams is the Hash table parameters.
type LPM6Key ¶
type LPM6Key struct {
// IP address.
IP [C.RTE_LPM_IPV6_ADDR_SIZE]byte
// IP address depth. The most significant "depth" bits of the IP
// address specify the network part of the IP address, while the
// rest of the bits specify the host part of the address and are
// ignored for the purpose of route specification.
Depth uint8
}
LPM6Key is the insert key for LPM IPv4 table.
type LPMKey ¶
type LPMKey struct {
// IP address.
IP uint32
// IP address depth. The most significant "depth" bits of the IP
// address specify the network part of the IP address, while the
// rest of the bits specify the host part of the address and are
// ignored for the purpose of route specification.
Depth uint8
// contains filtered or unexported fields
}
LPMKey is the insert key for LPM IPv4 table.
type LPMParams ¶
type LPMParams struct {
TableOps *Ops
// Name.
Name string
// Number of rules.
Rules uint32
// Field is currently unused.
NumTBL8 uint32
// Number of bytes at the start of the table entry that uniquely
// identify the entry. Cannot be bigger than table entry size.
EntryUniqueSize uint32
// Byte offset within input packet meta-data where lookup key
// (i.e. the destination IP address) is located.
Offset uint32
}
LPMParams is the Hash table parameters.
type Params ¶
type Params interface {
common.Transformer
Ops() *Ops
}
Params is the parameters for creating a table.