[dpdk-dev] [PATCH v1 2/2] net/ice: unify the bool type value

Yang, Qiming qiming.yang at intel.com
Tue Jan 14 08:29:10 CET 2020



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang at intel.com>
> Sent: Tuesday, January 14, 2020 1:23 PM
> To: dev at dpdk.org; Ye, Xiaolong <xiaolong.ye at intel.com>; Zhang, Qi Z
> <qi.z.zhang at intel.com>; Yang, Qiming <qiming.yang at intel.com>
> Cc: Wang, Haiyue <haiyue.wang at intel.com>
> Subject: [PATCH v1 2/2] net/ice: unify the bool type value
> 
> Replaces the redefined TRUE and FALSE values with standard ones to match the
> 'bool' type definition.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>

Acked-by: Qiming Yang <qiming.yang at intel.com>

> ---
>  drivers/net/ice/ice_ethdev.c | 22 +++++++++++-----------
>  drivers/net/ice/ice_rxtx.c   | 16 ++++++++--------
>  2 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index
> f99eb4e1b..8e9369e0a 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -1720,7 +1720,7 @@ ice_pf_setup(struct ice_pf *pf)
>  	uint16_t unused;
> 
>  	/* Clear all stats counters */
> -	pf->offset_loaded = FALSE;
> +	pf->offset_loaded = false;
>  	memset(&pf->stats, 0, sizeof(struct ice_hw_port_stats));
>  	memset(&pf->stats_offset, 0, sizeof(struct ice_hw_port_stats));
>  	memset(&pf->internal_stats, 0, sizeof(struct ice_eth_stats)); @@ -
> 2234,16 +2234,16 @@ ice_dev_init(struct rte_eth_dev *dev)
>  	vsi = pf->main_vsi;
> 
>  	/* Disable double vlan by default */
> -	ice_vsi_config_double_vlan(vsi, FALSE);
> +	ice_vsi_config_double_vlan(vsi, false);
> 
> -	ret = ice_aq_stop_lldp(hw, TRUE, FALSE, NULL);
> +	ret = ice_aq_stop_lldp(hw, true, false, NULL);
>  	if (ret != ICE_SUCCESS)
>  		PMD_INIT_LOG(DEBUG, "lldp has already stopped\n");
> -	ret = ice_init_dcb(hw, TRUE);
> +	ret = ice_init_dcb(hw, true);
>  	if (ret != ICE_SUCCESS)
>  		PMD_INIT_LOG(DEBUG, "Failed to init DCB\n");
>  	/* Forward LLDP packets to default VSI */
> -	ret = ice_vsi_config_sw_lldp(vsi, TRUE);
> +	ret = ice_vsi_config_sw_lldp(vsi, true);
>  	if (ret != ICE_SUCCESS)
>  		PMD_INIT_LOG(DEBUG, "Failed to cfg lldp\n");
>  	/* register callback func to eal lib */ @@ -3449,23 +3449,23 @@
> ice_vlan_offload_set(struct rte_eth_dev *dev, int mask)
>  	rxmode = &dev->data->dev_conf.rxmode;
>  	if (mask & ETH_VLAN_FILTER_MASK) {
>  		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_FILTER)
> -			ice_vsi_config_vlan_filter(vsi, TRUE);
> +			ice_vsi_config_vlan_filter(vsi, true);
>  		else
> -			ice_vsi_config_vlan_filter(vsi, FALSE);
> +			ice_vsi_config_vlan_filter(vsi, false);
>  	}
> 
>  	if (mask & ETH_VLAN_STRIP_MASK) {
>  		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_STRIP)
> -			ice_vsi_config_vlan_stripping(vsi, TRUE);
> +			ice_vsi_config_vlan_stripping(vsi, true);
>  		else
> -			ice_vsi_config_vlan_stripping(vsi, FALSE);
> +			ice_vsi_config_vlan_stripping(vsi, false);
>  	}
> 
>  	if (mask & ETH_VLAN_EXTEND_MASK) {
>  		if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
> -			ice_vsi_config_double_vlan(vsi, TRUE);
> +			ice_vsi_config_double_vlan(vsi, true);
>  		else
> -			ice_vsi_config_double_vlan(vsi, FALSE);
> +			ice_vsi_config_double_vlan(vsi, false);
>  	}
> 
>  	return 0;
> diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index
> ce499af43..ad3cb9c46 100644
> --- a/drivers/net/ice/ice_rxtx.c
> +++ b/drivers/net/ice/ice_rxtx.c
> @@ -424,7 +424,7 @@ ice_rx_queue_start(struct rte_eth_dev *dev, uint16_t
> rx_queue_id)
>  	/* Init the RX tail register. */
>  	ICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);
> 
> -	err = ice_switch_rx_queue(hw, rxq->reg_idx, TRUE);
> +	err = ice_switch_rx_queue(hw, rxq->reg_idx, true);
>  	if (err) {
>  		PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on",
>  			    rx_queue_id);
> @@ -450,7 +450,7 @@ ice_rx_queue_stop(struct rte_eth_dev *dev, uint16_t
> rx_queue_id)
>  	if (rx_queue_id < dev->data->nb_rx_queues) {
>  		rxq = dev->data->rx_queues[rx_queue_id];
> 
> -		err = ice_switch_rx_queue(hw, rxq->reg_idx, FALSE);
> +		err = ice_switch_rx_queue(hw, rxq->reg_idx, false);
>  		if (err) {
>  			PMD_DRV_LOG(ERR, "Failed to switch RX queue %u
> off",
>  				    rx_queue_id);
> @@ -630,7 +630,7 @@ ice_fdir_rx_queue_start(struct rte_eth_dev *dev,
> uint16_t rx_queue_id)
>  	/* Init the RX tail register. */
>  	ICE_PCI_REG_WRITE(rxq->qrx_tail, rxq->nb_rx_desc - 1);
> 
> -	err = ice_switch_rx_queue(hw, rxq->reg_idx, TRUE);
> +	err = ice_switch_rx_queue(hw, rxq->reg_idx, true);
>  	if (err) {
>  		PMD_DRV_LOG(ERR, "Failed to switch FDIR RX queue %u on",
>  			    rx_queue_id);
> @@ -816,7 +816,7 @@ ice_fdir_rx_queue_stop(struct rte_eth_dev *dev,
> uint16_t rx_queue_id)
> 
>  	rxq = pf->fdir.rxq;
> 
> -	err = ice_switch_rx_queue(hw, rxq->reg_idx, FALSE);
> +	err = ice_switch_rx_queue(hw, rxq->reg_idx, false);
>  	if (err) {
>  		PMD_DRV_LOG(ERR, "Failed to switch FDIR RX queue %u off",
>  			    rx_queue_id);
> @@ -973,7 +973,7 @@ ice_rx_queue_setup(struct rte_eth_dev *dev,
>  	}
> 
>  	ice_reset_rx_queue(rxq);
> -	rxq->q_set = TRUE;
> +	rxq->q_set = true;
>  	dev->data->rx_queues[queue_idx] = rxq;
>  	rxq->rx_rel_mbufs = _ice_rx_queue_release_mbufs;
> 
> @@ -1186,7 +1186,7 @@ ice_tx_queue_setup(struct rte_eth_dev *dev,
>  	}
> 
>  	ice_reset_tx_queue(txq);
> -	txq->q_set = TRUE;
> +	txq->q_set = true;
>  	dev->data->tx_queues[queue_idx] = txq;
>  	txq->tx_rel_mbufs = _ice_tx_queue_release_mbufs;
>  	ice_set_tx_function_flag(dev, txq);
> @@ -2043,7 +2043,7 @@ ice_fdir_setup_tx_resources(struct ice_pf *pf)
>  	 * don't need to allocate software ring and reset for the fdir
>  	 * program queue just set the queue has been configured.
>  	 */
> -	txq->q_set = TRUE;
> +	txq->q_set = true;
>  	pf->fdir.txq = txq;
> 
>  	txq->tx_rel_mbufs = _ice_tx_queue_release_mbufs; @@ -2104,7
> +2104,7 @@ ice_fdir_setup_rx_resources(struct ice_pf *pf)
>  	 * Don't need to allocate software ring and reset for the fdir
>  	 * rx queue, just set the queue has been configured.
>  	 */
> -	rxq->q_set = TRUE;
> +	rxq->q_set = true;
>  	pf->fdir.rxq = rxq;
> 
>  	rxq->rx_rel_mbufs = _ice_rx_queue_release_mbufs;
> --
> 2.17.1



More information about the dev mailing list