| 233 | } |
| 234 | |
| 235 | static int |
| 236 | ssovf_port_setup(struct rte_eventdev *dev, uint8_t port_id, |
| 237 | const struct rte_event_port_conf *port_conf) |
| 238 | { |
| 239 | struct ssows *ws; |
| 240 | uint32_t reg_off; |
| 241 | uint8_t q; |
| 242 | struct ssovf_evdev *edev = ssovf_pmd_priv(dev); |
| 243 | |
| 244 | ssovf_func_trace("port=%d", port_id); |
| 245 | RTE_SET_USED(port_conf); |
| 246 | |
| 247 | /* Free memory prior to re-allocation if needed */ |
| 248 | if (dev->data->ports[port_id] != NULL) { |
| 249 | ssovf_port_release(dev->data->ports[port_id]); |
| 250 | dev->data->ports[port_id] = NULL; |
| 251 | } |
| 252 | |
| 253 | /* Allocate event port memory */ |
| 254 | ws = rte_zmalloc_socket("eventdev ssows", |
| 255 | sizeof(struct ssows), RTE_CACHE_LINE_SIZE, |
| 256 | dev->data->socket_id); |
| 257 | if (ws == NULL) { |
| 258 | ssovf_log_err("Failed to alloc memory for port=%d", port_id); |
| 259 | return -ENOMEM; |
| 260 | } |
| 261 | |
| 262 | ws->base = ssovf_bar(OCTEONTX_SSO_HWS, port_id, 0); |
| 263 | if (ws->base == NULL) { |
| 264 | rte_free(ws); |
| 265 | ssovf_log_err("Failed to get hws base addr port=%d", port_id); |
| 266 | return -EINVAL; |
| 267 | } |
| 268 | |
| 269 | reg_off = SSOW_VHWS_OP_GET_WORK0; |
| 270 | reg_off |= 1 << 4; /* Index_ggrp_mask (Use maskset zero) */ |
| 271 | reg_off |= 1 << 16; /* Wait */ |
| 272 | ws->getwork = ws->base + reg_off; |
| 273 | ws->port = port_id; |
| 274 | ws->lookup_mem = octeontx_fastpath_lookup_mem_get(); |
| 275 | |
| 276 | for (q = 0; q < edev->nb_event_queues; q++) { |
| 277 | ws->grps[q] = ssovf_bar(OCTEONTX_SSO_GROUP, q, 2); |
| 278 | if (ws->grps[q] == NULL) { |
| 279 | rte_free(ws); |
| 280 | ssovf_log_err("Failed to get grp%d base addr", q); |
| 281 | return -EINVAL; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | dev->data->ports[port_id] = ws; |
| 286 | ssovf_log_dbg("port=%d ws=%p", port_id, ws); |
| 287 | return 0; |
| 288 | } |
| 289 | |
| 290 | static int |
| 291 | ssovf_port_link(struct rte_eventdev *dev, void *port, const uint8_t queues[], |
nothing calls this directly
no test coverage detected