From: Alejandro Lucero Date: Fri, 1 Sep 2017 14:12:11 +0000 (+0100) Subject: net/nfp: support vNIC config BAR mapping X-Git-Tag: spdx-start~1993 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6b2e61ac36ac92056a507e78e00a90be4f4d1f32;p=dpdk.git net/nfp: support vNIC config BAR mapping NFP vNICs use a subset of PCI device BARs. vNIC config bar depends on firmware symbol defining how to map it through a NFP expansion bar. This patch adds a NSPU API function for getting a vNIC config bar mapped through a expansion bar giving a firmware symbol. The PMD will use the PCI bar offset returned for accessing the vNIC bar. Signed-off-by: Alejandro Lucero --- diff --git a/drivers/net/nfp/nfp_nspu.c b/drivers/net/nfp/nfp_nspu.c index 5a3ae0e7ee..827f0b2dc6 100644 --- a/drivers/net/nfp/nfp_nspu.c +++ b/drivers/net/nfp/nfp_nspu.c @@ -496,3 +496,16 @@ nfp_nsp_fw_setup(nspu_desc_t *desc, const char *sym, uint64_t *pcie_offset) return 0; } + +int +nfp_nsp_map_ctrl_bar(nspu_desc_t *desc, uint64_t *pcie_offset) +{ + ssize_t bar0_sym_size; + + if (nfp_nspu_set_bar_from_symbl(desc, "_pf0_net_bar0", + NFP_NET_PF_CFG_EXP_BAR, + pcie_offset, &bar0_sym_size)) + return -ENODEV; + + return 0; +} diff --git a/drivers/net/nfp/nfp_nspu.h b/drivers/net/nfp/nfp_nspu.h index c439700780..8211f9208e 100644 --- a/drivers/net/nfp/nfp_nspu.h +++ b/drivers/net/nfp/nfp_nspu.h @@ -73,3 +73,4 @@ int nfp_nspu_init(nspu_desc_t *desc, int nfp, int pcie_bar, size_t pcie_barsz, int exp_bar, void *exp_bar_cfg_base, void *exp_bar_mmap); int nfp_nsp_get_abi_version(nspu_desc_t *desc, int *major, int *minor); int nfp_nsp_fw_setup(nspu_desc_t *desc, const char *sym, uint64_t *pcie_offset); +int nfp_nsp_map_ctrl_bar(nspu_desc_t *desc, uint64_t *pcie_offset);