summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Pei <andy.pei@intel.com>2019-11-14 17:03:05 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-11-20 17:36:05 +0100
commite21346c4392b9d9a0f7429ab2b0b632f6bdc69e4 (patch)
treeee9438e95defe9b8cb1ba555c7616301a941cc1c /drivers
parentc127953fd32d1eb31058d5054cb4896841fa2dbb (diff)
downloaddpdk-e21346c4392b9d9a0f7429ab2b0b632f6bdc69e4.zip
dpdk-e21346c4392b9d9a0f7429ab2b0b632f6bdc69e4.tar.gz
dpdk-e21346c4392b9d9a0f7429ab2b0b632f6bdc69e4.tar.xz
raw/ifpga: support lightweight FPGA image
if fpga image support lightweight feature, set afu uuid to all 0, ipn3ke representor will not be probed. Signed-off-by: Andy Pei <andy.pei@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/raw/ifpga/ifpga_rawdev.c44
1 files changed, 32 insertions, 12 deletions
diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c
index 73f0f8c..2865627 100644
--- a/drivers/raw/ifpga/ifpga_rawdev.c
+++ b/drivers/raw/ifpga/ifpga_rawdev.c
@@ -836,6 +836,8 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
rte_rawdev_obj_t pr_conf)
{
struct opae_adapter *adapter;
+ struct opae_manager *mgr;
+ struct opae_board_info *info;
struct rte_afu_pr_conf *afu_pr_conf;
int ret;
struct uuid uuid;
@@ -862,22 +864,40 @@ ifpga_rawdev_pr(struct rte_rawdev *dev,
}
}
- acc = opae_adapter_get_acc(adapter, afu_pr_conf->afu_id.port);
- if (!acc)
- return -ENODEV;
+ mgr = opae_adapter_get_mgr(adapter);
+ if (!mgr) {
+ IFPGA_RAWDEV_PMD_ERR("opae_manager of opae_adapter is NULL");
+ return -1;
+ }
- ret = opae_acc_get_uuid(acc, &uuid);
- if (ret)
- return ret;
+ if (ifpga_mgr_ops.get_board_info(mgr, &info)) {
+ IFPGA_RAWDEV_PMD_ERR("ifpga manager get_board_info fail!");
+ return -1;
+ }
+
+ if (info->lightweight) {
+ /* set uuid to all 0, when fpga is lightweight image */
+ memset(&afu_pr_conf->afu_id.uuid.uuid_low, 0, sizeof(u64));
+ memset(&afu_pr_conf->afu_id.uuid.uuid_high, 0, sizeof(u64));
+ } else {
+ acc = opae_adapter_get_acc(adapter, afu_pr_conf->afu_id.port);
+ if (!acc)
+ return -ENODEV;
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, sizeof(u64));
- rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high,
- uuid.b + 8, sizeof(u64));
+ ret = opae_acc_get_uuid(acc, &uuid);
+ if (ret)
+ return ret;
- IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n", __func__,
- (unsigned long)afu_pr_conf->afu_id.uuid.uuid_low,
- (unsigned long)afu_pr_conf->afu_id.uuid.uuid_high);
+ rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b,
+ sizeof(u64));
+ rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8,
+ sizeof(u64));
+ IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n",
+ __func__,
+ (unsigned long)afu_pr_conf->afu_id.uuid.uuid_low,
+ (unsigned long)afu_pr_conf->afu_id.uuid.uuid_high);
+ }
return 0;
}