[01/13] net/nfp: define correct size for configuration BAR
Checks
Commit Message
For NFP6000, the size of configuration BAR is always 32kB.
Remove the out of date value of macro and replace the hard
code value with this constant macro.
Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
drivers/net/nfp/flower/nfp_flower.c | 4 ++--
drivers/net/nfp/nfp_ctrl.h | 7 +------
drivers/net/nfp/nfp_ethdev.c | 3 ++-
3 files changed, 5 insertions(+), 9 deletions(-)
@@ -1108,7 +1108,7 @@ nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev)
/* Map the PF ctrl bar */
pf_dev->ctrl_bar = nfp_rtsym_map(pf_dev->sym_tbl, "_pf0_net_bar0",
- 32768, &pf_dev->ctrl_area);
+ NFP_NET_CFG_BAR_SZ, &pf_dev->ctrl_area);
if (pf_dev->ctrl_bar == NULL) {
PMD_INIT_LOG(ERR, "Cloud not map the PF vNIC ctrl bar");
ret = -ENODEV;
@@ -1145,7 +1145,7 @@ nfp_init_app_fw_flower(struct nfp_pf_dev *pf_dev)
/* Map the ctrl vNIC ctrl bar */
ctrl_hw->ctrl_bar = nfp_rtsym_map(pf_dev->sym_tbl, "_pf0_net_ctrl_bar",
- 32768, &ctrl_hw->ctrl_area);
+ NFP_NET_CFG_BAR_SZ, &ctrl_hw->ctrl_area);
if (ctrl_hw->ctrl_bar == NULL) {
PMD_INIT_LOG(ERR, "Cloud not map the ctrl vNIC ctrl bar");
ret = -ENODEV;
@@ -14,14 +14,9 @@
/*
* Configuration BAR size.
*
- * The configuration BAR is 8K in size, but on the NFP6000, due to
- * THB-350, 32k needs to be reserved.
+ * On the NFP6000, due to THB-350, the configuration BAR is 32K in size.
*/
-#ifdef __NFP_IS_6000
#define NFP_NET_CFG_BAR_SZ (32 * 1024)
-#else
-#define NFP_NET_CFG_BAR_SZ (8 * 1024)
-#endif
/* Offset in Freelist buffer where packet starts on RX */
#define NFP_NET_RX_OFFSET 32
@@ -827,7 +827,8 @@ nfp_init_app_fw_nic(struct nfp_pf_dev *pf_dev)
/* Map the symbol table */
pf_dev->ctrl_bar = nfp_rtsym_map(pf_dev->sym_tbl, "_pf0_net_bar0",
- app_fw_nic->total_phyports * 32768, &pf_dev->ctrl_area);
+ app_fw_nic->total_phyports * NFP_NET_CFG_BAR_SZ,
+ &pf_dev->ctrl_area);
if (pf_dev->ctrl_bar == NULL) {
PMD_INIT_LOG(ERR, "nfp_rtsym_map fails for _pf0_net_ctrl_bar");
ret = -EIO;