DPDK RTE flow helper functions TAPI

Overview

RTE flow helper functions TAPI

Copyright (C) 2019-2022 OKTET Labs Ltd. More…

// global functions

void tapi_rte_flow_add_ndn_action_queue(asn_value* ndn_actions, int action_index, uint16_t queue);
void tapi_rte_flow_add_ndn_action_drop(asn_value* ndn_actions, int action_index);
void tapi_rte_flow_add_ndn_action_count(asn_value* ndn_actions, int action_index, uint32_t counter_id);
void tapi_rte_flow_add_ndn_action_encap(asn_value* ndn_actions, int action_index, tarpc_rte_eth_tunnel_type type, const asn_value* encap_hdr);
void tapi_rte_flow_add_ndn_action_decap(asn_value* ndn_actions, int action_index, tarpc_rte_eth_tunnel_type type);
void tapi_rte_flow_add_ndn_action_of_pop_vlan(asn_value* ndn_actions, int action_index);
void tapi_rte_flow_add_ndn_action_of_push_vlan(asn_value* ndn_actions, int action_index, uint16_t ethertype);
void tapi_rte_flow_add_ndn_action_of_set_vlan_vid(asn_value* ndn_actions, int action_index, uint16_t vlan_vid);
void tapi_rte_flow_add_ndn_action_port(ndn_rte_flow_action_type_t type, uint32_t ethdev_port_id, asn_value* actions, int entry_idx);
void tapi_rte_flow_add_ndn_action_jump(asn_value* ndn_actions, int action_index, uint32_t group);
void tapi_rte_flow_add_ndn_item_port(ndn_rte_flow_item_type_t type, uint32_t ethdev_port_id, asn_value* items, int entry_idx);
rpc_rte_flow_p tapi_rte_flow_validate_and_create_rule(rcf_rpc_server* rpcs, uint16_t port_id, rpc_rte_flow_attr_p attr, rpc_rte_flow_item_p pattern, rpc_rte_flow_action_p actions);
void tapi_rte_flow_make_attr(rcf_rpc_server* rpcs, uint32_t group, uint32_t priority, te_bool ingress, te_bool egress, te_bool transfer, rpc_rte_flow_attr_p* attr);
void tapi_rte_flow_isolate(rcf_rpc_server* rpcs, uint16_t port_id, int set);

Detailed Documentation

RTE flow helper functions TAPI

Copyright (C) 2019-2022 OKTET Labs Ltd. All rights reserved.

Global Functions

void tapi_rte_flow_add_ndn_action_queue(asn_value* ndn_actions, int action_index, uint16_t queue)

Add a QUEUE action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

queue

Queue index of the action

void tapi_rte_flow_add_ndn_action_drop(asn_value* ndn_actions, int action_index)

Add a DROP action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

void tapi_rte_flow_add_ndn_action_count(asn_value* ndn_actions, int action_index, uint32_t counter_id)

Add a COUNT action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

counter_id

Counter index

void tapi_rte_flow_add_ndn_action_encap(asn_value* ndn_actions, int action_index, tarpc_rte_eth_tunnel_type type, const asn_value* encap_hdr)

Add a encap action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

type

Type of the encapsulation

encap_hdr

Flow rule pattern that is used as a encapsulated packet’s header definition

void tapi_rte_flow_add_ndn_action_decap(asn_value* ndn_actions, int action_index, tarpc_rte_eth_tunnel_type type)

Add a decap action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

type

Type of the encapsulation

void tapi_rte_flow_add_ndn_action_of_pop_vlan(asn_value* ndn_actions, int action_index)

Add a pop VLAN action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

void tapi_rte_flow_add_ndn_action_of_push_vlan(asn_value* ndn_actions, int action_index, uint16_t ethertype)

Add a push vlan action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

ethertype

VLAN EtherType

void tapi_rte_flow_add_ndn_action_of_set_vlan_vid(asn_value* ndn_actions, int action_index, uint16_t vlan_vid)

Add a set vlan vid action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

vlan_vid

VLAN ID

void tapi_rte_flow_add_ndn_action_port(ndn_rte_flow_action_type_t type, uint32_t ethdev_port_id, asn_value* actions, int entry_idx)

Add an action of type PORT_REPRESENTOR / REPRESENTED_PORT to the action list.

Parameters:

type

The action type

ethdev_port_id

The representor’s ethdev port ID

actions

The list of actions

entry_idx

The entry index

void tapi_rte_flow_add_ndn_action_jump(asn_value* ndn_actions, int action_index, uint32_t group)

Add a JUMP action to an action list at specified index.

Parameters:

ndn_actions

Action list

action_index

Index at which the action is put to list

group

Group to redirect packets to

void tapi_rte_flow_add_ndn_item_port(ndn_rte_flow_item_type_t type, uint32_t ethdev_port_id, asn_value* items, int entry_idx)

Add an item of type PORT_REPRESENTOR / REPRESENTED_PORT to the item list.

Parameters:

type

The item type

ethdev_port_id

The representor’s ethdev port ID

items

The list of items

entry_idx

The entry index

rpc_rte_flow_p tapi_rte_flow_validate_and_create_rule(rcf_rpc_server* rpcs, uint16_t port_id, rpc_rte_flow_attr_p attr, rpc_rte_flow_item_p pattern, rpc_rte_flow_action_p actions)

Convert an ASN value representing a flow rule pattern into RTE flow rule pattern and a template that matches the pattern.

Parameters:

rpcs

RPC server handle

port_id

The port identifier of the device

attr

RTE flow attr pointer

pattern

RTE flow item pointer to the array of items

actions

RTE flow action pointer to the array of actions

Returns:

RTE flow pointer on success; jumps out on failure

void tapi_rte_flow_make_attr(rcf_rpc_server* rpcs, uint32_t group, uint32_t priority, te_bool ingress, te_bool egress, te_bool transfer, rpc_rte_flow_attr_p* attr)

Make RTE flow rule attributes

Parameters:

rpcs

RPC server handle

group

Rule priority group

priority

Rule priority level within group

ingress

Rule applies to ingress traffic

egress

Rule applies to egress traffic

transfer

Transfer the rule to the lowest possible level of any device endpoints found in the pattern

attr

RTE flow attr pointer

TEST_FAIL

void tapi_rte_flow_isolate(rcf_rpc_server* rpcs, uint16_t port_id, int set)

Isolate RTE flow

Parameters:

rpcs

RPC server handle

port_id

The port identifier of the device

set

Nonzero to enter isolated mode, leave it otherwise

TEST_FAIL