What can I help you with?
NVIDIA DPDK Documentation MLNX_DPDK_22.11_2310.5.1 LTS

Switch Granularity Rule Matching

Switch Granularity Rule Matching supports the represented_port item in pattern. If the spec and the mask are both set to NULL, the source vPort will not be added to the matcher, it will match patterns for all vPort to reduce rule count and memory consumption.

When testpmd starts with a PF, a VF-rep0 and a VF-rep1, the below example and code snippets will redirect packets from VF0 and VF1 to the wire.

Copy
Copied!
            

testpmd> flow create 0 ingress transfer pattern eth / represented_port / end actions represented_port ethdev_id is 0 / end

Copy
Copied!
            

struct rte_flow_attr attr; struct rte_flow_error error; struct rte_flow_item pattern[MAX_PATTERN_NUM]; struct rte_flow_action action[MAX_ACTION_NUM]; struct rte_flow_action_ethdev represented_port = { .port_id = 0 };   memset(&attr, 0, sizeof(struct rte_flow_attr));   attr.ingress = 1; attr.transfer = 1; attr.group = 1; attr.priority = 1;   pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH; pattern[1].type = RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT; pattern[1].spec = NULL; pattern[1].mask = NULL; pattern[2].type = RTE_FLOW_ITEM_TYPE_END;   action[0].type = RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT; action[0].conf = &represented_port; action[1].type = RTE_FLOW_ACTION_TYPE_END;   res = rte_flow_validate(port_id, &attr, pattern, action, &error); if (!res)      flow = rte_flow_create(port_id, &attr, pattern, action, &error); return flow;

© Copyright 2024, NVIDIA. Last updated on Jan 9, 2025.