The patch optimizes log files without "\n".
Signed-off-by: Xiaoyun Wang <cloud.wangxiaoyun@huawei.com>
buf_out, out_size);
break;
default:
- PMD_DRV_LOG(ERR, "No handler, mod = %d",
- recv_mbox->mod);
+ PMD_DRV_LOG(ERR, "No handler, mod: %d", recv_mbox->mod);
rc = HINIC_MBOX_VF_CMD_ERROR;
break;
}
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;
}
buf_out, &out_size);
break;
default:
- PMD_DRV_LOG(ERR, "No handler, mod = %d", recv_msg->mod);
+ PMD_DRV_LOG(ERR, "No handler, mod: %d", recv_msg->mod);
break;
}
if (!check_mgmt_seq_id_and_seg_len(recv_msg, seq_id, seq_len)) {
PMD_DRV_LOG(ERR,
- "Mgmt msg sequence and segment check fail, "
+ "Mgmt msg sequence and segment check failed, "
"func id: 0x%x, front id: 0x%x, current id: 0x%x, seg len: 0x%x",
hinic_global_func_id(pf_to_mgmt->hwdev),
recv_msg->sed_id, seq_id, seq_len);
event = EQ_ELEM_DESC_GET(aeqe_desc, TYPE);
if (EQ_ELEM_DESC_GET(aeqe_desc, SRC)) {
- PMD_DRV_LOG(ERR, "AEQ sw event not support %d",
- event);
+ PMD_DRV_LOG(ERR, "AEQ sw event not support %d", event);
return -ENODEV;
} else {
int err;
if (!hwdev || !old_mac || !new_mac) {
- PMD_DRV_LOG(ERR, "Hwdev, old_mac or new_mac is NULL\n");
+ PMD_DRV_LOG(ERR, "Hwdev, old_mac or new_mac is NULL");
return -EINVAL;
}
if (err || !out_size ||
(mac_info.mgmt_msg_head.status &&
mac_info.mgmt_msg_head.status != HINIC_PF_SET_VF_ALREADY)) {
- PMD_DRV_LOG(ERR, "Failed to update MAC, err: %d, status: 0x%x, out size: 0x%x\n",
+ PMD_DRV_LOG(ERR, "Failed to update MAC, err: %d, status: 0x%x, out size: 0x%x",
err, mac_info.mgmt_msg_head.status, out_size);
return -EINVAL;
}
if (mac_info.mgmt_msg_head.status == HINIC_PF_SET_VF_ALREADY) {
- PMD_DRV_LOG(WARNING, "PF has already set vf mac, Ignore update operation.\n");
+ PMD_DRV_LOG(WARNING, "PF has already set vf mac, Ignore update operation");
return HINIC_PF_SET_VF_ALREADY;
}
&out_size);
if (err || !out_size || vlan_info.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR,
- "Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x\n",
+ "Failed to %s vlan, err: %d, status: 0x%x, out size: 0x%x",
add ? "add" : "remove", err,
vlan_info.mgmt_msg_head.status, out_size);
return -EINVAL;
err = HINIC_MGMT_CMD_UNSUPPORTED;
} else if (err || !out_size || vlan_filter.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR,
- "Failed to config vlan filter, vlan_filter_ctrl: 0x%x, err: %d, status: 0x%x, out size: 0x%x\n",
+ "Failed to config vlan filter, vlan_filter_ctrl: 0x%x, err: %d, status: 0x%x, out size: 0x%x",
vlan_filter_ctrl, err,
vlan_filter.mgmt_msg_head.status, out_size);
err = -EINVAL;
&vlan_cfg, &out_size);
if (err || !out_size || vlan_cfg.mgmt_msg_head.status) {
PMD_DRV_LOG(ERR,
- "Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x\n",
+ "Failed to set rx vlan offload, err: %d, status: 0x%x, out size: 0x%x",
err, vlan_cfg.mgmt_msg_head.status, out_size);
return -EINVAL;
}
pg_bw_t += *(pg_bw + i);
if (*(up_tc + i) > HINIC_DCB_TC_MAX) {
- PMD_DRV_LOG(ERR,
- "Invalid up %d mapping tc: %d", i,
+ PMD_DRV_LOG(ERR, "Invalid up %d mapping tc: %d", i,
*(up_tc + i));
return -EINVAL;
}
&rate, sizeof(rate), &rate,
&out_size);
if (err || !out_size || rate.mgmt_msg_head.status) {
- PMD_DRV_LOG(ERR, "can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
+ PMD_DRV_LOG(ERR, "Can't %s port Anti-Attack rate limit, err: %d, status: 0x%x, out size: 0x%x",
(enable ? "enable" : "disable"), err,
rate.mgmt_msg_head.status, out_size);
return -EINVAL;
sizeof(fast_recycled_mode),
&fast_recycled_mode, &out_size, 0);
if (err || fast_recycled_mode.mgmt_msg_head.status || !out_size) {
- PMD_DRV_LOG(ERR,
- "Failed to set recycle mode, ret = %d",
+ PMD_DRV_LOG(ERR, "Failed to set recycle mode, ret: %d",
fast_recycled_mode.mgmt_msg_head.status);
return -EFAULT;
}
HINIC_UCODE_CMD_MDY_QUEUE_CONTEXT,
cmd_buf, &out_param, 0);
if (err || out_param != 0) {
- PMD_DRV_LOG(ERR, "Failed to set SQ ctxts, err:%d", err);
+ PMD_DRV_LOG(ERR, "Failed to set SQ ctxts, err: %d",
+ err);
err = -EFAULT;
break;
}
if (hwdev->cmdqs->status & HINIC_CMDQ_SET_FAIL) {
err = hinic_reinit_cmdq_ctxts(hwdev);
if (err) {
- PMD_DRV_LOG(ERR, "Reinit cmdq context failed, rc: %d\n",
+ PMD_DRV_LOG(ERR, "Reinit cmdq context failed, rc: %d",
err);
return err;
}
/* clean LRO/TSO context space */
err = clean_qp_offload_ctxt(nic_io);
if (err) {
- PMD_DRV_LOG(ERR, "Clean qp offload ctxts failed, rc: %d",
- err);
+ PMD_DRV_LOG(ERR, "Clean qp offload ctxts failed, rc: %d", err);
return err;
}
/* update rx buf size to function table */
err = hinic_set_rx_vhd_mode(hwdev, 0, rx_buf_sz);
if (err) {
- PMD_DRV_LOG(ERR, "Set rx vhd mode failed, rc: %d",
- err);
+ PMD_DRV_LOG(ERR, "Set rx vhd mode failed, rc: %d", err);
return err;
}
err = hinic_set_root_ctxt(hwdev, nic_io->rq_depth,
nic_io->sq_depth, rx_buf_sz);
if (err) {
- PMD_DRV_LOG(ERR, "Set root context failed, rc: %d",
- err);
+ PMD_DRV_LOG(ERR, "Set root context failed, rc: %d", err);
return err;
}
sq_attr.dma_attr_off = 0;
err = hinic_set_ci_table(hwdev, q_id, &sq_attr);
if (err) {
- PMD_DRV_LOG(ERR, "Set ci table failed, rc: %d",
- err);
+ PMD_DRV_LOG(ERR, "Set ci table failed, rc: %d", err);
goto set_cons_idx_table_err;
}
}
max_qps = hinic_func_max_qnum(hwdev);
if ((max_qps & (max_qps - 1))) {
- PMD_DRV_LOG(ERR, "wrong number of max_qps: %d",
+ PMD_DRV_LOG(ERR, "Wrong number of max_qps: %d",
max_qps);
return -EINVAL;
}
err = hinic_vlan_offload_set(dev,
ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK);
if (err) {
- PMD_DRV_LOG(ERR, "Initialize vlan filter and strip failed\n");
+ PMD_DRV_LOG(ERR, "Initialize vlan filter and strip failed");
(void)hinic_config_mq_mode(dev, FALSE);
return err;
}
err = hinic_get_mgmt_version(nic_dev->hwdev, fw_ver);
if (err) {
- PMD_DRV_LOG(ERR, "Failed to get fw version\n");
+ PMD_DRV_LOG(ERR, "Failed to get fw version");
return -EINVAL;
}
/* just stop phy port and vport */
rc = hinic_set_port_enable(nic_dev->hwdev, false);
if (rc)
- PMD_DRV_LOG(WARNING, "Disable phy port failed, error: %d, dev_name:%s, port_id:%d",
+ PMD_DRV_LOG(WARNING, "Disable phy port failed, error: %d, dev_name: %s, port_id: %d",
rc, name, port_id);
rc = hinic_set_vport_enable(nic_dev->hwdev, false);
}
if (rss_conf->rss_key_len > HINIC_RSS_KEY_SIZE) {
- PMD_DRV_LOG(ERR, "Invalid rss key, rss_key_len:%d",
+ PMD_DRV_LOG(ERR, "Invalid rss key, rss_key_len: %d",
rss_conf->rss_key_len);
return HINIC_ERROR;
}
return HINIC_OK;
if (reta_size != NIC_RSS_INDIR_SIZE) {
- PMD_DRV_LOG(ERR, "Invalid reta size, reta_size:%d", reta_size);
+ PMD_DRV_LOG(ERR, "Invalid reta size, reta_size: %d", reta_size);
return HINIC_ERROR;
}
for (i = 0 ; i < reta_size; i++) {
if (indirtbl[i] >= nic_dev->num_rq) {
- PMD_DRV_LOG(ERR, "Invalid reta entry, index:%d, num_rq:%d",
+ PMD_DRV_LOG(ERR, "Invalid reta entry, index: %d, num_rq: %d",
i, nic_dev->num_rq);
goto disable_rss;
}
u16 i = 0;
if (reta_size != NIC_RSS_INDIR_SIZE) {
- PMD_DRV_LOG(ERR, "Invalid reta size, reta_size:%d", reta_size);
+ PMD_DRV_LOG(ERR, "Invalid reta size, reta_size: %d", reta_size);
return HINIC_ERROR;
}
err = hinic_rss_get_indir_tbl(nic_dev->hwdev, tmpl_idx, indirtbl);
if (err) {
- PMD_DRV_LOG(ERR, "Get rss indirect table failed, error:%d",
+ PMD_DRV_LOG(ERR, "Get rss indirect table failed, error: %d",
err);
return err;
}
rte_ether_addr_copy(addr, &nic_dev->default_addr);
- PMD_DRV_LOG(INFO, "Set new mac address %02x:%02x:%02x:%02x:%02x:%02x\n",
+ PMD_DRV_LOG(INFO, "Set new mac address %02x:%02x:%02x:%02x:%02x:%02x",
addr->addr_bytes[0], addr->addr_bytes[1],
addr->addr_bytes[2], addr->addr_bytes[3],
addr->addr_bytes[4], addr->addr_bytes[5]);
* @param dev
* Pointer to Ethernet device structure.
* @param index
- * MAC address index.
+ * MAC address index, should less than 128.
*/
static void hinic_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
{
* @param dev
* Pointer to Ethernet device structure.
* @param mac_addr
- * MAC address to register.
+ * Pointer to MAC address
* @param index
- * MAC address index.
+ * MAC address index, should less than 128.
* @param vmdq
- * VMDq pool index to associate address with (ignored).
+ * VMDq pool index(not used).
*
* @return
- * 0 on success, a negative errno value otherwise and rte_errno is set.
+ * 0 on success, negative error value otherwise.
*/
-
static int hinic_mac_addr_add(struct rte_eth_dev *dev,
struct rte_ether_addr *mac_addr, uint32_t index,
__rte_unused uint32_t vmdq)
int ret;
if (index >= HINIC_MAX_UC_MAC_ADDRS) {
- PMD_DRV_LOG(INFO, "Add mac index(%u) is out of range,", index);
+ PMD_DRV_LOG(INFO, "Add mac index(%u) is out of range", index);
return -EINVAL;
}