Skip to contentSkip to conversation

ethdev: queue rate parameter changed from 16b to 32b

PATCH Superseded [email protected] 2 participants 8 messages Sep 23, 2022 – Oct 4, 2022 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ethdev: queue rate parameter changed from 16b to 32b

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

Change-Id I7115c22a4dfdda84d820b221bf33839a7b57f2cd
---
 app/test-pmd/cmdline.c            |  8 ++++----
 app/test-pmd/config.c             |  4 ++--
 app/test-pmd/testpmd.h            |  4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.c   |  4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h   |  2 +-
 drivers/net/cnxk/cnxk_ethdev.h    | 19 ++++++++-----------
 drivers/net/cnxk/cnxk_tm.c        |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c  |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h  |  4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c |  2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h |  2 +-
 drivers/net/txgbe/txgbe_ethdev.c  |  2 +-
 drivers/net/txgbe/txgbe_ethdev.h  |  2 +-
 lib/ethdev/ethdev_driver.h        |  2 +-
 lib/ethdev/rte_ethdev.c           |  2 +-
 lib/ethdev/rte_ethdev.h           |  2 +-
 16 files changed, 32 insertions(+), 35 deletions(-)
app/test-pmd/cmdline.c +4 -4
index 51321de..adfdc1d 100644
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result,
@@ -8147,7 +8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 
 static cmdline_parse_inst_t cmd_queue_rate_limit = {
 	.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
 	cmdline_fixed_string_t vf;
 	uint8_t vf_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 	cmdline_fixed_string_t q_msk;
 	uint64_t q_msk_val;
 };
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
 	TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
 				q_msk, "queue_mask");
app/test-pmd/config.c +2 -2
index c90cdfe..6dd543d 100644
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate)
 {
 	int diag;
 	struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, uint64_t q_msk)
 {
 	int diag = -ENOTSUP;
 
app/test-pmd/testpmd.h +2 -2
index ddf5e21..0af3aa1 100644
@@ -1097,8 +1097,8 @@ void port_rss_reta_info(portid_t port_id,
 	       uint16_t nb_rx_desc, unsigned int socket_id,
 	       struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 
-int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
-int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
+int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate);
+int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate,
 				uint64_t q_msk);
 
 int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,
drivers/net/bnxt/rte_pmd_bnxt.c +2 -2
index 77ecbef..4dc38a2 100644
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 }
 
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *eth_dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
 	uint64_t idx;
 	int rc;
 
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
index 86b8d71..174c18a 100644
@@ -184,7 +184,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk);
+				uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Get VF's statistics
drivers/net/cnxk/cnxk_ethdev.h +8 -11
index c09e9bf..17c820a 100644
@@ -557,17 +557,14 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,
 
 uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);
 int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);
-int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				     uint16_t queue_idx, uint16_t tx_rate);
-int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
-			      int mark_yellow, int mark_red,
-			      struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green,
-			    int mark_yellow, int mark_red,
-			    struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green,
-			     int mark_yellow, int mark_red,
-			     struct rte_tm_error *error);
+int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				     uint32_t tx_rate);
+int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			      int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			    int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			     int mark_red, struct rte_tm_error *error);
 
 /* MTR */
 int cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops);
drivers/net/cnxk/cnxk_tm.c +2 -2
index d45e70a..a36f45d 100644
@@ -750,8 +750,8 @@ struct rte_tm_ops cnxk_tm_ops = {
 }
 
 int
-cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				 uint16_t queue_idx, uint16_t tx_rate_mbps)
+cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				 uint32_t tx_rate_mbps)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	uint64_t tx_rate = tx_rate_mbps * (uint64_t)1E6;
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 1dfad0e..9ff8ee0 100644
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
 int
 ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)
 {
 	struct ixgbe_hw *hw;
 	struct ixgbe_vf_info *vfinfo;
@@ -6090,7 +6090,7 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 int
 ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t rf_dec, rf_int;
drivers/net/ixgbe/ixgbe_ethdev.h +2 -2
index 0773a7e..b4db3f4 100644
@@ -753,13 +753,13 @@ void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
 
 int ixgbe_vt_check(struct ixgbe_hw *hw);
 int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			    uint16_t tx_rate, uint64_t q_msk);
+			    uint32_t tx_rate, uint64_t q_msk);
 bool is_ixgbe_supported(struct rte_eth_dev *dev);
 int ixgbe_tm_ops_get(struct rte_eth_dev *dev, void *ops);
 void ixgbe_tm_conf_init(struct rte_eth_dev *dev);
 void ixgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int ixgbe_rss_conf_init(struct ixgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int ixgbe_action_rss_same(const struct rte_flow_action_rss *comp,
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
index 9729f85..4ff7f37 100644
@@ -498,7 +498,7 @@
 
 int
 rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *dev;
 
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
index 426fe58..7ca1126 100644
@@ -380,7 +380,7 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				     uint16_t tx_rate, uint64_t q_msk);
+				     uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Set all the TCs' bandwidth weight.
drivers/net/txgbe/txgbe_ethdev.c +1 -1
index 4422472..86ef979 100644
@@ -3764,7 +3764,7 @@ static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 
 int
 txgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	uint32_t bcnrc_val;
drivers/net/txgbe/txgbe_ethdev.h +1 -1
index e425ab4..5171a6c 100644
@@ -586,7 +586,7 @@ int txgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
 void txgbe_tm_conf_init(struct rte_eth_dev *dev);
 void txgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int txgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int txgbe_rss_conf_init(struct txgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int txgbe_action_rss_same(const struct rte_flow_action_rss *comp,
lib/ethdev/ethdev_driver.h +1 -1
index a0e0b2a..a89450c 100644
@@ -598,7 +598,7 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 /** @internal Set queue Tx rate. */
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
-				uint16_t tx_rate);
+				uint32_t tx_rate);
 
 /** @internal Add tunneling UDP port. */
 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
lib/ethdev/rte_ethdev.c +1 -1
index 1979dc0..4b11dae 100644
@@ -4388,7 +4388,7 @@ enum {
 }
 
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-					uint16_t tx_rate)
+					uint32_t tx_rate)
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
lib/ethdev/rte_ethdev.h +1 -1
index b62ac5b..7149dd7 100644
@@ -4165,7 +4165,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-			uint16_t tx_rate);
+			uint32_t tx_rate);
 
 /**
  * Configuration of Receive Side Scaling hash computation of Ethernet device.
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH v2 1/1 ethdev: queue rate parameter changed from 16b to 32b

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

---

v2: Fixed checkpatch warnings

 app/test-pmd/cmdline.c            |  8 ++++----
 app/test-pmd/config.c             |  4 ++--
 app/test-pmd/testpmd.h            |  4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.c   |  4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h   |  2 +-
 drivers/net/cnxk/cnxk_ethdev.h    | 19 ++++++++-----------
 drivers/net/cnxk/cnxk_tm.c        |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.c  |  4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h  |  4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c |  2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h |  2 +-
 drivers/net/txgbe/txgbe_ethdev.c  |  2 +-
 drivers/net/txgbe/txgbe_ethdev.h  |  2 +-
 lib/ethdev/ethdev_driver.h        |  2 +-
 lib/ethdev/rte_ethdev.c           |  2 +-
 lib/ethdev/rte_ethdev.h           |  2 +-
 16 files changed, 32 insertions(+), 35 deletions(-)
app/test-pmd/cmdline.c +4 -4
index 51321de..adfdc1d 100644
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result,
@@ -8147,7 +8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 
 static cmdline_parse_inst_t cmd_queue_rate_limit = {
 	.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
 	cmdline_fixed_string_t vf;
 	uint8_t vf_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 	cmdline_fixed_string_t q_msk;
 	uint64_t q_msk_val;
 };
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
 	TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
 				q_msk, "queue_mask");
app/test-pmd/config.c +2 -2
index c90cdfe..6dd543d 100644
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate)
 {
 	int diag;
 	struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, uint64_t q_msk)
 {
 	int diag = -ENOTSUP;
 
app/test-pmd/testpmd.h +2 -2
index ddf5e21..0af3aa1 100644
@@ -1097,8 +1097,8 @@ void port_rss_reta_info(portid_t port_id,
 	       uint16_t nb_rx_desc, unsigned int socket_id,
 	       struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 
-int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
-int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
+int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate);
+int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate,
 				uint64_t q_msk);
 
 int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,
drivers/net/bnxt/rte_pmd_bnxt.c +2 -2
index 77ecbef..4dc38a2 100644
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 }
 
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *eth_dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
 	uint64_t idx;
 	int rc;
 
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
index 86b8d71..174c18a 100644
@@ -184,7 +184,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk);
+				uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Get VF's statistics
drivers/net/cnxk/cnxk_ethdev.h +8 -11
index c09e9bf..17c820a 100644
@@ -557,17 +557,14 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,
 
 uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);
 int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);
-int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				     uint16_t queue_idx, uint16_t tx_rate);
-int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
-			      int mark_yellow, int mark_red,
-			      struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green,
-			    int mark_yellow, int mark_red,
-			    struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green,
-			     int mark_yellow, int mark_red,
-			     struct rte_tm_error *error);
+int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				     uint32_t tx_rate);
+int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			      int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			    int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			     int mark_red, struct rte_tm_error *error);
 
 /* MTR */
 int cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops);
drivers/net/cnxk/cnxk_tm.c +2 -2
index d45e70a..a36f45d 100644
@@ -750,8 +750,8 @@ struct rte_tm_ops cnxk_tm_ops = {
 }
 
 int
-cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				 uint16_t queue_idx, uint16_t tx_rate_mbps)
+cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				 uint32_t tx_rate_mbps)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	uint64_t tx_rate = tx_rate_mbps * (uint64_t)1E6;
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 1dfad0e..9ff8ee0 100644
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
 int
 ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)
 {
 	struct ixgbe_hw *hw;
 	struct ixgbe_vf_info *vfinfo;
@@ -6090,7 +6090,7 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 int
 ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t rf_dec, rf_int;
drivers/net/ixgbe/ixgbe_ethdev.h +2 -2
index 0773a7e..b4db3f4 100644
@@ -753,13 +753,13 @@ void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
 
 int ixgbe_vt_check(struct ixgbe_hw *hw);
 int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			    uint16_t tx_rate, uint64_t q_msk);
+			    uint32_t tx_rate, uint64_t q_msk);
 bool is_ixgbe_supported(struct rte_eth_dev *dev);
 int ixgbe_tm_ops_get(struct rte_eth_dev *dev, void *ops);
 void ixgbe_tm_conf_init(struct rte_eth_dev *dev);
 void ixgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int ixgbe_rss_conf_init(struct ixgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int ixgbe_action_rss_same(const struct rte_flow_action_rss *comp,
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
index 9729f85..4ff7f37 100644
@@ -498,7 +498,7 @@
 
 int
 rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *dev;
 
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
index 426fe58..7ca1126 100644
@@ -380,7 +380,7 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				     uint16_t tx_rate, uint64_t q_msk);
+				     uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Set all the TCs' bandwidth weight.
drivers/net/txgbe/txgbe_ethdev.c +1 -1
index 4422472..86ef979 100644
@@ -3764,7 +3764,7 @@ static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 
 int
 txgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	uint32_t bcnrc_val;
drivers/net/txgbe/txgbe_ethdev.h +1 -1
index e425ab4..5171a6c 100644
@@ -586,7 +586,7 @@ int txgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
 void txgbe_tm_conf_init(struct rte_eth_dev *dev);
 void txgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int txgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int txgbe_rss_conf_init(struct txgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int txgbe_action_rss_same(const struct rte_flow_action_rss *comp,
lib/ethdev/ethdev_driver.h +1 -1
index a0e0b2a..a89450c 100644
@@ -598,7 +598,7 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 /** @internal Set queue Tx rate. */
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
-				uint16_t tx_rate);
+				uint32_t tx_rate);
 
 /** @internal Add tunneling UDP port. */
 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
lib/ethdev/rte_ethdev.c +1 -1
index 1979dc0..4b11dae 100644
@@ -4388,7 +4388,7 @@ enum {
 }
 
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-					uint16_t tx_rate)
+					uint32_t tx_rate)
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
lib/ethdev/rte_ethdev.h +1 -1
index b62ac5b..7149dd7 100644
@@ -4165,7 +4165,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-			uint16_t tx_rate);
+			uint32_t tx_rate);
 
 /**
  * Configuration of Receive Side Scaling hash computation of Ethernet device.
Signature · 1 line
1.8.3.1
#2 lore raw
Quoted 6 lines · On 9/23/22 16:45, [email protected] wrote:

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

Overall LGTM, but please update release notes and cleanup deprecation in the next version.

However, the patch requires Acks from bnxt and ixgbe maintainers.

drivers/net/bnxt/rte_pmd_bnxt.c int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, · line 175

Quoted 10 lines
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
index 77ecbef..4dc38a2 100644
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
  }
 
  int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)

Deprecateion announces rte_eth_set_queue_rate_limit() changes, but above is a separate API which is not directly related. I'm OK with the change, but it requires maintainer Ack.

Quoted 9 lines
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
  {
  	struct rte_eth_dev *eth_dev;
  	struct rte_eth_dev_info dev_info;
  	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
  	uint64_t idx;
  	int rc;
 

[snip]

Quoted 9 lines
drivers/net/cnxk/cnxk_ethdev.h +0 -1
index c09e9bf..17c820a 100644
@@ -557,17 +557,14 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,
 
  uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);
  int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);
-int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,

drivers/net/cnxk/cnxk_ethdev.h int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev, · line 570

Quoted 10 lines
drivers/net/cnxk/cnxk_ethdev.h +0 -10
-				     uint16_t queue_idx, uint16_t tx_rate);
-int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
-			      int mark_yellow, int mark_red,
-			      struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green,
-			    int mark_yellow, int mark_red,
-			    struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green,
-			     int mark_yellow, int mark_red,
-			     struct rte_tm_error *error);

Above changes for 3 functions look unrelated. Please, avoid it.

Quoted 13 lines
drivers/net/cnxk/cnxk_ethdev.h +8 -0
+int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				     uint32_t tx_rate);
+int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			      int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			    int mark_red, struct rte_tm_error *error);
+int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			     int mark_red, struct rte_tm_error *error);
 
  /* MTR */
  int cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops);
drivers/net/cnxk/cnxk_tm.c +0 -0
index d45e70a..a36f45d 100644

[snip]

drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev) · line 2478

Quoted 10 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
index 1dfad0e..9ff8ee0 100644
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
  int
  ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)

Requires Ack from ixgbe maintainer

[snip]

#3 lore raw

Thanks Andrew for your comments. Sent v3 with your review comments.

Thanks,
Satha.

-----Original Message-----
From: Andrew Rybchenko <[email protected]>
Sent: Monday, September 26, 2022 6:48 PM
To: Satha Koteswara Rao Kottidi <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Qiming Yang <[email protected]>; Wenjun Wu <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [EXT] Re: [PATCH v2] ethdev: queue rate parameter changed from 16b to 32b

External Email

----------------------------------------------------------------------

Quoted 6 lines · On 9/23/22 16:45, [email protected] wrote:

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

Overall LGTM, but please update release notes and cleanup deprecation in the next version.

However, the patch requires Acks from bnxt and ixgbe maintainers.

drivers/net/bnxt/rte_pmd_bnxt.c int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, · line 175

Quoted 10 lines
(quoted diff) +0 -0

b/drivers/net/bnxt/rte_pmd_bnxt.c index 77ecbef..4dc38a2 100644

drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
  }
 
  int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)

Deprecateion announces rte_eth_set_queue_rate_limit() changes, but above is a separate API which is not directly related. I'm OK with the change, but it requires maintainer Ack.

Quoted 9 lines
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
  {
  	struct rte_eth_dev *eth_dev;
  	struct rte_eth_dev_info dev_info;
  	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
  	uint64_t idx;
  	int rc;
 

[snip]

Quoted 10 lines
(quoted diff) +0 -0

b/drivers/net/cnxk/cnxk_ethdev.h index c09e9bf..17c820a 100644

drivers/net/cnxk/cnxk_ethdev.h +0 -1
@@ -557,17 +557,14 @@ int cnxk_nix_timesync_write_time(struct 
 rte_eth_dev *eth_dev,
 
  uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);
  int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops); 
-int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,

drivers/net/cnxk/cnxk_ethdev.h int cnxk_nix_timesync_write_time(struct · line 571

Quoted 10 lines
drivers/net/cnxk/cnxk_ethdev.h +0 -10
-				     uint16_t queue_idx, uint16_t tx_rate);
-int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
-			      int mark_yellow, int mark_red,
-			      struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green,
-			    int mark_yellow, int mark_red,
-			    struct rte_tm_error *error);
-int cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green,
-			     int mark_yellow, int mark_red,
-			     struct rte_tm_error *error);

Above changes for 3 functions look unrelated. Please, avoid it.

Quoted 13 lines
drivers/net/cnxk/cnxk_ethdev.h +8 -0
+int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev, uint16_t queue_idx,
+				     uint32_t tx_rate);
+int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			      int mark_red, struct rte_tm_error *error); int 
+cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			    int mark_red, struct rte_tm_error *error); int 
+cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green, int mark_yellow,
+			     int mark_red, struct rte_tm_error *error);
 
  /* MTR */

int cnxk_nix_mtr_ops_get(struct rte_eth_dev *dev, void *ops); diff
--git a/drivers/net/cnxk/cnxk_tm.c b/drivers/net/cnxk/cnxk_tm.c index d45e70a..a36f45d 100644

[snip]

drivers/net/ixgbe/ixgbe_ethdev.c static int eth_ixgbevf_pci_remove(struct · line 2479

Quoted 12 lines
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
index 1dfad0e..9ff8ee0 100644
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct 
 rte_pci_device *pci_dev)
 
  int
  ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)

Requires Ack from ixgbe maintainer

[snip]

#4 lore raw

PATCH v3 1/1 ethdev: queue rate parameter changed from 16b to 32b

In reply to [email protected]

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

---

v2: Fixed checkpatch warnings

v3: updated release notes, cleanup deprecation, addressed review comments

 app/test-pmd/cmdline.c                 | 8 ++++----
 app/test-pmd/config.c                  | 4 ++--
 app/test-pmd/testpmd.h                 | 4 ++--
 doc/guides/rel_notes/deprecation.rst   | 5 -----
 doc/guides/rel_notes/release_22_11.rst | 3 +++
 drivers/net/bnxt/rte_pmd_bnxt.c        | 4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h        | 2 +-
 drivers/net/cnxk/cnxk_ethdev.h         | 2 +-
 drivers/net/cnxk/cnxk_tm.c             | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h       | 4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c      | 2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h      | 2 +-
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 drivers/net/txgbe/txgbe_ethdev.h       | 2 +-
 lib/ethdev/ethdev_driver.h             | 2 +-
 lib/ethdev/rte_ethdev.c                | 2 +-
 lib/ethdev/rte_ethdev.h                | 2 +-
 18 files changed, 27 insertions(+), 29 deletions(-)
app/test-pmd/cmdline.c +4 -4
index 51321de..adfdc1d 100644
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result,
@@ -8147,7 +8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 
 static cmdline_parse_inst_t cmd_queue_rate_limit = {
 	.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
 	cmdline_fixed_string_t vf;
 	uint8_t vf_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 	cmdline_fixed_string_t q_msk;
 	uint64_t q_msk_val;
 };
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
 				rate, "rate");
 static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
 	TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
-				rate_num, RTE_UINT16);
+				rate_num, RTE_UINT32);
 static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
 	TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
 				q_msk, "queue_mask");
app/test-pmd/config.c +2 -2
index c90cdfe..6dd543d 100644
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate)
 {
 	int diag;
 	struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {
 }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, uint64_t q_msk)
 {
 	int diag = -ENOTSUP;
 
app/test-pmd/testpmd.h +2 -2
index ddf5e21..0af3aa1 100644
@@ -1097,8 +1097,8 @@ void port_rss_reta_info(portid_t port_id,
 	       uint16_t nb_rx_desc, unsigned int socket_id,
 	       struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 
-int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate);
-int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
+int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t rate);
+int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate,
 				uint64_t q_msk);
 
 int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id,
doc/guides/rel_notes/deprecation.rst +0 -5
index e0fa5ef..9292080 100644
@@ -87,11 +87,6 @@ Deprecation Notices
   us extending existing enum/define.
   One solution can be using a fixed size array instead of ``.*MAX.*`` value.
 
-* ethdev: The function ``rte_eth_set_queue_rate_limit`` takes ``rate`` in Mbps.
-  The queue rate is limited to 64 Gbps because declared as ``uint16_t``.
-  The ``rate`` parameter will be modified to ``uint32_t`` in DPDK 22.11
-  so that it can work for more than 64 Gbps.
-
 * ethdev: Since no single PMD supports ``RTE_ETH_RX_OFFLOAD_HEADER_SPLIT``
   offload and the ``split_hdr_size`` field in structure ``rte_eth_rxmode``
   to enable per-port header split, they will be removed in DPDK 22.11.
doc/guides/rel_notes/release_22_11.rst +3 -0
index 2e076ba..3c7e471 100644
@@ -129,6 +129,9 @@ API Changes
   configuration (``dev_conf.fdir_conf``). Moved corresponding structures
   to internal API since some drivers still use it internally.
 
+* ethdev: The type of parameter ``rate`` of the ``rte_eth_set_queue_rate_limit``
+  changed from ``uint16_t`` to ``uint32_t`` to support more than 64 Gbps.
+
 
 ABI Changes
 -----------
drivers/net/bnxt/rte_pmd_bnxt.c +2 -2
index 77ecbef..4dc38a2 100644
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,
 }
 
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *eth_dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
 	uint64_t idx;
 	int rc;
 
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
index 86b8d71..174c18a 100644
@@ -184,7 +184,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk);
+				uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Get VF's statistics
drivers/net/cnxk/cnxk_ethdev.h +1 -1
index c09e9bf..5204c46 100644
@@ -558,7 +558,7 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,
 uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);
 int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);
 int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				     uint16_t queue_idx, uint16_t tx_rate);
+				     uint16_t queue_idx, uint32_t tx_rate);
 int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
 			      int mark_yellow, int mark_red,
 			      struct rte_tm_error *error);
drivers/net/cnxk/cnxk_tm.c +1 -1
index d45e70a..9d8cd3f 100644
@@ -751,7 +751,7 @@ struct rte_tm_ops cnxk_tm_ops = {
 
 int
 cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				 uint16_t queue_idx, uint16_t tx_rate_mbps)
+				 uint16_t queue_idx, uint32_t tx_rate_mbps)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	uint64_t tx_rate = tx_rate_mbps * (uint64_t)1E6;
drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
index 1dfad0e..9ff8ee0 100644
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
 int
 ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)
 {
 	struct ixgbe_hw *hw;
 	struct ixgbe_vf_info *vfinfo;
@@ -6090,7 +6090,7 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 int
 ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t rf_dec, rf_int;
drivers/net/ixgbe/ixgbe_ethdev.h +2 -2
index 0773a7e..b4db3f4 100644
@@ -753,13 +753,13 @@ void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
 
 int ixgbe_vt_check(struct ixgbe_hw *hw);
 int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			    uint16_t tx_rate, uint64_t q_msk);
+			    uint32_t tx_rate, uint64_t q_msk);
 bool is_ixgbe_supported(struct rte_eth_dev *dev);
 int ixgbe_tm_ops_get(struct rte_eth_dev *dev, void *ops);
 void ixgbe_tm_conf_init(struct rte_eth_dev *dev);
 void ixgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int ixgbe_rss_conf_init(struct ixgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int ixgbe_action_rss_same(const struct rte_flow_action_rss *comp,
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
index 9729f85..4ff7f37 100644
@@ -498,7 +498,7 @@
 
 int
 rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *dev;
 
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
index 426fe58..7ca1126 100644
@@ -380,7 +380,7 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				     uint16_t tx_rate, uint64_t q_msk);
+				     uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Set all the TCs' bandwidth weight.
drivers/net/txgbe/txgbe_ethdev.c +1 -1
index 4422472..86ef979 100644
@@ -3764,7 +3764,7 @@ static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 
 int
 txgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	uint32_t bcnrc_val;
drivers/net/txgbe/txgbe_ethdev.h +1 -1
index e425ab4..5171a6c 100644
@@ -586,7 +586,7 @@ int txgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
 void txgbe_tm_conf_init(struct rte_eth_dev *dev);
 void txgbe_tm_conf_uninit(struct rte_eth_dev *dev);
 int txgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int txgbe_rss_conf_init(struct txgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);
 int txgbe_action_rss_same(const struct rte_flow_action_rss *comp,
lib/ethdev/ethdev_driver.h +1 -1
index a0e0b2a..a89450c 100644
@@ -598,7 +598,7 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 /** @internal Set queue Tx rate. */
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
-				uint16_t tx_rate);
+				uint32_t tx_rate);
 
 /** @internal Add tunneling UDP port. */
 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
lib/ethdev/rte_ethdev.c +1 -1
index 1979dc0..4b11dae 100644
@@ -4388,7 +4388,7 @@ enum {
 }
 
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-					uint16_t tx_rate)
+					uint32_t tx_rate)
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
lib/ethdev/rte_ethdev.h +1 -1
index b62ac5b..7149dd7 100644
@@ -4165,7 +4165,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-			uint16_t tx_rate);
+			uint32_t tx_rate);
 
 /**
  * Configuration of Receive Side Scaling hash computation of Ethernet device.
Signature · 1 line
1.8.3.1
#5 lore raw

Hi All,

Could you please review and provide suggestions if any.

Thanks,
Satha.

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, September 28, 2022 11:22 AM
To: Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ray Kinsella <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Qiming Yang <[email protected]>; Wenjun Wu <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

---

v2: Fixed checkpatch warnings

v3: updated release notes, cleanup deprecation, addressed review comments

 app/test-pmd/cmdline.c                 | 8 ++++----
 app/test-pmd/config.c                  | 4 ++--
 app/test-pmd/testpmd.h                 | 4 ++--
 doc/guides/rel_notes/deprecation.rst   | 5 -----
 doc/guides/rel_notes/release_22_11.rst | 3 +++
 drivers/net/bnxt/rte_pmd_bnxt.c        | 4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h        | 2 +-
 drivers/net/cnxk/cnxk_ethdev.h         | 2 +-
 drivers/net/cnxk/cnxk_tm.c             | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h       | 4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c      | 2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h      | 2 +-
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 drivers/net/txgbe/txgbe_ethdev.h       | 2 +-
 lib/ethdev/ethdev_driver.h             | 2 +-
 lib/ethdev/rte_ethdev.c                | 2 +-
 lib/ethdev/rte_ethdev.h                | 2 +-
 18 files changed, 27 insertions(+), 29 deletions(-)
app/test-pmd/cmdline.c +1 -1
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result, @@ -8147,7 +8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,

rate, "rate");
static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
- rate_num, RTE_UINT16);
+ rate_num, RTE_UINT32);

static cmdline_parse_inst_t cmd_queue_rate_limit = {
.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
cmdline_fixed_string_t vf;
uint8_t vf_num;
cmdline_fixed_string_t rate;
- uint16_t rate_num;
+ uint32_t rate_num;
cmdline_fixed_string_t q_msk;
uint64_t q_msk_val;
};
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
rate, "rate");
static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
- rate_num, RTE_UINT16);
+ rate_num, RTE_UINT32);
static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
q_msk, "queue_mask");

app/test-pmd/config.c +4 -2
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t 
+rate)
 {
 	int diag;
 	struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, 
+uint64_t q_msk)
 {
 	int diag = -ENOTSUP;
 
app/test-pmd/testpmd.h +3 -1
@@ -1097,8 +1097,8 @@ void port_rss_reta_info(portid_t port_id,
 	       uint16_t nb_rx_desc, unsigned int socket_id,
 	       struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 
-int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate); -int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
+int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t 
+rate); int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t 
+rate,
 				uint64_t q_msk);
 

int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id, diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e0fa5ef..9292080 100644

doc/guides/rel_notes/deprecation.rst +0 -5
@@ -87,11 +87,6 @@ Deprecation Notices
   us extending existing enum/define.
   One solution can be using a fixed size array instead of ``.*MAX.*`` value.
 
-* ethdev: The function ``rte_eth_set_queue_rate_limit`` takes ``rate`` in Mbps.
-  The queue rate is limited to 64 Gbps because declared as ``uint16_t``.
-  The ``rate`` parameter will be modified to ``uint32_t`` in DPDK 22.11
-  so that it can work for more than 64 Gbps.
-
 * ethdev: Since no single PMD supports ``RTE_ETH_RX_OFFLOAD_HEADER_SPLIT``
   offload and the ``split_hdr_size`` field in structure ``rte_eth_rxmode``
   to enable per-port header split, they will be removed in DPDK 22.11.
doc/guides/rel_notes/release_22_11.rst +4 -0
index 2e076ba..3c7e471 100644
@@ -129,6 +129,9 @@ API Changes
   configuration (``dev_conf.fdir_conf``). Moved corresponding structures
   to internal API since some drivers still use it internally.
 
+* ethdev: The type of parameter ``rate`` of the 
+``rte_eth_set_queue_rate_limit``
+  changed from ``uint16_t`` to ``uint32_t`` to support more than 64 Gbps.
+
 
 ABI Changes

-----------

drivers/net/bnxt/rte_pmd_bnxt.c +2 -2
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,  }
 
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *eth_dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
 	uint64_t idx;
 	int rc;
 
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
@@ -184,7 +184,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk);
+				uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Get VF's statistics
drivers/net/cnxk/cnxk_ethdev.h +1 -1
@@ -558,7 +558,7 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,  uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);  int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);  int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				     uint16_t queue_idx, uint16_t tx_rate);
+				     uint16_t queue_idx, uint32_t tx_rate);
 int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
 			      int mark_yellow, int mark_red,
 			      struct rte_tm_error *error);
drivers/net/cnxk/cnxk_tm.c +1 -1
@@ -751,7 +751,7 @@ struct rte_tm_ops cnxk_tm_ops = {
 
 int
 cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				 uint16_t queue_idx, uint16_t tx_rate_mbps)
+				 uint16_t queue_idx, uint32_t tx_rate_mbps)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	uint64_t tx_rate = tx_rate_mbps * (uint64_t)1E6; diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c

index 1dfad0e..9ff8ee0 100644

drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
 int
 ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)
 {
 	struct ixgbe_hw *hw;
 	struct ixgbe_vf_info *vfinfo;
@@ -6090,7 +6090,7 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 int
 ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t rf_dec, rf_int;
drivers/net/ixgbe/ixgbe_ethdev.h +2 -2
index 0773a7e..b4db3f4 100644
@@ -753,13 +753,13 @@ void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
 
 int ixgbe_vt_check(struct ixgbe_hw *hw);  int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			    uint16_t tx_rate, uint64_t q_msk);
+			    uint32_t tx_rate, uint64_t q_msk);
 bool is_ixgbe_supported(struct rte_eth_dev *dev);  int ixgbe_tm_ops_get(struct rte_eth_dev *dev, void *ops);  void ixgbe_tm_conf_init(struct rte_eth_dev *dev);  void ixgbe_tm_conf_uninit(struct rte_eth_dev *dev);  int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int ixgbe_rss_conf_init(struct ixgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);  int ixgbe_action_rss_same(const struct rte_flow_action_rss *comp, diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c

index 9729f85..4ff7f37 100644

drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -498,7 +498,7 @@
 
 int
 rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *dev;
 
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
index 426fe58..7ca1126 100644
@@ -380,7 +380,7 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				     uint16_t tx_rate, uint64_t q_msk);
+				     uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Set all the TCs' bandwidth weight.
drivers/net/txgbe/txgbe_ethdev.c +1 -1
index 4422472..86ef979 100644
@@ -3764,7 +3764,7 @@ static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 
 int
 txgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	uint32_t bcnrc_val;
drivers/net/txgbe/txgbe_ethdev.h +5 -5
index e425ab4..5171a6c 100644
@@ -586,7 +586,7 @@ int txgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,  void txgbe_tm_conf_init(struct rte_eth_dev *dev);  void txgbe_tm_conf_uninit(struct rte_eth_dev *dev);  int txgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int txgbe_rss_conf_init(struct txgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);  int txgbe_action_rss_same(const struct rte_flow_action_rss *comp, diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index a0e0b2a..a89450c 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -598,7 +598,7 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 /** @internal Set queue Tx rate. */
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
-				uint16_t tx_rate);
+				uint32_t tx_rate);
 
 /** @internal Add tunneling UDP port. */  typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev, diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 1979dc0..4b11dae 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4388,7 +4388,7 @@ enum {
 }
 
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-					uint16_t tx_rate)
+					uint32_t tx_rate)
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
lib/ethdev/rte_ethdev.h +1 -1
@@ -4165,7 +4165,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-			uint16_t tx_rate);
+			uint32_t tx_rate);
 
 /**
  * Configuration of Receive Side Scaling hash computation of Ethernet device.

--
1.8.3.1

#6 lore raw

Ping

-----Original Message-----
From: Satha Koteswara Rao Kottidi <[email protected]>
Sent: Friday, September 30, 2022 3:27 PM
To: Satha Koteswara Rao Kottidi <[email protected]>; Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ray Kinsella <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Qiming Yang <[email protected]>; Wenjun Wu <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>
Subject: RE: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

Hi All,

Could you please review and provide suggestions if any.

Thanks,
Satha.

-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, September 28, 2022 11:22 AM
To: Aman Singh <[email protected]>; Yuying Zhang <[email protected]>; Ray Kinsella <[email protected]>; Ajit Khaparde <[email protected]>; Somnath Kotur <[email protected]>; Nithin Kumar Dabilpuram <[email protected]>; Kiran Kumar Kokkilagadda <[email protected]>; Sunil Kumar Kori <[email protected]>; Satha Koteswara Rao Kottidi <[email protected]>; Qiming Yang <[email protected]>; Wenjun Wu <[email protected]>; Jiawen Wu <[email protected]>; Jian Wang <[email protected]>; Thomas Monjalon <[email protected]>; Ferruh Yigit <[email protected]>; Andrew Rybchenko <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Jerin Jacob Kollanukkaran <[email protected]>
Subject: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

From: Satha Rao <[email protected]>

The rate parameter modified to uint32_t, so that it can work for more than 64 Gbps.

---

v2: Fixed checkpatch warnings

v3: updated release notes, cleanup deprecation, addressed review comments

 app/test-pmd/cmdline.c                 | 8 ++++----
 app/test-pmd/config.c                  | 4 ++--
 app/test-pmd/testpmd.h                 | 4 ++--
 doc/guides/rel_notes/deprecation.rst   | 5 -----
 doc/guides/rel_notes/release_22_11.rst | 3 +++
 drivers/net/bnxt/rte_pmd_bnxt.c        | 4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h        | 2 +-
 drivers/net/cnxk/cnxk_ethdev.h         | 2 +-
 drivers/net/cnxk/cnxk_tm.c             | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c       | 4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h       | 4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c      | 2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h      | 2 +-
 drivers/net/txgbe/txgbe_ethdev.c       | 2 +-
 drivers/net/txgbe/txgbe_ethdev.h       | 2 +-
 lib/ethdev/ethdev_driver.h             | 2 +-
 lib/ethdev/rte_ethdev.c                | 2 +-
 lib/ethdev/rte_ethdev.h                | 2 +-
 18 files changed, 27 insertions(+), 29 deletions(-)
app/test-pmd/cmdline.c +1 -1
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
 	cmdline_fixed_string_t queue;
 	uint8_t queue_num;
 	cmdline_fixed_string_t rate;
-	uint16_t rate_num;
+	uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result, @@ -8147,7 +8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,

rate, "rate");
static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
- rate_num, RTE_UINT16);
+ rate_num, RTE_UINT32);

static cmdline_parse_inst_t cmd_queue_rate_limit = {
.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
cmdline_fixed_string_t vf;
uint8_t vf_num;
cmdline_fixed_string_t rate;
- uint16_t rate_num;
+ uint32_t rate_num;
cmdline_fixed_string_t q_msk;
uint64_t q_msk_val;
};
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
rate, "rate");
static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
- rate_num, RTE_UINT16);
+ rate_num, RTE_UINT32);
static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
q_msk, "queue_mask");

app/test-pmd/config.c +4 -2
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t
+rate)
 {
 	int diag;
 	struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, 
+uint64_t q_msk)
 {
 	int diag = -ENOTSUP;
 
app/test-pmd/testpmd.h +3 -1
@@ -1097,8 +1097,8 @@ void port_rss_reta_info(portid_t port_id,
 	       uint16_t nb_rx_desc, unsigned int socket_id,
 	       struct rte_eth_rxconf *rx_conf, struct rte_mempool *mp);
 
-int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate); -int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
+int set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t 
+rate); int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t 
+rate,
 				uint64_t q_msk);
 

int set_rxq_avail_thresh(portid_t port_id, uint16_t queue_id, diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index e0fa5ef..9292080 100644

doc/guides/rel_notes/deprecation.rst +0 -5
@@ -87,11 +87,6 @@ Deprecation Notices
   us extending existing enum/define.
   One solution can be using a fixed size array instead of ``.*MAX.*`` value.
 
-* ethdev: The function ``rte_eth_set_queue_rate_limit`` takes ``rate`` in Mbps.
-  The queue rate is limited to 64 Gbps because declared as ``uint16_t``.
-  The ``rate`` parameter will be modified to ``uint32_t`` in DPDK 22.11
-  so that it can work for more than 64 Gbps.
-
 * ethdev: Since no single PMD supports ``RTE_ETH_RX_OFFLOAD_HEADER_SPLIT``
   offload and the ``split_hdr_size`` field in structure ``rte_eth_rxmode``
   to enable per-port header split, they will be removed in DPDK 22.11.
doc/guides/rel_notes/release_22_11.rst +4 -0
index 2e076ba..3c7e471 100644
@@ -129,6 +129,9 @@ API Changes
   configuration (``dev_conf.fdir_conf``). Moved corresponding structures
   to internal API since some drivers still use it internally.
 
+* ethdev: The type of parameter ``rate`` of the 
+``rte_eth_set_queue_rate_limit``
+  changed from ``uint16_t`` to ``uint32_t`` to support more than 64 Gbps.
+
 
 ABI Changes

-----------

drivers/net/bnxt/rte_pmd_bnxt.c +2 -2
@@ -172,12 +172,12 @@ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf,  }
 
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *eth_dev;
 	struct rte_eth_dev_info dev_info;
 	struct bnxt *bp;
-	uint16_t tot_rate = 0;
+	uint32_t tot_rate = 0;
 	uint64_t idx;
 	int rc;
 
drivers/net/bnxt/rte_pmd_bnxt.h +1 -1
@@ -184,7 +184,7 @@ int rte_pmd_bnxt_set_vf_vlan_filter(uint16_t port, uint16_t vlan,
  *   - (-EINVAL) if *vf* or *mac_addr* is invalid.
  */
 int rte_pmd_bnxt_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk);
+				uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Get VF's statistics
drivers/net/cnxk/cnxk_ethdev.h +1 -1
@@ -558,7 +558,7 @@ int cnxk_nix_timesync_write_time(struct rte_eth_dev *eth_dev,  uint64_t cnxk_nix_rxq_mbuf_setup(struct cnxk_eth_dev *dev);  int cnxk_nix_tm_ops_get(struct rte_eth_dev *eth_dev, void *ops);  int cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				     uint16_t queue_idx, uint16_t tx_rate);
+				     uint16_t queue_idx, uint32_t tx_rate);
 int cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
 			      int mark_yellow, int mark_red,
 			      struct rte_tm_error *error);
drivers/net/cnxk/cnxk_tm.c +1 -1
@@ -751,7 +751,7 @@ struct rte_tm_ops cnxk_tm_ops = {
 
 int
 cnxk_nix_tm_set_queue_rate_limit(struct rte_eth_dev *eth_dev,
-				 uint16_t queue_idx, uint16_t tx_rate_mbps)
+				 uint16_t queue_idx, uint32_t tx_rate_mbps)
 {
 	struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
 	uint64_t tx_rate = tx_rate_mbps * (uint64_t)1E6; diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c

index 1dfad0e..9ff8ee0 100644

drivers/net/ixgbe/ixgbe_ethdev.c +2 -2
@@ -2475,7 +2475,7 @@ static int eth_ixgbevf_pci_remove(struct rte_pci_device *pci_dev)
 
 int
 ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk)
+			uint32_t tx_rate, uint64_t q_msk)
 {
 	struct ixgbe_hw *hw;
 	struct ixgbe_vf_info *vfinfo;
@@ -6090,7 +6090,7 @@ static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
 
 int
 ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 	uint32_t rf_dec, rf_int;
drivers/net/ixgbe/ixgbe_ethdev.h +2 -2
index 0773a7e..b4db3f4 100644
@@ -753,13 +753,13 @@ void ixgbe_fdir_stats_get(struct rte_eth_dev *dev,
 
 int ixgbe_vt_check(struct ixgbe_hw *hw);  int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-			    uint16_t tx_rate, uint64_t q_msk);
+			    uint32_t tx_rate, uint64_t q_msk);
 bool is_ixgbe_supported(struct rte_eth_dev *dev);  int ixgbe_tm_ops_get(struct rte_eth_dev *dev, void *ops);  void ixgbe_tm_conf_init(struct rte_eth_dev *dev);  void ixgbe_tm_conf_uninit(struct rte_eth_dev *dev);  int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int ixgbe_rss_conf_init(struct ixgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);  int ixgbe_action_rss_same(const struct rte_flow_action_rss *comp, diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c

index 9729f85..4ff7f37 100644

drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -498,7 +498,7 @@
 
 int
 rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				uint16_t tx_rate, uint64_t q_msk)
+				uint32_t tx_rate, uint64_t q_msk)
 {
 	struct rte_eth_dev *dev;
 
drivers/net/ixgbe/rte_pmd_ixgbe.h +1 -1
index 426fe58..7ca1126 100644
@@ -380,7 +380,7 @@ int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf,
-				     uint16_t tx_rate, uint64_t q_msk);
+				     uint32_t tx_rate, uint64_t q_msk);
 
 /**
  * Set all the TCs' bandwidth weight.
drivers/net/txgbe/txgbe_ethdev.c +1 -1
index 4422472..86ef979 100644
@@ -3764,7 +3764,7 @@ static int txgbe_dev_xstats_get_names_by_id(struct rte_eth_dev *dev,
 
 int
 txgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
-			   uint16_t queue_idx, uint16_t tx_rate)
+			   uint16_t queue_idx, uint32_t tx_rate)
 {
 	struct txgbe_hw *hw = TXGBE_DEV_HW(dev);
 	uint32_t bcnrc_val;
drivers/net/txgbe/txgbe_ethdev.h +5 -5
index e425ab4..5171a6c 100644
@@ -586,7 +586,7 @@ int txgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,  void txgbe_tm_conf_init(struct rte_eth_dev *dev);  void txgbe_tm_conf_uninit(struct rte_eth_dev *dev);  int txgbe_set_queue_rate_limit(struct rte_eth_dev *dev, uint16_t queue_idx,
-			       uint16_t tx_rate);
+			       uint32_t tx_rate);
 int txgbe_rss_conf_init(struct txgbe_rte_flow_rss_conf *out,
 			const struct rte_flow_action_rss *in);  int txgbe_action_rss_same(const struct rte_flow_action_rss *comp, diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index a0e0b2a..a89450c 100644
--- a/lib/ethdev/ethdev_driver.h
+++ b/lib/ethdev/ethdev_driver.h
@@ -598,7 +598,7 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 /** @internal Set queue Tx rate. */
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
-				uint16_t tx_rate);
+				uint32_t tx_rate);
 
 /** @internal Add tunneling UDP port. */  typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev, diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 1979dc0..4b11dae 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -4388,7 +4388,7 @@ enum {
 }
 
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-					uint16_t tx_rate)
+					uint32_t tx_rate)
 {
 	struct rte_eth_dev *dev;
 	struct rte_eth_dev_info dev_info;
lib/ethdev/rte_ethdev.h +1 -1
@@ -4165,7 +4165,7 @@ int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
  *   - (-EINVAL) if bad parameter.
  */
 int rte_eth_set_queue_rate_limit(uint16_t port_id, uint16_t queue_idx,
-			uint16_t tx_rate);
+			uint32_t tx_rate);
 
 /**
  * Configuration of Receive Side Scaling hash computation of Ethernet device.

--
1.8.3.1