From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6EC8A04FD; Tue, 14 Jan 2020 08:42:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C09221C241; Tue, 14 Jan 2020 08:42:12 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E949F1C22A for ; Tue, 14 Jan 2020 08:42:10 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 23:42:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,432,1571727600"; d="scan'208";a="217660390" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga008.jf.intel.com with ESMTP; 13 Jan 2020 23:42:09 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jan 2020 23:42:03 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 13 Jan 2020 23:42:02 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.30]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Tue, 14 Jan 2020 15:42:00 +0800 From: "Yang, Qiming" To: "Wang, Haiyue" , "dev@dpdk.org" , "Ye, Xiaolong" , "Zhang, Qi Z" Thread-Topic: [PATCH v1 1/2] net/iavf: unify the bool type value Thread-Index: AQHVypuo+FLndvQbZUSfsEsupMjocqfpxvLg Date: Tue, 14 Jan 2020 07:42:00 +0000 Message-ID: References: <20200114052258.78791-1-haiyue.wang@intel.com> In-Reply-To: <20200114052258.78791-1-haiyue.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZmNhNGNjZTItZWIwYS00ODJkLTg4MDEtZWNmNTRkZWU0NzM5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiU0dzc1VkaHBwY29xV0xMSHBVNlNvbFp5UmZtdGhXdDgyWVRDVHFTSGZvWmRFa3o0aEVKSkl4aWZzV3ZaQ1B5NCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v1 1/2] net/iavf: unify the bool type value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Wang, Haiyue > Sent: Tuesday, January 14, 2020 1:23 PM > To: dev@dpdk.org; Ye, Xiaolong ; Zhang, Qi Z > ; Yang, Qiming > Cc: Wang, Haiyue > Subject: [PATCH v1 1/2] net/iavf: unify the bool type value >=20 > Replaces the redefined TRUE and FALSE values with standard ones to match = the > 'bool' type definition. >=20 > Signed-off-by: Haiyue Wang Acked-by: Qiming Yang > --- > drivers/net/iavf/iavf_ethdev.c | 31 ++++++++++++++++--------------- > drivers/net/iavf/iavf_rxtx.c | 34 +++++++++++++++++----------------- > 2 files changed, 33 insertions(+), 32 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethde= v.c index > f69c50df5..34913f9c4 100644 > --- a/drivers/net/iavf/iavf_ethdev.c > +++ b/drivers/net/iavf/iavf_ethdev.c > @@ -454,7 +454,7 @@ iavf_dev_start(struct rte_eth_dev *dev) > } >=20 > /* Set all mac addrs */ > - iavf_add_del_all_mac_addr(adapter, TRUE); > + iavf_add_del_all_mac_addr(adapter, true); >=20 > if (iavf_start_queues(dev) !=3D 0) { > PMD_DRV_LOG(ERR, "enable queues failed"); @@ -464,7 > +464,7 @@ iavf_dev_start(struct rte_eth_dev *dev) > return 0; >=20 > err_mac: > - iavf_add_del_all_mac_addr(adapter, FALSE); > + iavf_add_del_all_mac_addr(adapter, false); > err_queue: > err_rss: > return -1; > @@ -493,7 +493,7 @@ iavf_dev_stop(struct rte_eth_dev *dev) > } >=20 > /* remove all mac addrs */ > - iavf_add_del_all_mac_addr(adapter, FALSE); > + iavf_add_del_all_mac_addr(adapter, false); > adapter->stopped =3D 1; > } >=20 > @@ -648,9 +648,9 @@ iavf_dev_promiscuous_enable(struct rte_eth_dev *dev) > if (vf->promisc_unicast_enabled) > return 0; >=20 > - ret =3D iavf_config_promisc(adapter, TRUE, vf- > >promisc_multicast_enabled); > + ret =3D iavf_config_promisc(adapter, true, > +vf->promisc_multicast_enabled); > if (!ret) > - vf->promisc_unicast_enabled =3D TRUE; > + vf->promisc_unicast_enabled =3D true; > else > ret =3D -EAGAIN; >=20 > @@ -668,9 +668,10 @@ iavf_dev_promiscuous_disable(struct rte_eth_dev > *dev) > if (!vf->promisc_unicast_enabled) > return 0; >=20 > - ret =3D iavf_config_promisc(adapter, FALSE, vf- > >promisc_multicast_enabled); > + ret =3D iavf_config_promisc(adapter, false, > + vf->promisc_multicast_enabled); > if (!ret) > - vf->promisc_unicast_enabled =3D FALSE; > + vf->promisc_unicast_enabled =3D false; > else > ret =3D -EAGAIN; >=20 > @@ -688,9 +689,9 @@ iavf_dev_allmulticast_enable(struct rte_eth_dev *dev) > if (vf->promisc_multicast_enabled) > return 0; >=20 > - ret =3D iavf_config_promisc(adapter, vf->promisc_unicast_enabled, TRUE)= ; > + ret =3D iavf_config_promisc(adapter, vf->promisc_unicast_enabled, true)= ; > if (!ret) > - vf->promisc_multicast_enabled =3D TRUE; > + vf->promisc_multicast_enabled =3D true; > else > ret =3D -EAGAIN; >=20 > @@ -708,9 +709,9 @@ iavf_dev_allmulticast_disable(struct rte_eth_dev *dev= ) > if (!vf->promisc_multicast_enabled) > return 0; >=20 > - ret =3D iavf_config_promisc(adapter, vf->promisc_unicast_enabled, > FALSE); > + ret =3D iavf_config_promisc(adapter, vf->promisc_unicast_enabled, > +false); > if (!ret) > - vf->promisc_multicast_enabled =3D FALSE; > + vf->promisc_multicast_enabled =3D false; > else > ret =3D -EAGAIN; >=20 > @@ -732,7 +733,7 @@ iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct > rte_ether_addr *addr, > return -EINVAL; > } >=20 > - err =3D iavf_add_del_eth_addr(adapter, addr, TRUE); > + err =3D iavf_add_del_eth_addr(adapter, addr, true); > if (err) { > PMD_DRV_LOG(ERR, "fail to add MAC address"); > return -EIO; > @@ -754,7 +755,7 @@ iavf_dev_del_mac_addr(struct rte_eth_dev *dev, > uint32_t index) >=20 > addr =3D &dev->data->mac_addrs[index]; >=20 > - err =3D iavf_add_del_eth_addr(adapter, addr, FALSE); > + err =3D iavf_add_del_eth_addr(adapter, addr, false); > if (err) > PMD_DRV_LOG(ERR, "fail to delete MAC address"); >=20 > @@ -979,7 +980,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev > *dev, > if (rte_is_valid_assigned_ether_addr(perm_addr)) > return -EPERM; >=20 > - ret =3D iavf_add_del_eth_addr(adapter, old_addr, FALSE); > + ret =3D iavf_add_del_eth_addr(adapter, old_addr, false); > if (ret) > PMD_DRV_LOG(ERR, "Fail to delete old MAC:" > " %02X:%02X:%02X:%02X:%02X:%02X", @@ -990,7 > +991,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, > old_addr->addr_bytes[4], > old_addr->addr_bytes[5]); >=20 > - ret =3D iavf_add_del_eth_addr(adapter, mac_addr, TRUE); > + ret =3D iavf_add_del_eth_addr(adapter, mac_addr, true); > if (ret) > PMD_DRV_LOG(ERR, "Fail to add new MAC:" > " %02X:%02X:%02X:%02X:%02X:%02X", diff --git > a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index > 067290db4..85d9a8e3b 100644 > --- a/drivers/net/iavf/iavf_rxtx.c > +++ b/drivers/net/iavf/iavf_rxtx.c > @@ -95,11 +95,11 @@ check_rx_vec_allow(struct iavf_rx_queue *rxq) > if (rxq->rx_free_thresh >=3D IAVF_VPMD_RX_MAX_BURST && > rxq->nb_rx_desc % rxq->rx_free_thresh =3D=3D 0) { > PMD_INIT_LOG(DEBUG, "Vector Rx can be enabled on this > rxq."); > - return TRUE; > + return true; > } >=20 > PMD_INIT_LOG(DEBUG, "Vector Rx cannot be enabled on this rxq."); > - return FALSE; > + return false; > } >=20 > static inline bool > @@ -109,29 +109,29 @@ check_tx_vec_allow(struct iavf_tx_queue *txq) > txq->rs_thresh >=3D IAVF_VPMD_TX_MAX_BURST && > txq->rs_thresh <=3D IAVF_VPMD_TX_MAX_FREE_BUF) { > PMD_INIT_LOG(DEBUG, "Vector tx can be enabled on this txq."); > - return TRUE; > + return true; > } > PMD_INIT_LOG(DEBUG, "Vector Tx cannot be enabled on this txq."); > - return FALSE; > + return false; > } >=20 > static inline bool > check_rx_bulk_allow(struct iavf_rx_queue *rxq) { > - int ret =3D TRUE; > + int ret =3D true; >=20 > if (!(rxq->rx_free_thresh >=3D IAVF_RX_MAX_BURST)) { > PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: " > "rxq->rx_free_thresh=3D%d, " > "IAVF_RX_MAX_BURST=3D%d", > rxq->rx_free_thresh, IAVF_RX_MAX_BURST); > - ret =3D FALSE; > + ret =3D false; > } else if (rxq->nb_rx_desc % rxq->rx_free_thresh !=3D 0) { > PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions: " > "rxq->nb_rx_desc=3D%d, " > "rxq->rx_free_thresh=3D%d", > rxq->nb_rx_desc, rxq->rx_free_thresh); > - ret =3D FALSE; > + ret =3D false; > } > return ret; > } > @@ -390,12 +390,12 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, >=20 > rxq->mz =3D mz; > reset_rx_queue(rxq); > - rxq->q_set =3D TRUE; > + rxq->q_set =3D true; > dev->data->rx_queues[queue_idx] =3D rxq; > rxq->qrx_tail =3D hw->hw_addr + IAVF_QRX_TAIL1(rxq->queue_id); > rxq->ops =3D &def_rxq_ops; >=20 > - if (check_rx_bulk_allow(rxq) =3D=3D TRUE) { > + if (check_rx_bulk_allow(rxq) =3D=3D true) { > PMD_INIT_LOG(DEBUG, "Rx Burst Bulk Alloc Preconditions are " > "satisfied. Rx Burst Bulk Alloc function will be " > "used on port=3D%d, queue=3D%d.", > @@ -408,7 +408,7 @@ iavf_dev_rx_queue_setup(struct rte_eth_dev *dev, > uint16_t queue_idx, > ad->rx_bulk_alloc_allowed =3D false; > } >=20 > - if (check_rx_vec_allow(rxq) =3D=3D FALSE) > + if (check_rx_vec_allow(rxq) =3D=3D false) > ad->rx_vec_allowed =3D false; >=20 > return 0; > @@ -500,12 +500,12 @@ iavf_dev_tx_queue_setup(struct rte_eth_dev *dev, >=20 > txq->mz =3D mz; > reset_tx_queue(txq); > - txq->q_set =3D TRUE; > + txq->q_set =3D true; > dev->data->tx_queues[queue_idx] =3D txq; > txq->qtx_tail =3D hw->hw_addr + IAVF_QTX_TAIL1(queue_idx); > txq->ops =3D &def_txq_ops; >=20 > - if (check_tx_vec_allow(txq) =3D=3D FALSE) { > + if (check_tx_vec_allow(txq) =3D=3D false) { > struct iavf_adapter *ad =3D > IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data- > >dev_private); > ad->tx_vec_allowed =3D false; > @@ -543,7 +543,7 @@ iavf_dev_rx_queue_start(struct rte_eth_dev *dev, > uint16_t rx_queue_id) > IAVF_WRITE_FLUSH(hw); >=20 > /* Ready to switch the queue on */ > - err =3D iavf_switch_queue(adapter, rx_queue_id, TRUE, TRUE); > + err =3D iavf_switch_queue(adapter, rx_queue_id, true, true); > if (err) > PMD_DRV_LOG(ERR, "Failed to switch RX queue %u on", > rx_queue_id); > @@ -575,7 +575,7 @@ iavf_dev_tx_queue_start(struct rte_eth_dev *dev, > uint16_t tx_queue_id) > IAVF_WRITE_FLUSH(hw); >=20 > /* Ready to switch the queue on */ > - err =3D iavf_switch_queue(adapter, tx_queue_id, FALSE, TRUE); > + err =3D iavf_switch_queue(adapter, tx_queue_id, false, true); >=20 > if (err) > PMD_DRV_LOG(ERR, "Failed to switch TX queue %u on", @@ - > 600,7 +600,7 @@ iavf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t > rx_queue_id) > if (rx_queue_id >=3D dev->data->nb_rx_queues) > return -EINVAL; >=20 > - err =3D iavf_switch_queue(adapter, rx_queue_id, TRUE, FALSE); > + err =3D iavf_switch_queue(adapter, rx_queue_id, true, false); > if (err) { > PMD_DRV_LOG(ERR, "Failed to switch RX queue %u off", > rx_queue_id); > @@ -628,7 +628,7 @@ iavf_dev_tx_queue_stop(struct rte_eth_dev *dev, > uint16_t tx_queue_id) > if (tx_queue_id >=3D dev->data->nb_tx_queues) > return -EINVAL; >=20 > - err =3D iavf_switch_queue(adapter, tx_queue_id, FALSE, FALSE); > + err =3D iavf_switch_queue(adapter, tx_queue_id, false, false); > if (err) { > PMD_DRV_LOG(ERR, "Failed to switch TX queue %u off", > tx_queue_id); > @@ -1815,7 +1815,7 @@ iavf_dev_rxq_info_get(struct rte_eth_dev *dev, > uint16_t queue_id, > qinfo->nb_desc =3D rxq->nb_rx_desc; >=20 > qinfo->conf.rx_free_thresh =3D rxq->rx_free_thresh; > - qinfo->conf.rx_drop_en =3D TRUE; > + qinfo->conf.rx_drop_en =3D true; > qinfo->conf.rx_deferred_start =3D rxq->rx_deferred_start; } >=20 > -- > 2.17.1