MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fs_flow_create

Function fs_flow_create

dpdk/drivers/net/failsafe/failsafe_flow.c:93–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93static struct rte_flow *
94fs_flow_create(struct rte_eth_dev *dev,
95 const struct rte_flow_attr *attr,
96 const struct rte_flow_item patterns[],
97 const struct rte_flow_action actions[],
98 struct rte_flow_error *error)
99{
100 struct sub_device *sdev;
101 struct rte_flow *flow;
102 uint8_t i;
103
104 if (fs_lock(dev, 0) != 0)
105 return NULL;
106 flow = fs_flow_allocate(attr, patterns, actions);
107 FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
108 flow->flows[i] = rte_flow_create(PORT_ID(sdev),
109 attr, patterns, actions, error);
110 if (flow->flows[i] == NULL && fs_err(sdev, -rte_errno)) {
111 ERROR("Failed to create flow on sub_device %d",
112 i);
113 goto err;
114 }
115 }
116 TAILQ_INSERT_TAIL(&PRIV(dev)->flow_list, flow, next);
117 fs_unlock(dev, 0);
118 return flow;
119err:
120 FOREACH_SUBDEV(sdev, i, dev) {
121 if (flow->flows[i] != NULL)
122 rte_flow_destroy(PORT_ID(sdev),
123 flow->flows[i], error);
124 }
125 fs_flow_release(&flow);
126 fs_unlock(dev, 0);
127 return NULL;
128}
129
130static int
131fs_flow_destroy(struct rte_eth_dev *dev,

Callers

nothing calls this directly

Calls 8

fs_lockFunction · 0.85
fs_flow_allocateFunction · 0.85
FOREACH_SUBDEV_STATEFunction · 0.85
rte_flow_createFunction · 0.85
fs_errFunction · 0.85
fs_unlockFunction · 0.85
rte_flow_destroyFunction · 0.85
fs_flow_releaseFunction · 0.85

Tested by

no test coverage detected