@@ -1708,11 +1708,13 @@ int dfl_fpga_cdev_config_ports_vf(struct dfl_fpga_cdev *cdev, int num_vfs)
mutex_lock(&cdev->lock);
/*
- * can't turn multiple ports into 1 VF device, only 1 port for 1 VF
- * device, so if released port number doesn't match VF device number,
- * then reject the request with -EINVAL error code.
+ * In the IOFS legacy model, it can't turn multiple ports into 1 VF
+ * device, because only 1 port conneced to 1 VF device, so if released
+ * port number doesn't match VF device number, then reject the request
+ * with -EINVAL error code.
*/
- if (cdev->released_port_num != num_vfs) {
+ if ((cdev->features & DFL_FEAT_PORT_CONNECTED_AFU) &&
+ cdev->released_port_num != num_vfs) {
ret = -EINVAL;
goto done;
}