* Check if an ULP session is already allocated for a specific PCI * domain & bus. If it is already allocated simply return the session * pointer, otherwise allocate a new session. */
| 1336 | * pointer, otherwise allocate a new session. |
| 1337 | */ |
| 1338 | static struct bnxt_ulp_session_state * |
| 1339 | ulp_get_session(struct bnxt *bp, struct rte_pci_addr *pci_addr) |
| 1340 | { |
| 1341 | struct bnxt_ulp_session_state *session; |
| 1342 | |
| 1343 | /* if multi root capability is enabled, then ignore the pci bus id */ |
| 1344 | STAILQ_FOREACH(session, &bnxt_ulp_session_list, next) { |
| 1345 | if (BNXT_MULTIROOT_EN(bp)) { |
| 1346 | if (!memcmp(bp->dsn, session->dsn, |
| 1347 | sizeof(session->dsn))) { |
| 1348 | return session; |
| 1349 | } |
| 1350 | } else if (session->pci_info.domain == pci_addr->domain && |
| 1351 | session->pci_info.bus == pci_addr->bus) { |
| 1352 | return session; |
| 1353 | } |
| 1354 | } |
| 1355 | return NULL; |
| 1356 | } |
| 1357 | |
| 1358 | /* |
| 1359 | * Allocate and Initialize an ULP session and set it's state to INITIALIZED. |
no outgoing calls
no test coverage detected