cmdq_ctxt, in_size, NULL,
NULL, 0);
if (err) {
- if (err == HINIC_MBOX_PF_BUSY_ACTIVE_FW)
+ if (err == HINIC_MBOX_PF_BUSY_ACTIVE_FW ||
+ err == HINIC_DEV_BUSY_ACTIVE_FW) {
cmdqs->status |= HINIC_CMDQ_SET_FAIL;
- PMD_DRV_LOG(ERR, "Set cmdq ctxt failed");
+ PMD_DRV_LOG(ERR, "PF or VF fw is hot active");
+ }
+ PMD_DRV_LOG(ERR, "Set cmdq ctxt failed, err: %d", err);
return -EFAULT;
}
}
free_recv_msg(&pf_to_mgmt->recv_msg_from_mgmt);
}
+static int hinic_get_mgmt_channel_status(void *hwdev)
+{
+ struct hinic_hwif *hwif = ((struct hinic_hwdev *)hwdev)->hwif;
+ u32 val;
+
+ if (hinic_func_type((struct hinic_hwdev *)hwdev) == TYPE_VF)
+ return false;
+
+ val = hinic_hwif_read_reg(hwif, HINIC_ICPL_RESERVD_ADDR);
+
+ return HINIC_GET_MGMT_CHANNEL_STATUS(val, MGMT_CHANNEL_STATUS);
+}
+
/**
* send_msg_to_mgmt_async - send async message
* @pf_to_mgmt: PF to MGMT channel
u64 header;
u16 cmd_size = mgmt_msg_len(msg_len);
+ /* If fw is hot active, return failed */
+ if (hinic_get_mgmt_channel_status(pf_to_mgmt->hwdev)) {
+ if (mod == HINIC_MOD_COMM || mod == HINIC_MOD_L2NIC)
+ return HINIC_DEV_BUSY_ACTIVE_FW;
+ else
+ return -EBUSY;
+ }
+
if (direction == HINIC_MSG_RESPONSE)
prepare_header(pf_to_mgmt, &header, msg_len, mod, ack_type,
direction, cmd, resp_msg_id);
recv_msg->msg_len);
*out_size = recv_msg->msg_len;
} else {
- PMD_DRV_LOG(ERR, "Mgmt rsp's msg len: %u overflow.",
+ PMD_DRV_LOG(ERR, "Mgmt rsp's msg len:%u overflow.",
recv_msg->msg_len);
err = -ERANGE;
}
return err;
}
-static int hinic_get_mgmt_channel_status(void *hwdev)
-{
- struct hinic_hwif *hwif = ((struct hinic_hwdev *)hwdev)->hwif;
- u32 val;
-
- if (hinic_func_type((struct hinic_hwdev *)hwdev) == TYPE_VF)
- return false;
-
- val = hinic_hwif_read_reg(hwif, HINIC_ICPL_RESERVD_ADDR);
-
- return HINIC_GET_MGMT_CHANNEL_STATUS(val, MGMT_CHANNEL_STATUS);
-}
-
int hinic_msg_to_mgmt_sync(void *hwdev, enum hinic_mod_type mod, u8 cmd,
void *buf_in, u16 in_size,
void *buf_out, u16 *out_size, u32 timeout)
if (!hwdev || in_size > HINIC_MSG_TO_MGMT_MAX_LEN)
return -EINVAL;
- /* If status is hot upgrading, don't send message to mgmt */
- if (hinic_get_mgmt_channel_status(hwdev))
- return -EPERM;
-
if (hinic_func_type(hwdev) == TYPE_VF) {
rc = hinic_mbox_to_pf(hwdev, mod, cmd, buf_in, in_size,
buf_out, out_size, timeout);
else
fc_conf->mode = RTE_FC_NONE;
- PMD_DRV_LOG(INFO, "Get pause options, tx: %s, rx: %s, auto: %s\n",
- nic_pause.tx_pause ? "on" : "off",
- nic_pause.rx_pause ? "on" : "off",
- nic_pause.auto_neg ? "on" : "off");
-
return 0;
}
nic_dev->nic_pause.rx_pause = nic_pause.rx_pause;
nic_dev->nic_pause.tx_pause = nic_pause.tx_pause;
- PMD_DRV_LOG(INFO, "Get pause options, tx: %s, rx: %s, auto: %s\n",
+ PMD_DRV_LOG(INFO, "Set pause options, tx: %s, rx: %s, auto: %s\n",
nic_pause.tx_pause ? "on" : "off",
nic_pause.rx_pause ? "on" : "off",
nic_pause.auto_neg ? "on" : "off");