flexda_custom_construct_attr
接口功能
构建下发硬件流表attr。
接口格式
int flexda_custom_construct_attr(void *ctx, const struct flexda_custom_info_t *info, struct rte_flow_attr *attr)
参数说明
参数名 |
参数类型 |
入参/出参 |
说明 |
|---|---|---|---|
ctx |
void * |
入参 |
自定义上下文的地址。提取的头信息也保存其中。 |
info |
struct flexda_custom_info_t * |
入参 |
dpak-ovs提供flexda-ovs读取使用的信息。详情请参见表1。 |
hw_action |
struct rte_flow_action * |
入参 |
该接口组装硬件流表action的attr,目前包含table_id以及flexda-dpdk是否开启的标记。 |
函数返回值 |
int |
出参 |
若函数执行成功则返回0,若函数执行失败则返回错误码。 |
使用实例
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;
// 根据自定义上下文,将Hydra table的枚举值赋给attr中的group来指定下发的table
if (custom_ctx->vlan_poped == 1) {
attr->group = HYDRA_TABLE_MYMAINPIPE_VLAN_EXACT;
}
return 0;
}
父主题: Hook函数