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

Function ulp_get_session

dpdk/drivers/net/bnxt/tf_ulp/bnxt_ulp.c:1338–1356  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1336 * pointer, otherwise allocate a new session.
1337 */
1338static struct bnxt_ulp_session_state *
1339ulp_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.

Callers 2

ulp_session_initFunction · 0.85
bnxt_ulp_port_deinitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected