1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 /* Copyright (C) 2017 Netronome Systems, Inc. */
4 #include "../nfpcore/nfp_cpp.h"
5 #include "../nfpcore/nfp_nsp.h"
6 #include "../nfp_app.h"
7 #include "../nfp_main.h"
9 static int nfp_nic_init(struct nfp_app
*app
)
11 struct nfp_pf
*pf
= app
->pf
;
13 if (pf
->eth_tbl
&& pf
->max_data_vnics
!= pf
->eth_tbl
->count
) {
14 nfp_err(pf
->cpp
, "ETH entries don't match vNICs (%d vs %d)\n",
15 pf
->max_data_vnics
, pf
->eth_tbl
->count
);
22 static int nfp_nic_sriov_enable(struct nfp_app
*app
, int num_vfs
)
27 static void nfp_nic_sriov_disable(struct nfp_app
*app
)
31 const struct nfp_app_type app_nic
= {
32 .id
= NFP_APP_CORE_NIC
,
36 .vnic_alloc
= nfp_app_nic_vnic_alloc
,
38 .sriov_enable
= nfp_nic_sriov_enable
,
39 .sriov_disable
= nfp_nic_sriov_disable
,