0001
0002
0003
0004 #include "../nfpcore/nfp_cpp.h"
0005 #include "../nfpcore/nfp_nsp.h"
0006 #include "../nfp_app.h"
0007 #include "../nfp_main.h"
0008
0009 static int nfp_nic_init(struct nfp_app *app)
0010 {
0011 struct nfp_pf *pf = app->pf;
0012
0013 if (pf->eth_tbl && pf->max_data_vnics != pf->eth_tbl->count) {
0014 nfp_err(pf->cpp, "ETH entries don't match vNICs (%d vs %d)\n",
0015 pf->max_data_vnics, pf->eth_tbl->count);
0016 return -EINVAL;
0017 }
0018
0019 return 0;
0020 }
0021
0022 static int nfp_nic_sriov_enable(struct nfp_app *app, int num_vfs)
0023 {
0024 return 0;
0025 }
0026
0027 static void nfp_nic_sriov_disable(struct nfp_app *app)
0028 {
0029 }
0030
0031 const struct nfp_app_type app_nic = {
0032 .id = NFP_APP_CORE_NIC,
0033 .name = "nic",
0034
0035 .init = nfp_nic_init,
0036 .vnic_alloc = nfp_app_nic_vnic_alloc,
0037
0038 .sriov_enable = nfp_nic_sriov_enable,
0039 .sriov_disable = nfp_nic_sriov_disable,
0040 };