Lines Matching refs:sgid_tbl

473 				     struct bnxt_qplib_sgid_tbl *sgid_tbl)  in bnxt_qplib_free_sgid_tbl()  argument
475 kfree(sgid_tbl->tbl); in bnxt_qplib_free_sgid_tbl()
476 kfree(sgid_tbl->hw_id); in bnxt_qplib_free_sgid_tbl()
477 kfree(sgid_tbl->ctx); in bnxt_qplib_free_sgid_tbl()
478 kfree(sgid_tbl->vlan); in bnxt_qplib_free_sgid_tbl()
479 sgid_tbl->tbl = NULL; in bnxt_qplib_free_sgid_tbl()
480 sgid_tbl->hw_id = NULL; in bnxt_qplib_free_sgid_tbl()
481 sgid_tbl->ctx = NULL; in bnxt_qplib_free_sgid_tbl()
482 sgid_tbl->vlan = NULL; in bnxt_qplib_free_sgid_tbl()
483 sgid_tbl->max = 0; in bnxt_qplib_free_sgid_tbl()
484 sgid_tbl->active = 0; in bnxt_qplib_free_sgid_tbl()
488 struct bnxt_qplib_sgid_tbl *sgid_tbl, in bnxt_qplib_alloc_sgid_tbl() argument
491 sgid_tbl->tbl = kcalloc(max, sizeof(*sgid_tbl->tbl), GFP_KERNEL); in bnxt_qplib_alloc_sgid_tbl()
492 if (!sgid_tbl->tbl) in bnxt_qplib_alloc_sgid_tbl()
495 sgid_tbl->hw_id = kcalloc(max, sizeof(u16), GFP_KERNEL); in bnxt_qplib_alloc_sgid_tbl()
496 if (!sgid_tbl->hw_id) in bnxt_qplib_alloc_sgid_tbl()
499 sgid_tbl->ctx = kcalloc(max, sizeof(void *), GFP_KERNEL); in bnxt_qplib_alloc_sgid_tbl()
500 if (!sgid_tbl->ctx) in bnxt_qplib_alloc_sgid_tbl()
503 sgid_tbl->vlan = kcalloc(max, sizeof(u8), GFP_KERNEL); in bnxt_qplib_alloc_sgid_tbl()
504 if (!sgid_tbl->vlan) in bnxt_qplib_alloc_sgid_tbl()
507 sgid_tbl->max = max; in bnxt_qplib_alloc_sgid_tbl()
510 kfree(sgid_tbl->ctx); in bnxt_qplib_alloc_sgid_tbl()
511 sgid_tbl->ctx = NULL; in bnxt_qplib_alloc_sgid_tbl()
513 kfree(sgid_tbl->hw_id); in bnxt_qplib_alloc_sgid_tbl()
514 sgid_tbl->hw_id = NULL; in bnxt_qplib_alloc_sgid_tbl()
516 kfree(sgid_tbl->tbl); in bnxt_qplib_alloc_sgid_tbl()
517 sgid_tbl->tbl = NULL; in bnxt_qplib_alloc_sgid_tbl()
522 struct bnxt_qplib_sgid_tbl *sgid_tbl) in bnxt_qplib_cleanup_sgid_tbl() argument
526 for (i = 0; i < sgid_tbl->max; i++) { in bnxt_qplib_cleanup_sgid_tbl()
527 if (memcmp(&sgid_tbl->tbl[i], &bnxt_qplib_gid_zero, in bnxt_qplib_cleanup_sgid_tbl()
529 bnxt_qplib_del_sgid(sgid_tbl, &sgid_tbl->tbl[i].gid, in bnxt_qplib_cleanup_sgid_tbl()
530 sgid_tbl->tbl[i].vlan_id, true); in bnxt_qplib_cleanup_sgid_tbl()
532 memset(sgid_tbl->tbl, 0, sizeof(*sgid_tbl->tbl) * sgid_tbl->max); in bnxt_qplib_cleanup_sgid_tbl()
533 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max); in bnxt_qplib_cleanup_sgid_tbl()
534 memset(sgid_tbl->vlan, 0, sizeof(u8) * sgid_tbl->max); in bnxt_qplib_cleanup_sgid_tbl()
535 sgid_tbl->active = 0; in bnxt_qplib_cleanup_sgid_tbl()
538 static void bnxt_qplib_init_sgid_tbl(struct bnxt_qplib_sgid_tbl *sgid_tbl, in bnxt_qplib_init_sgid_tbl() argument
543 for (i = 0; i < sgid_tbl->max; i++) in bnxt_qplib_init_sgid_tbl()
544 sgid_tbl->tbl[i].vlan_id = 0xffff; in bnxt_qplib_init_sgid_tbl()
546 memset(sgid_tbl->hw_id, -1, sizeof(u16) * sgid_tbl->max); in bnxt_qplib_init_sgid_tbl()
794 bnxt_qplib_cleanup_sgid_tbl(res, &res->sgid_tbl); in bnxt_qplib_cleanup_res()
799 bnxt_qplib_init_sgid_tbl(&res->sgid_tbl, res->netdev); in bnxt_qplib_init_res()
808 bnxt_qplib_free_sgid_tbl(res, &res->sgid_tbl); in bnxt_qplib_free_res()
825 rc = bnxt_qplib_alloc_sgid_tbl(res, &res->sgid_tbl, dev_attr->max_sgid); in bnxt_qplib_alloc_res()