X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fcommon%2Fcnxk%2Froc_idev.c;h=63cc040446e09c207046ad2e5e95c7ee0f8ecc43;hb=2c19694c8ecd3b9b60f7d0a8975316f111a01476;hp=bf9cce83175d63777d229de28920dadb90b8ea58;hpb=124ff1a4cbb3318421b03391b2cbc6735410f4bc;p=dpdk.git diff --git a/drivers/common/cnxk/roc_idev.c b/drivers/common/cnxk/roc_idev.c index bf9cce8317..63cc040446 100644 --- a/drivers/common/cnxk/roc_idev.c +++ b/drivers/common/cnxk/roc_idev.c @@ -29,6 +29,7 @@ idev_get_cfg(void) void idev_set_defaults(struct idev_cfg *idev) { + idev->sso_pf_func = 0; idev->npa = NULL; idev->npa_pf_func = 0; idev->max_pools = 128; @@ -38,6 +39,32 @@ idev_set_defaults(struct idev_cfg *idev) __atomic_store_n(&idev->npa_refcnt, 0, __ATOMIC_RELEASE); } +uint16_t +idev_sso_pffunc_get(void) +{ + struct idev_cfg *idev; + uint16_t sso_pf_func; + + idev = idev_get_cfg(); + sso_pf_func = 0; + if (idev != NULL) + sso_pf_func = __atomic_load_n(&idev->sso_pf_func, + __ATOMIC_ACQUIRE); + + return sso_pf_func; +} + +void +idev_sso_pffunc_set(uint16_t sso_pf_func) +{ + struct idev_cfg *idev; + + idev = idev_get_cfg(); + if (idev != NULL) + __atomic_store_n(&idev->sso_pf_func, sso_pf_func, + __ATOMIC_RELEASE); +} + uint16_t idev_npa_pffunc_get(void) { @@ -142,3 +169,16 @@ roc_idev_num_lmtlines_get(void) return num_lmtlines; } + +struct roc_nix * +roc_idev_npa_nix_get(void) +{ + struct npa_lf *npa_lf = idev_npa_obj_get(); + struct dev *dev; + + if (!npa_lf) + return NULL; + + dev = container_of(npa_lf, struct dev, npa); + return dev->roc_nix; +}