[PATCH v7 03/12] net/nfp: move app specific init logic to own function

Ferruh Yigit ferruh.yigit at xilinx.com
Mon Sep 5 17:38:53 CEST 2022


On 8/12/2022 11:22 AM, Chaoyong He wrote:
> The NFP card can load different firmware applications.
> This commit move the init logic of corenic app of the
> secondary process into its own function.
> 
> Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>

<...>

> +	switch (app_id) {
> +	case NFP_APP_CORE_NIC:
> +		PMD_INIT_LOG(INFO, "Initializing coreNIC");
> +		ret = nfp_secondary_init_app_nic(pci_dev, sym_tbl, cpp);
> +		if (ret != 0) {
> +			PMD_INIT_LOG(ERR, "Could not initialize coreNIC!");
> +			goto sym_tbl_cleanup;
>   		}

If you are planning to add more FW app support, what do you think to add 
another abstraction for it? Something like

struct fw_ops {
	*init()
	*secondary_init()
	...
}

	...
	ret = fw_ops[app_id].secondary_init(...);
	...




More information about the dev mailing list