Skip to content

Commit 77e34ad

Browse files
authored
Robertmj patch1 (#36)
* sync load/clear/rescan tuning from 16xl concurrency testing. * Applied ETIMEDOUT patch, code cleanup. * Setup to return the unchanged return code from the fpga_mgmt lib
1 parent b099d59 commit 77e34ad

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

sdk/userspace/fpga_libs/fpga_mgmt/fpga_mgmt_cmd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ fpga_mgmt_send_cmd(int slot_id,
415415
bool done = false;
416416
while (!done) {
417417
ret = fpga_hal_mbox_read(handle, (void *)rsp, len);
418-
fail_on(ret = (ret) ? ETIMEDOUT : 0, err_code, "Error: operation timed out");
418+
fail_on(ret = (ret) ? -ETIMEDOUT : 0, err_code, "Error: operation timed out");
419419

420420
ret = fpga_mgmt_afi_validate_header(cmd, rsp, *len);
421421
if (ret == 0) {
@@ -426,7 +426,6 @@ fpga_mgmt_send_cmd(int slot_id,
426426
retries++;
427427
}
428428
}
429-
fail_on(ret != 0, err, CLI_INTERNAL_ERR_STR);
430429

431430
return 0;
432431
err:

sdk/userspace/fpga_libs/fpga_pci/fpga_pci_sysfs.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,17 @@ fpga_pci_remove_app_pf(struct fpga_pci_resource_map *app_map)
600600
ret = fpga_pci_write_one2file(sysfs_name);
601601
fail_on_quiet(ret != 0, err, "cli_write_one2file failed");
602602

603+
#if 0
603604
/** Check that the app_pf does not exist */
605+
/**
606+
* NOTE:
607+
* A concurrent (remove)+rescan action on another FPGA slot will make this
608+
* FPGA's app_pf visible again, so we should not error out here if we see
609+
* that the app_pf is still present.
610+
*/
604611
ret = fpga_pci_check_app_pf_sysfs(sysfs_name, false); /** exists==false */
605612
fail_on_quiet(ret != 0, err, "fpga_pci_check_app_pf_sysfs failed");
613+
#endif
606614

607615
errno = 0;
608616
return 0;

sdk/userspace/fpga_mgmt_tools/src/fpga_local_cmd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ cli_show_image_info(struct fpga_mgmt_image_info *info)
247247
static int
248248
cli_attach(void)
249249
{
250-
int ret;
250+
int ret = FPGA_ERR_FAIL;
251251

252252
if (f1.opcode == CLI_CMD_DESCRIBE_SLOTS) {
253253
/**
@@ -266,7 +266,7 @@ cli_attach(void)
266266
out:
267267
return 0;
268268
err:
269-
return FPGA_ERR_FAIL;
269+
return ret;
270270
}
271271

272272
/**
@@ -362,7 +362,7 @@ command_describe(void)
362362

363363
return 0;
364364
err:
365-
return FPGA_ERR_FAIL;
365+
return ret;
366366
}
367367

368368
/**
@@ -393,7 +393,7 @@ command_describe_slots(void)
393393
}
394394
return 0;
395395
err:
396-
return FPGA_ERR_FAIL;
396+
return ret;
397397
}
398398

399399
/**

sdk/userspace/fpga_mgmt_tools/src/fpga_local_cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ enum {
8181
/**
8282
* Request timeout: timeout * delay_msec
8383
*/
84-
#define CLI_REQUEST_TIMEOUT_DFLT 25
84+
#define CLI_REQUEST_TIMEOUT_DFLT 50
8585
#define CLI_REQUEST_DELAY_MSEC_DFLT 200
8686

8787
/**

0 commit comments

Comments
 (0)