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. |
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;
}
Parent topic: Hook Functions