From f372a65f703a069bab6330c1c82e1360cfb59e4d Mon Sep 17 00:00:00 2001 From: Xiaoyun Wang Date: Thu, 14 May 2020 17:29:18 +0800 Subject: [PATCH] net/hinic: update code style The patch modifies the comments of structures or functions, and adds space for comments, removes extra empty lines and adjusts the print level for VF branches in one sdk interface. Signed-off-by: Xiaoyun Wang --- drivers/net/hinic/base/hinic_pmd_cmdq.h | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 1 - drivers/net/hinic/hinic_pmd_ethdev.c | 28 +++++++++++------------- drivers/net/hinic/hinic_pmd_ethdev.h | 12 +++++----- 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/drivers/net/hinic/base/hinic_pmd_cmdq.h b/drivers/net/hinic/base/hinic_pmd_cmdq.h index 4ce0a4c5b8..0d5e380123 100644 --- a/drivers/net/hinic/base/hinic_pmd_cmdq.h +++ b/drivers/net/hinic/base/hinic_pmd_cmdq.h @@ -9,7 +9,7 @@ #define HINIC_SCMD_DATA_LEN 16 -/* hiovs pmd use 64, kernel l2nic use 4096 */ +/* pmd driver uses 64, kernel l2nic use 4096 */ #define HINIC_CMDQ_DEPTH 64 #define HINIC_CMDQ_BUF_SIZE 2048U diff --git a/drivers/net/hinic/base/hinic_pmd_hwif.c b/drivers/net/hinic/base/hinic_pmd_hwif.c index 63fba0d297..4578b689db 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwif.c +++ b/drivers/net/hinic/base/hinic_pmd_hwif.c @@ -99,7 +99,7 @@ void hinic_set_pf_status(struct hinic_hwif *hwif, enum hinic_pf_status status) u32 addr = HINIC_CSR_FUNC_ATTR5_ADDR; if (hwif->attr.func_type == TYPE_VF) { - PMD_DRV_LOG(ERR, "VF doesn't support set attr5"); + PMD_DRV_LOG(INFO, "VF doesn't support to set attr5"); return; } diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c index 60c4e14055..7f7e11dbd2 100644 --- a/drivers/net/hinic/base/hinic_pmd_nicio.c +++ b/drivers/net/hinic/base/hinic_pmd_nicio.c @@ -369,7 +369,6 @@ static int init_rq_ctxts(struct hinic_nic_io *nic_io) HINIC_MOD_L2NIC, HINIC_UCODE_CMD_MDY_QUEUE_CONTEXT, cmd_buf, &out_param, 0); - if ((err) || out_param != 0) { PMD_DRV_LOG(ERR, "Failed to set RQ ctxts"); err = -EFAULT; diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 073afa4fa9..8634fe814d 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -354,7 +354,7 @@ static int hinic_dev_configure(struct rte_eth_dev *dev) return err; } - /*clear fdir filter flag in function table*/ + /* clear fdir filter flag in function table */ hinic_free_fdir_filter(nic_dev); return HINIC_OK; @@ -440,7 +440,7 @@ static int hinic_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, } nic_dev->rxqs[queue_idx] = rxq; - /* alloc rx sq hw wqepage*/ + /* alloc rx sq hw wqe page */ rc = hinic_create_rq(hwdev, queue_idx, rq_depth, socket_id); if (rc) { PMD_DRV_LOG(ERR, "Create rxq[%d] failed, dev_name: %s, rq_depth: %d", @@ -2035,12 +2035,12 @@ static int hinic_rss_conf_get(struct rte_eth_dev *dev, } /** - * DPDK callback to update the RETA indirection table. + * DPDK callback to update the RSS redirection table. * * @param dev * Pointer to Ethernet device structure. * @param reta_conf - * Pointer to RETA configuration structure array. + * Pointer to RSS reta configuration data. * @param reta_size * Size of the RETA table. * @@ -2102,14 +2102,13 @@ disable_rss: return HINIC_ERROR; } - /** - * DPDK callback to get the RETA indirection table. + * DPDK callback to get the RSS indirection table. * * @param dev * Pointer to Ethernet device structure. * @param reta_conf - * Pointer to RETA configuration structure array. + * Pointer to RSS reta configuration data. * @param reta_size * Size of the RETA table. * @@ -2309,8 +2308,7 @@ static int hinic_dev_xstats_get_names(struct rte_eth_dev *dev, for (i = 0; i < HINIC_VPORT_XSTATS_NUM; i++) { snprintf(xstats_names[count].name, sizeof(xstats_names[count].name), - "%s", - hinic_vport_stats_strings[i].name); + "%s", hinic_vport_stats_strings[i].name); count++; } @@ -2321,13 +2319,13 @@ static int hinic_dev_xstats_get_names(struct rte_eth_dev *dev, for (i = 0; i < HINIC_PHYPORT_XSTATS_NUM; i++) { snprintf(xstats_names[count].name, sizeof(xstats_names[count].name), - "%s", - hinic_phyport_stats_strings[i].name); + "%s", hinic_phyport_stats_strings[i].name); count++; } return count; } + /** * DPDK callback to set mac address * @@ -2492,19 +2490,19 @@ allmulti: } /** - * DPDK callback to manage filter operations + * DPDK callback to manage filter control operations * * @param dev * Pointer to Ethernet device structure. * @param filter_type - * Filter type. + * Filter type, which just supports generic type. * @param filter_op - * Operation to perform. + * Filter operation to perform. * @param arg * Pointer to operation-specific structure. * * @return - * 0 on success, negative errno value on failure. + * 0 on success, negative error value otherwise. */ static int hinic_dev_filter_ctrl(struct rte_eth_dev *dev, enum rte_filter_type filter_type, diff --git a/drivers/net/hinic/hinic_pmd_ethdev.h b/drivers/net/hinic/hinic_pmd_ethdev.h index 1cb389d021..64b2c81056 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.h +++ b/drivers/net/hinic/hinic_pmd_ethdev.h @@ -53,11 +53,13 @@ struct hinic_5tuple_filter_info { * used when more than one filter matches. */ uint8_t priority; - uint8_t dst_ip_mask:1, /* if mask is 1b, do not compare dst ip. */ - src_ip_mask:1, /* if mask is 1b, do not compare src ip. */ - dst_port_mask:1, /* if mask is 1b, do not compare dst port. */ - src_port_mask:1, /* if mask is 1b, do not compare src port. */ - proto_mask:1; /* if mask is 1b, do not compare protocol. */ + + /* if mask is 1b, do not compare the response bit domain */ + uint8_t dst_ip_mask:1, + src_ip_mask:1, + dst_port_mask:1, + src_port_mask:1, + proto_mask:1; }; /* 5tuple filter structure */ -- 2.20.1