|
47 | 47 |
|
48 | 48 | #define MGMT_MSG_TIMEOUT 5000
|
49 | 49 |
|
| 50 | +#define SET_FUNC_PORT_MBOX_TIMEOUT 30000 |
| 51 | + |
50 | 52 | #define SET_FUNC_PORT_MGMT_TIMEOUT 25000
|
51 | 53 |
|
| 54 | +#define UPDATE_FW_MGMT_TIMEOUT 20000 |
| 55 | + |
52 | 56 | #define mgmt_to_pfhwdev(pf_mgmt) \
|
53 | 57 | container_of(pf_mgmt, struct hinic_pfhwdev, pf_to_mgmt)
|
54 | 58 |
|
@@ -361,16 +365,22 @@ int hinic_msg_to_mgmt(struct hinic_pf_to_mgmt *pf_to_mgmt,
|
361 | 365 | return -EINVAL;
|
362 | 366 | }
|
363 | 367 |
|
364 |
| - if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) |
365 |
| - timeout = SET_FUNC_PORT_MGMT_TIMEOUT; |
| 368 | + if (HINIC_IS_VF(hwif)) { |
| 369 | + if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) |
| 370 | + timeout = SET_FUNC_PORT_MBOX_TIMEOUT; |
366 | 371 |
|
367 |
| - if (HINIC_IS_VF(hwif)) |
368 | 372 | return hinic_mbox_to_pf(pf_to_mgmt->hwdev, mod, cmd, buf_in,
|
369 |
| - in_size, buf_out, out_size, 0); |
370 |
| - else |
| 373 | + in_size, buf_out, out_size, timeout); |
| 374 | + } else { |
| 375 | + if (cmd == HINIC_PORT_CMD_SET_FUNC_STATE) |
| 376 | + timeout = SET_FUNC_PORT_MGMT_TIMEOUT; |
| 377 | + else if (cmd == HINIC_PORT_CMD_UPDATE_FW) |
| 378 | + timeout = UPDATE_FW_MGMT_TIMEOUT; |
| 379 | + |
371 | 380 | return msg_to_mgmt_sync(pf_to_mgmt, mod, cmd, buf_in, in_size,
|
372 | 381 | buf_out, out_size, MGMT_DIRECT_SEND,
|
373 | 382 | MSG_NOT_RESP, timeout);
|
| 383 | + } |
374 | 384 | }
|
375 | 385 |
|
376 | 386 | static void recv_mgmt_msg_work_handler(struct work_struct *work)
|
|
0 commit comments