bnxt_en: get rid of num_stat_ctxs variable
For bnxt_en driver, stat_ctxs created will always be same as cp_nr_rings. Remove extra variable that duplicates the value. Also introduce bnxt_get_avail_stat_ctxs_for_en() helper to get available stat_ctxs and bnxt_get_ulp_stat_ctxs() helper to return number of stat_ctxs used by RDMA. Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com> Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
e916b0815a
commit
c027c6b4e9
@@ -48,7 +48,7 @@ static int bnxt_register_dev(struct bnxt_en_dev *edev, int ulp_id,
|
||||
|
||||
max_stat_ctxs = bnxt_get_max_func_stat_ctxs(bp);
|
||||
if (max_stat_ctxs <= BNXT_MIN_ROCE_STAT_CTXS ||
|
||||
bp->num_stat_ctxs == max_stat_ctxs)
|
||||
bp->cp_nr_rings == max_stat_ctxs)
|
||||
return -ENOMEM;
|
||||
bnxt_set_max_func_stat_ctxs(bp, max_stat_ctxs -
|
||||
BNXT_MIN_ROCE_STAT_CTXS);
|
||||
@@ -218,6 +218,14 @@ int bnxt_get_ulp_msix_base(struct bnxt *bp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bnxt_get_ulp_stat_ctxs(struct bnxt *bp)
|
||||
{
|
||||
if (bnxt_ulp_registered(bp->edev, BNXT_ROCE_ULP))
|
||||
return BNXT_MIN_ROCE_STAT_CTXS;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int bnxt_send_msg(struct bnxt_en_dev *edev, int ulp_id,
|
||||
struct bnxt_fw_msg *fw_msg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user