flexda_custom_update_ctx
Function
Updates the custom context.
Syntax
int flexda_custom_update_ctx(void *ctx, const struct flexda_custom_info_t *info)
Parameters
Parameter |
Type |
Input/Output |
Description |
|---|---|---|---|
ctx |
void * |
Input |
Pointer to the custom context. |
info |
const struct flexda_custom_info_t * |
Input |
Information provided by dpak-ovs for flexda-ovs to read. For details, see Table 1. |
Return value |
int |
Output |
The function returns 0 upon successful execution; otherwise, it returns an error code. |
Example
int flexda_custom_update_ctx(void *ctx, flexda_custom_info_t info)
{
// Update the custom context based on the actions of the current software flow table. For example, if POP_VLAN exists, set the vlan_poped flag bit in the custom context to 1.
struct custom_packet_ctx *custom_ctx = (struct custom_packet_ctx *)ctx;
struct rte_flow_action *actions = info.src_actions;
for (int i = 0; i < 15; i++) {
switch (action[i].type) {
case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:
custom_ctx->vlan_poped = 1;
break;
default:
break;
}
}
return 0;
}
Parent topic: Hook Functions