DPDK
25.11.0
Toggle main menu visibility
Loading...
Searching...
No Matches
examples/flow_filtering/jump_flow.c
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright (c) 2022 NVIDIA Corporation & Affiliates
*/
#include <stdlib.h>
#include <
rte_flow.h
>
#include "jump_flow.h"
struct
rte_flow *
create_jump_flow(uint16_t port_id, uint16_t group_id,
struct
rte_flow_error
*error)
{
struct
rte_flow_action
actions[2] = {0};
struct
rte_flow_item
patterns[2] = {0};
struct
rte_flow *flow = NULL;
struct
rte_flow_attr
flow_attr = {
.ingress = 1,
.group = 0,
};
struct
rte_flow_action_jump
jump = {
.group = group_id,
};
/* Set up jump action to target group */
actions[0].
type
=
RTE_FLOW_ACTION_TYPE_JUMP
;
actions[0].
conf
= &jump;
actions[1].
type
=
RTE_FLOW_ACTION_TYPE_END
;
/* match on ethernet */
patterns[0].
type
=
RTE_FLOW_ITEM_TYPE_ETH
;
patterns[1].
type
=
RTE_FLOW_ITEM_TYPE_END
;
/* Validate the rule and create it. */
if
(
rte_flow_validate
(port_id, &flow_attr, patterns, actions, error) == 0)
flow =
rte_flow_create
(port_id, &flow_attr, patterns, actions, error);
return
flow;
}
rte_flow.h
rte_flow_validate
int rte_flow_validate(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
RTE_FLOW_ACTION_TYPE_END
@ RTE_FLOW_ACTION_TYPE_END
Definition
rte_flow.h:2597
RTE_FLOW_ACTION_TYPE_JUMP
@ RTE_FLOW_ACTION_TYPE_JUMP
Definition
rte_flow.h:2622
rte_flow_create
struct rte_flow * rte_flow_create(uint16_t port_id, const struct rte_flow_attr *attr, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], struct rte_flow_error *error)
RTE_FLOW_ITEM_TYPE_END
@ RTE_FLOW_ITEM_TYPE_END
Definition
rte_flow.h:162
RTE_FLOW_ITEM_TYPE_ETH
@ RTE_FLOW_ITEM_TYPE_ETH
Definition
rte_flow.h:218
rte_flow_action_jump
Definition
rte_flow.h:3359
rte_flow_action
Definition
rte_flow.h:4291
rte_flow_action::conf
const void * conf
Definition
rte_flow.h:4293
rte_flow_action::type
enum rte_flow_action_type type
Definition
rte_flow.h:4292
rte_flow_attr
Definition
rte_flow.h:89
rte_flow_error
Definition
rte_flow.h:4378
rte_flow_item
Definition
rte_flow.h:2127
rte_flow_item::type
enum rte_flow_item_type type
Definition
rte_flow.h:2128
Generated by
1.17.0