Rate This Document
Findability
Accuracy
Completeness
Readability

flexda_custom_construct_attr

Function

Constructs and issues hardware flow table attributes.

Syntax

int flexda_custom_construct_attr(void *ctx, const struct flexda_custom_info_t *info, struct rte_flow_attr *attr)

Parameters

Parameter

Type

Input/Output

Description

ctx

void *

Input

Pointer to the custom context. It also stores the extracted header information.

info

struct flexda_custom_info_t *

Input

Information provided by dpak-ovs for flexda-ovs to read. For details, see Table 1.

attr

struct rte_flow_attr *

Input

Address where the hardware flow table attributes are assembled. It includes the table ID and the flag that indicates whether flexda-dpdk is enabled.

Return value

int

Output

The function returns 0 upon successful execution; otherwise, it returns an error code.

Table 1 struct flexda_custom_info_t

Attribute Type

Attribute Name

Description

uint16_t

input_port_id

Source input port of the current packet in OVS offload.

dp_packet *

pkt

Current packet in OVS offload.

rte_flow_action *

src_actions

Actions of the current software flow table in OVS offload.

Example

int flexda_custom_construct_attr(void *ctx, flexda_custom_info_t info, struct rte_flow_attr *attr)
{
    struct custom_packet_ctx *custom_ctx = (struct custom_packet_ctx *)ctx;
    // Assign the Hydra table enumeration value to the group value of attr based on the custom context to specify the target table.
    if (custom_ctx->vlan_poped == 1) {
        attr->group = HYDRA_TABLE_MYMAINPIPE_VLAN_EXACT;
    }
    return 0;
}