| 91 | } |
| 92 | |
| 93 | static struct rte_flow * |
| 94 | fs_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; |
| 119 | err: |
| 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 | |
| 130 | static int |
| 131 | fs_flow_destroy(struct rte_eth_dev *dev, |
nothing calls this directly
no test coverage detected