X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Ftf_core%2Ftfp.c;h=b88affcf1eae90a988c6d380b820e9a342407920;hb=7100b0e5511e58269498900aea30bc03e15ba2fd;hp=426a182a907b128bc401a3da8ba91204c4bb27fb;hpb=aa2be5093363b57a6ad102bad9732b08c8c1f5ab;p=dpdk.git diff --git a/drivers/net/bnxt/tf_core/tfp.c b/drivers/net/bnxt/tf_core/tfp.c index 426a182a90..b88affcf1e 100644 --- a/drivers/net/bnxt/tf_core/tfp.c +++ b/drivers/net/bnxt/tf_core/tfp.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * see the individual elements. - * Copyright(c) 2019-2020 Broadcom + * Copyright(c) 2019-2021 Broadcom * All rights reserved. */ @@ -178,3 +178,22 @@ tfp_get_fid(struct tf *tfp, uint16_t *fw_fid) return 0; } + +int +tfp_get_pf(struct tf *tfp, uint16_t *pf) +{ + struct bnxt *bp = NULL; + + if (tfp == NULL || pf == NULL) + return -EINVAL; + + bp = container_of(tfp, struct bnxt, tfp); + if (BNXT_VF(bp) && bp->parent) { + *pf = bp->parent->fid - 1; + return 0; + } else if (BNXT_PF(bp)) { + *pf = bp->fw_fid - 1; + return 0; + } + return -EINVAL; +}