Skip to contentSkip to conversation

ethdev: beautify the Rx desc number check indent

PATCH In review Haiyue Wang 2 participants 3 messages Feb 15, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: beautify the Rx desc number check indent

Align to Tx desc number check indent, which may help to understand Rx descriptor limits member in the alignment comparison view. And remove the extra empty line.

---
 lib/ethdev/rte_ethdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
lib/ethdev/rte_ethdev.c +2 -3
index 70c850a2f1..54f1e14c6b 100644
@@ -1799,9 +1799,8 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
 	}
 
 	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
-			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
-			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
-
+	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
+	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
 		RTE_ETHDEV_LOG(ERR,
 			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product of %hu\n",
 			nb_rx_desc, dev_info.rx_desc_lim.nb_max,
Signature · 1 line
2.35.1
#1 lore raw
Quoted 15 lines · Haiyue Wang

Align to Tx desc number check indent, which may help to understand Rx descriptor limits member in the alignment comparison view. And remove the extra empty line.

---
  lib/ethdev/rte_ethdev.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
lib/ethdev/rte_ethdev.c +0 -0
index 70c850a2f1..54f1e14c6b 100644
@@ -1799,9 +1799,8 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
  	}

lib/ethdev/rte_ethdev.c rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, · line 1806

Quoted 10 lines
lib/ethdev/rte_ethdev.c +2 -3
 
  	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
-			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
-			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
-
+	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
+	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
  		RTE_ETHDEV_LOG(ERR,
  			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product of %hu\n",
  			nb_rx_desc, dev_info.rx_desc_lim.nb_max,

Hi Haiyue,

Initial code matches to DPDK coding convention, updated code doesn't:
https://doc.dpdk.org/guides/contributing/coding_style.html

And I don't think syntax only updates are good idea, it corrupts the git history with minimal gain, instead better to fix them while doing a functional changes in those lines.

#2 lore raw
Quoted 33 lines

-----Original Message-----
From: Yigit, Ferruh <[email protected]>
Sent: Tuesday, February 15, 2022 17:20
To: Wang, Haiyue <[email protected]>; [email protected]
Cc: Thomas Monjalon <[email protected]>; Andrew Rybchenko <[email protected]>
Subject: Re: [PATCH v1] ethdev: beautify the Rx desc number check indent

Quoted 14 lines · Haiyue Wang

Align to Tx desc number check indent, which may help to understand Rx descriptor limits member in the alignment comparison view. And remove the extra empty line.

---
  lib/ethdev/rte_ethdev.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
lib/ethdev/rte_ethdev.c +0 -0
index 70c850a2f1..54f1e14c6b 100644

lib/ethdev/rte_ethdev.c rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, · line 1805

Quoted 10 lines
lib/ethdev/rte_ethdev.c +2 -3
@@ -1799,9 +1799,8 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
  	}
 
  	if (nb_rx_desc > dev_info.rx_desc_lim.nb_max ||
-			nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
-			nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
-
+	    nb_rx_desc < dev_info.rx_desc_lim.nb_min ||
+	    nb_rx_desc % dev_info.rx_desc_lim.nb_align != 0) {
  		RTE_ETHDEV_LOG(ERR,
  			"Invalid value for nb_rx_desc(=%hu), should be: <= %hu, >= %hu, and a product

of %hu\n",

Quoted 6 lines

lib/ethdev/rte_ethdev.c rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, · line 1806

Quoted 1 line
lib/ethdev/rte_ethdev.c +0 -0
  			nb_rx_desc, dev_info.rx_desc_lim.nb_max,

Hi Haiyue,

Initial code matches to DPDK coding convention, updated code doesn't:
https://doc.dpdk.org/guides/contributing/coding_style.html

I just read that 'rte_eth_tx_queue_setup' does it as above. ;-)

Quoted 5 lines

And I don't think syntax only updates are good idea, it corrupts the git history with minimal gain, instead better to fix them while doing a functional changes in those lines.

Got it.