DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/8] QoS features on i40e
@ 2017-02-24  3:24 Wenzhuo Lu
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
                   ` (9 more replies)
  0 siblings, 10 replies; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

This patch set enables several QoS features on i40e.
1, VF max bandwidth setting.
2, TC min bandwidth setting on a VF.
3, TC max bandwidth setting on a VF.
4, TC TX scheduling mode setting.
As there're no new interface between PF and VF defined, all the settings
for VF are done on PF. PF acts as a controller for the VFs.

Wenzhuo Lu (8):
  net/i40e: set VF max bandwidth from PF
  net/i40e: allocate VF TC bandwidth from PF
  net/i40e: set VF TC max bandwidth from PF
  net/i40e: set TC strict priority mode
  app/testpmd: set VF TX max bandwidth
  app/testpmd: set VF TC TX min bandwidth
  app/testpmd: set VF TC TX max bandwidth
  app/testpmd: set TC strict link priority mode

 app/test-pmd/cmdline.c                      | 343 +++++++++++++++++++++
 doc/guides/nics/i40e.rst                    |  21 ++
 doc/guides/rel_notes/release_17_05.rst      |  20 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  28 ++
 drivers/net/i40e/i40e_ethdev.c              | 449 ++++++++++++++++++++++++++++
 drivers/net/i40e/i40e_ethdev.h              |   1 +
 drivers/net/i40e/rte_pmd_i40e.h             |  86 ++++++
 drivers/net/i40e/rte_pmd_i40e_version.map   |  10 +
 8 files changed, 958 insertions(+)

-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:01   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC " Wenzhuo Lu
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Support setting VF max bandwidth from PF.
User can call the API on PF to set a specific VF's
max bandwidth.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 doc/guides/rel_notes/release_17_05.rst    |  3 +
 drivers/net/i40e/i40e_ethdev.c            | 94 +++++++++++++++++++++++++++++++
 drivers/net/i40e/rte_pmd_i40e.h           | 23 ++++++++
 drivers/net/i40e/rte_pmd_i40e_version.map |  7 +++
 4 files changed, 127 insertions(+)

diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst
index e25ea9f..f41a839 100644
--- a/doc/guides/rel_notes/release_17_05.rst
+++ b/doc/guides/rel_notes/release_17_05.rst
@@ -41,6 +41,9 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added VF max bandwidth setting on i40e.**
+
+  i40e HW supports to set the max bandwidth for a VF. Enable this capability.
 
 Resolved Issues
 ---------------
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 508fcc8..cb8f1a4 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -243,6 +243,11 @@
 /* Bit mask of Extended Tag enable/disable */
 #define PCI_DEV_CTRL_EXT_TAG_MASK  (1 << PCI_DEV_CTRL_EXT_TAG_SHIFT)
 
+/* The max bandwidth of i40e is 40Gbps. */
+#define I40E_QOS_BW_MAX 40000
+/* The bandwidth should be the multiple of 50Mbps. */
+#define I40E_QOS_BW_GRANULARITY 50
+
 static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_i40e_dev_uninit(struct rte_eth_dev *eth_dev);
 static int i40e_dev_configure(struct rte_eth_dev *dev);
@@ -11219,3 +11224,92 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
 
 	return 0;
 }
+
+int
+rte_pmd_i40e_set_vf_max_bw(uint8_t port, uint16_t vf_id, uint32_t bw)
+{
+	struct rte_eth_dev *dev;
+	struct i40e_pf *pf;
+	struct i40e_vsi *vsi;
+	struct i40e_hw *hw;
+	int ret = 0;
+	int i;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+
+	if (!is_device_supported(dev, &rte_i40e_pmd))
+		return -ENOTSUP;
+
+	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+
+	if (vf_id >= pf->vf_num || !pf->vfs) {
+		PMD_DRV_LOG(ERR, "Invalid VF ID.");
+		return -EINVAL;
+	}
+
+	vsi = pf->vfs[vf_id].vsi;
+	if (!vsi) {
+		PMD_DRV_LOG(ERR, "Invalid VSI.");
+		return -EINVAL;
+	}
+
+	if (bw > I40E_QOS_BW_MAX) {
+		PMD_DRV_LOG(ERR, "Bandwidth should not be larger than %dMbps.",
+			    I40E_QOS_BW_MAX);
+		return -EINVAL;
+	}
+
+	if (bw % I40E_QOS_BW_GRANULARITY) {
+		PMD_DRV_LOG(ERR, "Bandwidth should be the multiple of %dMbps.",
+			    I40E_QOS_BW_GRANULARITY);
+		return -EINVAL;
+	}
+
+	bw /= I40E_QOS_BW_GRANULARITY;
+
+	hw = I40E_VSI_TO_HW(vsi);
+
+	/* No change. */
+	if (bw == vsi->bw_info.bw_limit) {
+		PMD_DRV_LOG(INFO,
+			    "No change for VF max bandwidth. Nothing to do.");
+		return 0;
+	}
+
+	/**
+	 * VF bandwidth limitation and TC bandwidth limitation cannot be
+	 * enabled in parallel, quit if TC bandwidth limitation is enabled.
+	 *
+	 * If bw is 0, means disable bandwidth limitation. Then no need to
+	 * check TC bandwidth limitation.
+	 */
+	if (bw) {
+		for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+			if ((vsi->enabled_tc & BIT_ULL(i)) &&
+			    vsi->bw_info.bw_ets_credits[i])
+				break;
+		}
+		if (i != I40E_MAX_TRAFFIC_CLASS) {
+			PMD_DRV_LOG(ERR,
+				    "TC max bandwidth has been set on this VF,"
+				    " please disable it first.");
+			return -EINVAL;
+		}
+	}
+
+	ret = i40e_aq_config_vsi_bw_limit(hw, vsi->seid, (uint16_t)bw, 0, NULL);
+	if (ret) {
+		PMD_DRV_LOG(ERR,
+			    "Failed to set VF %d bandwidth, err(%d).",
+			    vf_id, ret);
+		return -EINVAL;
+	}
+
+	/* Store the configuration. */
+	vsi->bw_info.bw_limit = (uint16_t)bw;
+	vsi->bw_info.bw_max = 0;
+
+	return 0;
+}
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index a0ad88c..224ec4f 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -332,4 +332,27 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port,
 int rte_pmd_i40e_reset_vf_stats(uint8_t port,
 				uint16_t vf_id);
 
+/**
+ * Set VF's max bandwidth.
+ *
+ * Per VF bandwidth limitation and per TC bandwidth limitation cannot
+ * be enabled in parallel. If per TC bandwidth is enabled, this function
+ * will disable it.
+ *
+ * @param port
+ *    The port identifier of the Ethernet device.
+ * @param vf_id
+ *    ID specifying VF.
+ * @param bw
+ *    Bandwidth for this VF.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if bad parameter.
+ *   - (-ENOTSUP) not supported by firmware.
+ */
+int rte_pmd_i40e_set_vf_max_bw(uint8_t port,
+			       uint16_t vf_id,
+			       uint32_t bw);
+
 #endif /* _PMD_I40E_H_ */
diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
index 7a5d211..1d9dcf8 100644
--- a/drivers/net/i40e/rte_pmd_i40e_version.map
+++ b/drivers/net/i40e/rte_pmd_i40e_version.map
@@ -22,3 +22,10 @@ DPDK_17.02 {
 	rte_pmd_i40e_set_vf_vlan_tag;
 
 } DPDK_2.0;
+
+DPDK_17.05 {
+	global:
+
+	rte_pmd_i40e_set_vf_max_bw;
+
+} DPDK_17.02;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC bandwidth from PF
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:10   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max " Wenzhuo Lu
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Allocate all TCs' relative bandwidth (percentage) on
a specific VF.
It can be taken as relative min bandwidth setting.
User can call the API to set VF TC's min bandwidth
from PF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 doc/guides/rel_notes/release_17_05.rst    |   5 ++
 drivers/net/i40e/i40e_ethdev.c            | 118 ++++++++++++++++++++++++++++++
 drivers/net/i40e/rte_pmd_i40e.h           |  26 +++++++
 drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
 4 files changed, 150 insertions(+)

diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst
index f41a839..a726138 100644
--- a/doc/guides/rel_notes/release_17_05.rst
+++ b/doc/guides/rel_notes/release_17_05.rst
@@ -45,6 +45,11 @@ New Features
 
   i40e HW supports to set the max bandwidth for a VF. Enable this capability.
 
+* **Added VF TC min bandwidth setting on i40e.**
+
+  i40e HW supports to set the allocated bandwidth for a TC on a VF. Enable this
+  capability.
+
 Resolved Issues
 ---------------
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index cb8f1a4..5a46737 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -247,6 +247,10 @@
 #define I40E_QOS_BW_MAX 40000
 /* The bandwidth should be the multiple of 50Mbps. */
 #define I40E_QOS_BW_GRANULARITY 50
+/* The min bandwidth weight is 1. */
+#define I40E_QOS_BW_WEIGHT_MIN 1
+/* The max bandwidth weight is 127. */
+#define I40E_QOS_BW_WEIGHT_MAX 127
 
 static int eth_i40e_dev_init(struct rte_eth_dev *eth_dev);
 static int eth_i40e_dev_uninit(struct rte_eth_dev *eth_dev);
@@ -11313,3 +11317,117 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
 
 	return 0;
 }
+
+int
+rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port, uint16_t vf_id,
+				uint8_t tc_num, uint8_t *bw_weight)
+{
+	struct rte_eth_dev *dev;
+	struct i40e_pf *pf;
+	struct i40e_vsi *vsi;
+	struct i40e_hw *hw;
+	struct i40e_aqc_configure_vsi_tc_bw_data tc_bw;
+	int ret = 0;
+	int i, j;
+	uint16_t sum;
+	bool b_change = false;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+
+	if (!is_device_supported(dev, &rte_i40e_pmd))
+		return -ENOTSUP;
+
+	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+
+	if (vf_id >= pf->vf_num || !pf->vfs) {
+		PMD_DRV_LOG(ERR, "Invalid VF ID.");
+		return -EINVAL;
+	}
+
+	vsi = pf->vfs[vf_id].vsi;
+	if (!vsi) {
+		PMD_DRV_LOG(ERR, "Invalid VSI.");
+		return -EINVAL;
+	}
+
+	if (tc_num > I40E_MAX_TRAFFIC_CLASS) {
+		PMD_DRV_LOG(ERR, "TCs should be no more than %d.",
+			    I40E_MAX_TRAFFIC_CLASS);
+		return -EINVAL;
+	}
+
+	sum = 0;
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+		if (vsi->enabled_tc & BIT_ULL(i))
+			sum++;
+	}
+	if (sum != tc_num) {
+		PMD_DRV_LOG(ERR,
+			    "Weight should be set for all %d enabled TCs.",
+			    sum);
+		return -EINVAL;
+	}
+
+	sum = 0;
+	for (i = 0; i < tc_num; i++) {
+		if (!bw_weight[i]) {
+			PMD_DRV_LOG(ERR,
+				    "The weight should be 1 at least.");
+			return -EINVAL;
+		}
+		sum += bw_weight[i];
+	}
+	if (sum != 100) {
+		PMD_DRV_LOG(ERR,
+			    "The summary of the TC weight should be 100.");
+		return -EINVAL;
+	}
+
+	/**
+	 * Create the configuration for all the TCs.
+	 */
+	memset(&tc_bw, 0, sizeof(tc_bw));
+	tc_bw.tc_valid_bits = vsi->enabled_tc;
+	j = 0;
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+		if (vsi->enabled_tc & BIT_ULL(i)) {
+			if (bw_weight[j] !=
+				vsi->bw_info.bw_ets_share_credits[i])
+				b_change = true;
+
+			tc_bw.tc_bw_credits[i] = bw_weight[j];
+			j++;
+		}
+	}
+
+	/* No change. */
+	if (!b_change) {
+		PMD_DRV_LOG(INFO,
+			    "No change for TC allocated bandwidth."
+			    " Nothing to do.");
+		return 0;
+	}
+
+	hw = I40E_VSI_TO_HW(vsi);
+
+	ret = i40e_aq_config_vsi_tc_bw(hw, vsi->seid, &tc_bw, NULL);
+	if (ret) {
+		PMD_DRV_LOG(ERR,
+			    "Failed to set VF %d TC bandwidth weight, err(%d).",
+			    vf_id, ret);
+		return -EINVAL;
+	}
+
+	/* Store the configuration. */
+	j = 0;
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+		if (vsi->enabled_tc & BIT_ULL(i)) {
+			vsi->bw_info.bw_ets_share_credits[i] = bw_weight[j];
+			j++;
+		}
+	}
+
+	return 0;
+}
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 224ec4f..9fdb447 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -355,4 +355,30 @@ int rte_pmd_i40e_set_vf_max_bw(uint8_t port,
 			       uint16_t vf_id,
 			       uint32_t bw);
 
+/**
+ * Set all the TCs' bandwidth weight on a specific VF.
+ *
+ * The bw_weight means the percentage occupied by the TC.
+ * It can be taken as the relative min bandwidth setting.
+ *
+ * @param port
+ *    The port identifier of the Ethernet device.
+ * @param vf_id
+ *    ID specifying VF.
+ * @param tc_num
+ *    Number of TCs.
+ * @param bw_weight
+ *    An array of relative bandwidth weight for all the TCs.
+ *    The summary of the bw_weight should be 100.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if bad parameter.
+ *   - (-ENOTSUP) not supported by firmware.
+ */
+int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port,
+				    uint16_t vf_id,
+				    uint8_t tc_num,
+				    uint8_t *bw_weight);
+
 #endif /* _PMD_I40E_H_ */
diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
index 1d9dcf8..85bc41d 100644
--- a/drivers/net/i40e/rte_pmd_i40e_version.map
+++ b/drivers/net/i40e/rte_pmd_i40e_version.map
@@ -27,5 +27,6 @@ DPDK_17.05 {
 	global:
 
 	rte_pmd_i40e_set_vf_max_bw;
+	rte_pmd_i40e_set_vf_tc_bw_alloc;
 
 } DPDK_17.02;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max bandwidth from PF
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC " Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:15   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode Wenzhuo Lu
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Set a specific TC's max bandwidth on a VF.
User can call the API to set VF TC's max bandwidth
from PF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 doc/guides/nics/i40e.rst                  |  11 +++
 doc/guides/rel_notes/release_17_05.rst    |   5 ++
 drivers/net/i40e/i40e_ethdev.c            | 118 ++++++++++++++++++++++++++++++
 drivers/net/i40e/rte_pmd_i40e.h           |  22 ++++++
 drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
 5 files changed, 157 insertions(+)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index b890613..260287e 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -467,3 +467,14 @@ Incorrect Rx statistics when packet is oversize
 When a packet is over maximum frame size, the packet is dropped.
 However the Rx statistics, when calling `rte_eth_stats_get` incorrectly
 shows it as received.
+
+VF & TC max bandwidth setting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The per VF max bandwidth and per TC max bandwidth cannot be enabled in parallel.
+The dehavior is different when handling per VF and per TC max bandwidth setting.
+When enabling per VF max bandwidth, SW will check if per TC max bandwidth is
+enabled. If so, return failure.
+When enabling per TC max bandwidth, SW will check if per VF max bandwidth
+is enabled. If so, disable per VF max bandwidth and continue with per TC max
+bandwidth setting.
diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst
index a726138..d31435c 100644
--- a/doc/guides/rel_notes/release_17_05.rst
+++ b/doc/guides/rel_notes/release_17_05.rst
@@ -50,6 +50,11 @@ New Features
   i40e HW supports to set the allocated bandwidth for a TC on a VF. Enable this
   capability.
 
+* **Added VF TC max bandwidth setting on i40e.**
+
+  i40e HW supports to set the max bandwidth for a TC on a VF. Enable this
+  capability.
+
 Resolved Issues
 ---------------
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 5a46737..2df9587 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11431,3 +11431,121 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
 
 	return 0;
 }
+
+int
+rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port, uint16_t vf_id,
+			      uint8_t tc_no, uint32_t bw)
+{
+	struct rte_eth_dev *dev;
+	struct i40e_pf *pf;
+	struct i40e_vsi *vsi;
+	struct i40e_hw *hw;
+	struct i40e_aqc_configure_vsi_ets_sla_bw_data tc_bw;
+	int ret = 0;
+	int i;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+
+	if (!is_device_supported(dev, &rte_i40e_pmd))
+		return -ENOTSUP;
+
+	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+
+	if (vf_id >= pf->vf_num || !pf->vfs) {
+		PMD_DRV_LOG(ERR, "Invalid VF ID.");
+		return -EINVAL;
+	}
+
+	vsi = pf->vfs[vf_id].vsi;
+	if (!vsi) {
+		PMD_DRV_LOG(ERR, "Invalid VSI.");
+		return -EINVAL;
+	}
+
+	if (bw > I40E_QOS_BW_MAX) {
+		PMD_DRV_LOG(ERR, "Bandwidth should not be larger than %dMbps.",
+			    I40E_QOS_BW_MAX);
+		return -EINVAL;
+	}
+
+	if (bw % I40E_QOS_BW_GRANULARITY) {
+		PMD_DRV_LOG(ERR, "Bandwidth should be the multiple of %dMbps.",
+			    I40E_QOS_BW_GRANULARITY);
+		return -EINVAL;
+	}
+
+	bw /= I40E_QOS_BW_GRANULARITY;
+
+	if (tc_no >= I40E_MAX_TRAFFIC_CLASS) {
+		PMD_DRV_LOG(ERR, "TC No. should be less than %d.",
+			    I40E_MAX_TRAFFIC_CLASS);
+		return -EINVAL;
+	}
+
+	hw = I40E_VSI_TO_HW(vsi);
+
+	if (!(vsi->enabled_tc & BIT_ULL(tc_no))) {
+		PMD_DRV_LOG(ERR, "VF %d TC %d isn't enabled.",
+			    vf_id, tc_no);
+		return -EINVAL;
+	}
+
+	/* No change. */
+	if (bw == vsi->bw_info.bw_ets_credits[tc_no]) {
+		PMD_DRV_LOG(INFO,
+			    "No change for TC max bandwidth. Nothing to do.");
+		return 0;
+	}
+
+	/**
+	 * VF bandwidth limitation and TC bandwidth limitation cannot be
+	 * enabled in parallel, disable VF bandwidth limitation if it's
+	 * enabled.
+	 * If bw is 0, means disable bandwidth limitation. Then no need to
+	 * care about VF bandwidth limitation configuration.
+	 */
+	if (bw && vsi->bw_info.bw_limit) {
+		ret = i40e_aq_config_vsi_bw_limit(hw, vsi->seid, 0, 0, NULL);
+		if (ret) {
+			PMD_DRV_LOG(ERR,
+				    "Failed to disable VF(%d)"
+				    " bandwidth limitation, err(%d).",
+				    vf_id, ret);
+			return -EINVAL;
+		}
+
+		PMD_DRV_LOG(INFO,
+			    "VF max bandwidth is disabled according"
+			    " to TC max bandwidth setting.");
+	}
+
+	/**
+	 * Get all the TCs' info to create a whole picture.
+	 * Because the incremental change isn't permitted.
+	 */
+	memset(&tc_bw, 0, sizeof(tc_bw));
+	tc_bw.tc_valid_bits = vsi->enabled_tc;
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+		if (vsi->enabled_tc & BIT_ULL(i)) {
+			tc_bw.tc_bw_credits[i] =
+				rte_cpu_to_le_16(
+					vsi->bw_info.bw_ets_credits[i]);
+		}
+	}
+	tc_bw.tc_bw_credits[tc_no] = rte_cpu_to_le_16((uint16_t)bw);
+
+	ret = i40e_aq_config_vsi_ets_sla_bw_limit(hw, vsi->seid, &tc_bw, NULL);
+	if (ret) {
+		PMD_DRV_LOG(ERR,
+			    "Failed to set VF %d TC %d max bandwidth, err(%d).",
+			    vf_id, tc_no, ret);
+		return -EINVAL;
+	}
+
+	/* Store the configuration. */
+	vsi->bw_info.bw_ets_credits[tc_no] = (uint16_t)bw;
+
+	return 0;
+}
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 9fdb447..08ee2b0 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -381,4 +381,26 @@ int rte_pmd_i40e_set_vf_tc_bw_alloc(uint8_t port,
 				    uint8_t tc_num,
 				    uint8_t *bw_weight);
 
+/**
+ * Set a specific TC's max bandwidth on a specific VF.
+ *
+ * @param port
+ *    The port identifier of the Ethernet device.
+ * @param vf_id
+ *    ID specifying VF.
+ * @param tc_no
+ *    Number specifying TC.
+ * @param bw
+ *    Max bandwidth for this TC.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if bad parameter.
+ *   - (-ENOTSUP) not supported by firmware.
+ */
+int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port,
+				  uint16_t vf_id,
+				  uint8_t tc_no,
+				  uint32_t bw);
+
 #endif /* _PMD_I40E_H_ */
diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
index 85bc41d..bd657ab 100644
--- a/drivers/net/i40e/rte_pmd_i40e_version.map
+++ b/drivers/net/i40e/rte_pmd_i40e_version.map
@@ -28,5 +28,6 @@ DPDK_17.05 {
 
 	rte_pmd_i40e_set_vf_max_bw;
 	rte_pmd_i40e_set_vf_tc_bw_alloc;
+	rte_pmd_i40e_set_vf_tc_max_bw;
 
 } DPDK_17.02;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (2 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max " Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:19   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth Wenzhuo Lu
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Set some TCs to strict priority mode.
It's a global setting on a physical port.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 doc/guides/nics/i40e.rst                  |  10 +++
 doc/guides/rel_notes/release_17_05.rst    |   7 ++
 drivers/net/i40e/i40e_ethdev.c            | 119 ++++++++++++++++++++++++++++++
 drivers/net/i40e/i40e_ethdev.h            |   1 +
 drivers/net/i40e/rte_pmd_i40e.h           |  15 ++++
 drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
 6 files changed, 153 insertions(+)

diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
index 260287e..361d9d9 100644
--- a/doc/guides/nics/i40e.rst
+++ b/doc/guides/nics/i40e.rst
@@ -478,3 +478,13 @@ enabled. If so, return failure.
 When enabling per TC max bandwidth, SW will check if per VF max bandwidth
 is enabled. If so, disable per VF max bandwidth and continue with per TC max
 bandwidth setting.
+
+TC TX scheduling mode setting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There're 2 TX scheduling modes for TCs, round robin and strict priority mode.
+If a TC is set to strict priority mode, it can consume unlimited bandwidth.
+It means if APP has set the max bandwidth for that TC, it comes to no
+effect.
+It's suggested to set the strict priority mode for a TC that is latency
+sensitive but no consuming much bandwidth.
diff --git a/doc/guides/rel_notes/release_17_05.rst b/doc/guides/rel_notes/release_17_05.rst
index d31435c..99811a2 100644
--- a/doc/guides/rel_notes/release_17_05.rst
+++ b/doc/guides/rel_notes/release_17_05.rst
@@ -55,6 +55,13 @@ New Features
   i40e HW supports to set the max bandwidth for a TC on a VF. Enable this
   capability.
 
+* **Added TC strict priority mode setting on i40e.**
+
+  There're 2 TX scheduling modes supported for TCs by i40e HW, round ribon mode
+  and strict priority mode. By default it's round robin mode. Enable the
+  capability to change the TX scheduling mode for a TC. It's a global setting
+  on a physical port.
+
 Resolved Issues
 ---------------
 
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 2df9587..24ad11b 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11549,3 +11549,122 @@ int rte_pmd_i40e_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
 
 	return 0;
 }
+
+int
+rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map)
+{
+	struct rte_eth_dev *dev;
+	struct i40e_pf *pf;
+	struct i40e_vsi *vsi;
+	struct i40e_veb *veb;
+	struct i40e_hw *hw;
+	struct i40e_aqc_configure_switching_comp_ets_data ets_data;
+	int i;
+	int ret;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+
+	if (!is_device_supported(dev, &rte_i40e_pmd))
+		return -ENOTSUP;
+
+	pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
+
+	vsi = pf->main_vsi;
+	if (!vsi) {
+		PMD_DRV_LOG(ERR, "Invalid VSI.");
+		return -EINVAL;
+	}
+
+	veb = vsi->veb;
+	if (!veb) {
+		PMD_DRV_LOG(ERR, "Invalid VEB.");
+		return -EINVAL;
+	}
+
+	if ((tc_map & veb->enabled_tc) != tc_map) {
+		PMD_DRV_LOG(ERR,
+			    "TC bitmap isn't the subset of enabled TCs 0x%x.",
+			    veb->enabled_tc);
+		return -EINVAL;
+	}
+
+	if (tc_map == veb->strict_prio_tc) {
+		PMD_DRV_LOG(INFO, "No change for TC bitmap. Nothing to do.");
+		return 0;
+	}
+
+	hw = I40E_VSI_TO_HW(vsi);
+
+	/* Disable DCBx if it's the first time to set strict priority. */
+	if (!veb->strict_prio_tc) {
+		ret = i40e_aq_stop_lldp(hw, true, NULL);
+		if (ret)
+			PMD_DRV_LOG(INFO,
+				    "Failed to disable DCBx as it's already"
+				    " disabled.");
+		else
+			PMD_DRV_LOG(INFO,
+				    "DCBx is disabled according to strict"
+				    " priority setting.");
+	}
+
+	memset(&ets_data, 0, sizeof(ets_data));
+	ets_data.tc_valid_bits = veb->enabled_tc;
+	ets_data.seepage = I40E_AQ_ETS_SEEPAGE_EN_MASK;
+	ets_data.tc_strict_priority_flags = tc_map;
+	/* Get all TCs' bandwidth. */
+	for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) {
+		if (veb->enabled_tc & BIT_ULL(i)) {
+			/* For rubust, if bandwidth is 0, use 1 instead. */
+			if (veb->bw_info.bw_ets_share_credits[i])
+				ets_data.tc_bw_share_credits[i] =
+					veb->bw_info.bw_ets_share_credits[i];
+			else
+				ets_data.tc_bw_share_credits[i] =
+					I40E_QOS_BW_WEIGHT_MIN;
+		}
+	}
+
+	if (!veb->strict_prio_tc)
+		ret = i40e_aq_config_switch_comp_ets(
+			hw, veb->uplink_seid,
+			&ets_data, i40e_aqc_opc_enable_switching_comp_ets,
+			NULL);
+	else if (tc_map)
+		ret = i40e_aq_config_switch_comp_ets(
+			hw, veb->uplink_seid,
+			&ets_data, i40e_aqc_opc_modify_switching_comp_ets,
+			NULL);
+	else
+		ret = i40e_aq_config_switch_comp_ets(
+			hw, veb->uplink_seid,
+			&ets_data, i40e_aqc_opc_disable_switching_comp_ets,
+			NULL);
+
+	if (ret) {
+		PMD_DRV_LOG(ERR,
+			    "Failed to set TCs' strict priority mode."
+			    " err (%d)", ret);
+		return -EINVAL;
+	}
+
+	veb->strict_prio_tc = tc_map;
+
+	/* Enable DCBx again, if all the TCs' strict priority disabled. */
+	if (!tc_map) {
+		ret = i40e_aq_start_lldp(hw, NULL);
+		if (ret) {
+			PMD_DRV_LOG(ERR,
+				    "Failed to enable DCBx, err(%d).", ret);
+			return -EINVAL;
+		}
+
+		PMD_DRV_LOG(INFO,
+			    "DCBx is enabled again according to strict"
+			    " priority setting.");
+	}
+
+	return ret;
+}
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index f545850..3420699 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -305,6 +305,7 @@ struct i40e_veb {
 	uint16_t stats_idx;
 	struct i40e_eth_stats stats;
 	uint8_t enabled_tc;   /* The traffic class enabled */
+	uint8_t strict_prio_tc; /* bit map of TCs set to strict priority mode */
 	struct i40e_bw_info bw_info; /* VEB bandwidth information */
 };
 
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index 08ee2b0..3ca49a4 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -403,4 +403,19 @@ int rte_pmd_i40e_set_vf_tc_max_bw(uint8_t port,
 				  uint8_t tc_no,
 				  uint32_t bw);
 
+/**
+ * Set some TCs to strict priority mode on a physical port.
+ *
+ * @param port
+ *    The port identifier of the Ethernet device.
+ * @param tc_map
+ *    A bit map for the TCs.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENODEV) if *port* invalid.
+ *   - (-EINVAL) if bad parameter.
+ *   - (-ENOTSUP) not supported by firmware.
+ */
+int rte_pmd_i40e_set_tc_strict_prio(uint8_t port, uint8_t tc_map);
+
 #endif /* _PMD_I40E_H_ */
diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
index bd657ab..488e6b6 100644
--- a/drivers/net/i40e/rte_pmd_i40e_version.map
+++ b/drivers/net/i40e/rte_pmd_i40e_version.map
@@ -26,6 +26,7 @@ DPDK_17.02 {
 DPDK_17.05 {
 	global:
 
+	rte_pmd_i40e_set_tc_strict_prio;
 	rte_pmd_i40e_set_vf_max_bw;
 	rte_pmd_i40e_set_vf_tc_bw_alloc;
 	rte_pmd_i40e_set_vf_tc_max_bw;
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (3 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:21   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth Wenzhuo Lu
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Add CLI to set a specific VF's TX max bandwidth
from PF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c                      | 96 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 103 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 43fc636..0387ac2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -315,6 +315,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf vlan tag (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN tag for a VF from the PF.\n\n"
 
+			"set vf tx max-bandwidth (port_id) (vf_id) (bandwidth)\n"
+			"    Set a VF's max bandwidth(Mbps).\n\n"
+
 			"vlan set filter (on|off) (port_id)\n"
 			"    Set the VLAN filter on a port.\n\n"
 
@@ -12395,6 +12398,98 @@ struct cmd_set_vf_vlan_tag_result {
 	},
 };
 
+/* Common definition of VF and TC TX bandwidth configuration */
+struct cmd_vf_tc_bw_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	cmdline_fixed_string_t max_bw;
+	uint8_t port_id;
+	uint16_t vf_id;
+	uint32_t bw;
+};
+
+cmdline_parse_token_string_t cmd_vf_tc_bw_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tc_bw_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tc_bw_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 tx, "tx");
+cmdline_parse_token_string_t cmd_vf_tc_bw_max_bw =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 max_bw, "max-bandwidth");
+cmdline_parse_token_num_t cmd_vf_tc_bw_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tc_bw_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 vf_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_tc_bw_bw =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 bw, UINT32);
+
+/* VF max bandwidth setting */
+static void
+cmd_vf_max_bw_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tc_bw_result *res = parsed_result;
+	int ret = -ENOTSUP;
+
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	ret = rte_pmd_i40e_set_vf_max_bw(res->port_id,
+					 res->vf_id, res->bw);
+#endif
+
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or bandwidth %d\n",
+		       res->vf_id, res->bw);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("function not implemented\n");
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_vf_max_bw = {
+	.f = cmd_vf_max_bw_parsed,
+	.data = NULL,
+	.help_str = "set vf tx max-bandwidth <port_id> <vf_id> <bandwidth>",
+	.tokens = {
+		(void *)&cmd_vf_tc_bw_set,
+		(void *)&cmd_vf_tc_bw_vf,
+		(void *)&cmd_vf_tc_bw_tx,
+		(void *)&cmd_vf_tc_bw_max_bw,
+		(void *)&cmd_vf_tc_bw_port_id,
+		(void *)&cmd_vf_tc_bw_vf_id,
+		(void *)&cmd_vf_tc_bw_bw,
+		NULL,
+	},
+};
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -12570,6 +12665,7 @@ struct cmd_set_vf_vlan_tag_result {
 	(cmdline_parse_inst_t *)&cmd_set_vf_allmulti,
 	(cmdline_parse_inst_t *)&cmd_set_vf_broadcast,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_tag,
+	(cmdline_parse_inst_t *)&cmd_vf_max_bw,
 	NULL,
 };
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 64ed028..dab788f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -886,6 +886,13 @@ In promiscuous mode packets are not dropped if they aren't for the specified MAC
 
    testpmd> set vf allmulti (port_id) (vf_id) (on|off)
 
+set tx max bandwidth (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set TX max absolute bandwidth (Mbps) for a VF from PF::
+
+   testpmd> set vf tx max-bandwidth (port_id) (vf_id) (max_bandwidth)
+
 set flow_ctrl rx
 ~~~~~~~~~~~~~~~~
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (4 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:22   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth Wenzhuo Lu
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Add CLI to set TCs' min bandwidth on a specific VF
from PF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c                      | 121 ++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |   7 ++
 2 files changed, 128 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0387ac2..706ef1f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -318,6 +318,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf tx max-bandwidth (port_id) (vf_id) (bandwidth)\n"
 			"    Set a VF's max bandwidth(Mbps).\n\n"
 
+			"set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)\n"
+			"    Set all TCs' min bandwidth(%%) on a VF.\n\n"
+
 			"vlan set filter (on|off) (port_id)\n"
 			"    Set the VLAN filter on a port.\n\n"
 
@@ -12402,11 +12405,14 @@ struct cmd_set_vf_vlan_tag_result {
 struct cmd_vf_tc_bw_result {
 	cmdline_fixed_string_t set;
 	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tc;
 	cmdline_fixed_string_t tx;
+	cmdline_fixed_string_t min_bw;
 	cmdline_fixed_string_t max_bw;
 	uint8_t port_id;
 	uint16_t vf_id;
 	uint32_t bw;
+	cmdline_fixed_string_t bw_list;
 };
 
 cmdline_parse_token_string_t cmd_vf_tc_bw_set =
@@ -12417,10 +12423,18 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tc_bw_tc =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 tc, "tc");
 cmdline_parse_token_string_t cmd_vf_tc_bw_tx =
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 tx, "tx");
+cmdline_parse_token_string_t cmd_vf_tc_bw_min_bw =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 min_bw, "min-bandwidth");
 cmdline_parse_token_string_t cmd_vf_tc_bw_max_bw =
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
@@ -12437,6 +12451,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_NUM_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 bw, UINT32);
+cmdline_parse_token_string_t cmd_vf_tc_bw_bw_list =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 bw_list, NULL);
 
 /* VF max bandwidth setting */
 static void
@@ -12490,6 +12508,108 @@ struct cmd_vf_tc_bw_result {
 	},
 };
 
+static int
+vf_tc_min_bw_parse_bw_list(uint8_t *bw_list,
+			   uint8_t *tc_num,
+			   char *str)
+{
+	uint32_t size;
+	const char *p, *p0 = str;
+	char s[256];
+	char *end;
+	char *str_fld[16];
+	uint16_t i;
+	int ret;
+
+	p = strchr(p0, '(');
+	if (p == NULL) {
+		printf("The bandwidth-list should be '(bw1, bw2, ...)'\n");
+		return -1;
+	}
+	p++;
+	p0 = strchr(p, ')');
+	if (p0 == NULL) {
+		printf("The bandwidth-list should be '(bw1, bw2, ...)'\n");
+		return -1;
+	}
+	size = p0 - p;
+	if (size >= sizeof(s)) {
+		printf("The string size exceeds the internal buffer size\n");
+		return -1;
+	}
+	snprintf(s, sizeof(s), "%.*s", size, p);
+	ret = rte_strsplit(s, sizeof(s), str_fld, 16, ',');
+	if (ret <= 0) {
+		printf("Failed to get the bandwidth list. ");
+		return -1;
+	}
+	*tc_num = ret;
+	for (i = 0; i < ret; i++)
+		bw_list[i] = (uint8_t)strtoul(str_fld[i], &end, 0);
+
+	return 0;
+}
+
+/* TC min bandwidth setting */
+static void
+cmd_vf_tc_min_bw_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tc_bw_result *res = parsed_result;
+	uint8_t tc_num;
+	uint8_t bw[16];
+	int ret = -ENOTSUP;
+
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
+	ret = vf_tc_min_bw_parse_bw_list(bw, &tc_num, res->bw_list);
+	if (ret)
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	ret = rte_pmd_i40e_set_vf_tc_bw_alloc(res->port_id, res->vf_id,
+					      tc_num, bw);
+#endif
+
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or bandwidth\n", res->vf_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("function not implemented\n");
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_vf_tc_min_bw = {
+	.f = cmd_vf_tc_min_bw_parsed,
+	.data = NULL,
+	.help_str = "set vf tc tx min-bandwidth <port_id> <vf_id>"
+		    " <bw1, bw2, ...>",
+	.tokens = {
+		(void *)&cmd_vf_tc_bw_set,
+		(void *)&cmd_vf_tc_bw_vf,
+		(void *)&cmd_vf_tc_bw_tc,
+		(void *)&cmd_vf_tc_bw_tx,
+		(void *)&cmd_vf_tc_bw_min_bw,
+		(void *)&cmd_vf_tc_bw_port_id,
+		(void *)&cmd_vf_tc_bw_vf_id,
+		(void *)&cmd_vf_tc_bw_bw_list,
+		NULL,
+	},
+};
+
+
 /* ******************************************************************************** */
 
 /* list of instructions */
@@ -12666,6 +12786,7 @@ struct cmd_vf_tc_bw_result {
 	(cmdline_parse_inst_t *)&cmd_set_vf_broadcast,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_tag,
 	(cmdline_parse_inst_t *)&cmd_vf_max_bw,
+	(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,
 	NULL,
 };
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index dab788f..56cbc54 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -893,6 +893,13 @@ Set TX max absolute bandwidth (Mbps) for a VF from PF::
 
    testpmd> set vf tx max-bandwidth (port_id) (vf_id) (max_bandwidth)
 
+set tc tx min bandwidth (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set all TCs' TX min relative bandwidth (%) for a VF from PF::
+
+   testpmd> set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)
+
 set flow_ctrl rx
 ~~~~~~~~~~~~~~~~
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (5 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:22   ` Wu, Jingjing
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode Wenzhuo Lu
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Add CLI to set a specific TC's max bandwidth
on a specific VF from PF.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c                      | 64 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++++
 2 files changed, 71 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 706ef1f..0cf509a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -321,6 +321,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)\n"
 			"    Set all TCs' min bandwidth(%%) on a VF.\n\n"
 
+			"set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
+			"    Set a TC's max bandwidth(Mbps) on a VF.\n\n"
+
 			"vlan set filter (on|off) (port_id)\n"
 			"    Set the VLAN filter on a port.\n\n"
 
@@ -12411,6 +12414,7 @@ struct cmd_vf_tc_bw_result {
 	cmdline_fixed_string_t max_bw;
 	uint8_t port_id;
 	uint16_t vf_id;
+	uint8_t tc_no;
 	uint32_t bw;
 	cmdline_fixed_string_t bw_list;
 };
@@ -12447,6 +12451,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_NUM_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 vf_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_tc_bw_tc_no =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 tc_no, UINT8);
 cmdline_parse_token_num_t cmd_vf_tc_bw_bw =
 	TOKEN_NUM_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
@@ -12609,6 +12617,61 @@ struct cmd_vf_tc_bw_result {
 	},
 };
 
+/* TC max bandwidth setting */
+static void
+cmd_vf_tc_max_bw_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tc_bw_result *res = parsed_result;
+	int ret = -ENOTSUP;
+
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	ret = rte_pmd_i40e_set_vf_tc_max_bw(res->port_id, res->vf_id,
+					    res->tc_no, res->bw);
+#endif
+
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d, tc_no %d or bandwidth %d\n",
+		       res->vf_id, res->tc_no, res->bw);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("function not implemented\n");
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_vf_tc_max_bw = {
+	.f = cmd_vf_tc_max_bw_parsed,
+	.data = NULL,
+	.help_str = "set vf tc tx max-bandwidth <port_id> <vf_id> <tc_no>"
+		    " <bandwidth>",
+	.tokens = {
+		(void *)&cmd_vf_tc_bw_set,
+		(void *)&cmd_vf_tc_bw_vf,
+		(void *)&cmd_vf_tc_bw_tc,
+		(void *)&cmd_vf_tc_bw_tx,
+		(void *)&cmd_vf_tc_bw_max_bw,
+		(void *)&cmd_vf_tc_bw_port_id,
+		(void *)&cmd_vf_tc_bw_vf_id,
+		(void *)&cmd_vf_tc_bw_tc_no,
+		(void *)&cmd_vf_tc_bw_bw,
+		NULL,
+	},
+};
+
 
 /* ******************************************************************************** */
 
@@ -12787,6 +12850,7 @@ struct cmd_vf_tc_bw_result {
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_tag,
 	(cmdline_parse_inst_t *)&cmd_vf_max_bw,
 	(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,
+	(cmdline_parse_inst_t *)&cmd_vf_tc_max_bw,
 	NULL,
 };
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 56cbc54..7d965e2 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -900,6 +900,13 @@ Set all TCs' TX min relative bandwidth (%) for a VF from PF::
 
    testpmd> set vf tc tx min-bandwidth (port_id) (vf_id) (bw1, bw2, ...)
 
+set tc tx max bandwidth (for VF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set a TC's TX max absolute bandwidth (Mbps) for a VF from PF::
+
+   testpmd> set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (max_bandwidth)
+
 set flow_ctrl rx
 ~~~~~~~~~~~~~~~~
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (6 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth Wenzhuo Lu
@ 2017-02-24  3:24 ` Wenzhuo Lu
  2017-03-24  5:23   ` Wu, Jingjing
  2017-02-24  6:55 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Stephen Hemminger
  2017-03-27 15:13 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Ferruh Yigit
  9 siblings, 1 reply; 24+ messages in thread
From: Wenzhuo Lu @ 2017-02-24  3:24 UTC (permalink / raw)
  To: dev; +Cc: Wenzhuo Lu

Add a CLI to set some TCs' strict link priority mode
on a physical port.

Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
 app/test-pmd/cmdline.c                      | 62 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 ++++
 2 files changed, 69 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 0cf509a..a2d4c00 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -324,6 +324,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 			"set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (bandwidth)\n"
 			"    Set a TC's max bandwidth(Mbps) on a VF.\n\n"
 
+			"set tx strict-link-priority (port_id) (tc_bitmap)\n"
+			"    Set some TCs' strict link priority mode on a physical port.\n\n"
+
 			"vlan set filter (on|off) (port_id)\n"
 			"    Set the VLAN filter on a port.\n\n"
 
@@ -12412,11 +12415,13 @@ struct cmd_vf_tc_bw_result {
 	cmdline_fixed_string_t tx;
 	cmdline_fixed_string_t min_bw;
 	cmdline_fixed_string_t max_bw;
+	cmdline_fixed_string_t strict_link_prio;
 	uint8_t port_id;
 	uint16_t vf_id;
 	uint8_t tc_no;
 	uint32_t bw;
 	cmdline_fixed_string_t bw_list;
+	uint8_t tc_map;
 };
 
 cmdline_parse_token_string_t cmd_vf_tc_bw_set =
@@ -12435,6 +12440,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 tx, "tx");
+cmdline_parse_token_string_t cmd_vf_tc_bw_strict_link_prio =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 strict_link_prio, "strict-link-priority");
 cmdline_parse_token_string_t cmd_vf_tc_bw_min_bw =
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
@@ -12463,6 +12472,10 @@ struct cmd_vf_tc_bw_result {
 	TOKEN_STRING_INITIALIZER
 		(struct cmd_vf_tc_bw_result,
 		 bw_list, NULL);
+cmdline_parse_token_num_t cmd_vf_tc_bw_tc_map =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tc_bw_result,
+		 tc_map, UINT8);
 
 /* VF max bandwidth setting */
 static void
@@ -12672,6 +12685,54 @@ struct cmd_vf_tc_bw_result {
 	},
 };
 
+/* Strict link priority scheduling mode setting */
+static void
+cmd_strict_link_prio_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tc_bw_result *res = parsed_result;
+	int ret = -ENOTSUP;
+
+	if (port_id_is_invalid(res->port_id, ENABLED_WARN))
+		return;
+
+#ifdef RTE_LIBRTE_I40E_PMD
+	ret = rte_pmd_i40e_set_tc_strict_prio(res->port_id, res->tc_map);
+#endif
+
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid tc_bitmap 0x%x\n", res->tc_map);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("function not implemented\n");
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_strict_link_prio = {
+	.f = cmd_strict_link_prio_parsed,
+	.data = NULL,
+	.help_str = "set tx strict-link-priority <port_id> <tc_bitmap>",
+	.tokens = {
+		(void *)&cmd_vf_tc_bw_set,
+		(void *)&cmd_vf_tc_bw_tx,
+		(void *)&cmd_vf_tc_bw_strict_link_prio,
+		(void *)&cmd_vf_tc_bw_port_id,
+		(void *)&cmd_vf_tc_bw_tc_map,
+		NULL,
+	},
+};
+
 
 /* ******************************************************************************** */
 
@@ -12851,6 +12912,7 @@ struct cmd_vf_tc_bw_result {
 	(cmdline_parse_inst_t *)&cmd_vf_max_bw,
 	(cmdline_parse_inst_t *)&cmd_vf_tc_min_bw,
 	(cmdline_parse_inst_t *)&cmd_vf_tc_max_bw,
+	(cmdline_parse_inst_t *)&cmd_strict_link_prio,
 	NULL,
 };
 
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 7d965e2..de4e8a5 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -907,6 +907,13 @@ Set a TC's TX max absolute bandwidth (Mbps) for a VF from PF::
 
    testpmd> set vf tc tx max-bandwidth (port_id) (vf_id) (tc_no) (max_bandwidth)
 
+set tc strict link priority mode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set some TCs' strict link priority mode on a physical port::
+
+   testpmd> set tx strict-link-priority (port_id) (tc_bitmap)
+
 set flow_ctrl rx
 ~~~~~~~~~~~~~~~~
 
-- 
1.9.3

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (7 preceding siblings ...)
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode Wenzhuo Lu
@ 2017-02-24  6:55 ` Stephen Hemminger
  2017-02-24  7:23   ` Lu, Wenzhuo
  2017-03-27 15:13 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Ferruh Yigit
  9 siblings, 1 reply; 24+ messages in thread
From: Stephen Hemminger @ 2017-02-24  6:55 UTC (permalink / raw)
  To: Wenzhuo Lu; +Cc: dev

On Fri, 24 Feb 2017 11:24:27 +0800
Wenzhuo Lu <wenzhuo.lu@intel.com> wrote:

> This patch set enables several QoS features on i40e.
> 1, VF max bandwidth setting.
> 2, TC min bandwidth setting on a VF.
> 3, TC max bandwidth setting on a VF.
> 4, TC TX scheduling mode setting.
> As there're no new interface between PF and VF defined, all the settings
> for VF are done on PF. PF acts as a controller for the VFs.
> 
> Wenzhuo Lu (8):
>   net/i40e: set VF max bandwidth from PF
>   net/i40e: allocate VF TC bandwidth from PF
>   net/i40e: set VF TC max bandwidth from PF
>   net/i40e: set TC strict priority mode
>   app/testpmd: set VF TX max bandwidth
>   app/testpmd: set VF TC TX min bandwidth
>   app/testpmd: set VF TC TX max bandwidth
>   app/testpmd: set TC strict link priority mode
> 
>  app/test-pmd/cmdline.c                      | 343 +++++++++++++++++++++
>  doc/guides/nics/i40e.rst                    |  21 ++
>  doc/guides/rel_notes/release_17_05.rst      |  20 ++
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  28 ++
>  drivers/net/i40e/i40e_ethdev.c              | 449 ++++++++++++++++++++++++++++
>  drivers/net/i40e/i40e_ethdev.h              |   1 +
>  drivers/net/i40e/rte_pmd_i40e.h             |  86 ++++++
>  drivers/net/i40e/rte_pmd_i40e_version.map   |  10 +
>  8 files changed, 958 insertions(+)
> 

It is good to allow setting QoS on device, but it looks like this is
a device specific API, not a generic PMD function. I don't think any
feature in DPDK should be hardcoded to one device type.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e
  2017-02-24  6:55 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Stephen Hemminger
@ 2017-02-24  7:23   ` Lu, Wenzhuo
  2017-02-24  9:14     ` [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence Vincent JARDIN
  0 siblings, 1 reply; 24+ messages in thread
From: Lu, Wenzhuo @ 2017-02-24  7:23 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, February 24, 2017 2:55 PM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e
> 
> On Fri, 24 Feb 2017 11:24:27 +0800
> Wenzhuo Lu <wenzhuo.lu@intel.com> wrote:
> 
> > This patch set enables several QoS features on i40e.
> > 1, VF max bandwidth setting.
> > 2, TC min bandwidth setting on a VF.
> > 3, TC max bandwidth setting on a VF.
> > 4, TC TX scheduling mode setting.
> > As there're no new interface between PF and VF defined, all the
> > settings for VF are done on PF. PF acts as a controller for the VFs.
> >
> > Wenzhuo Lu (8):
> >   net/i40e: set VF max bandwidth from PF
> >   net/i40e: allocate VF TC bandwidth from PF
> >   net/i40e: set VF TC max bandwidth from PF
> >   net/i40e: set TC strict priority mode
> >   app/testpmd: set VF TX max bandwidth
> >   app/testpmd: set VF TC TX min bandwidth
> >   app/testpmd: set VF TC TX max bandwidth
> >   app/testpmd: set TC strict link priority mode
> >
> >  app/test-pmd/cmdline.c                      | 343 +++++++++++++++++++++
> >  doc/guides/nics/i40e.rst                    |  21 ++
> >  doc/guides/rel_notes/release_17_05.rst      |  20 ++
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  28 ++
> >  drivers/net/i40e/i40e_ethdev.c              | 449
> ++++++++++++++++++++++++++++
> >  drivers/net/i40e/i40e_ethdev.h              |   1 +
> >  drivers/net/i40e/rte_pmd_i40e.h             |  86 ++++++
> >  drivers/net/i40e/rte_pmd_i40e_version.map   |  10 +
> >  8 files changed, 958 insertions(+)
> >
> 
> It is good to allow setting QoS on device, but it looks like this is a device
> specific API, not a generic PMD function. I don't think any feature in DPDK
> should be hardcoded to one device type.
Yes, they're private APIs.
Normally we want to support kernel PF + dpdk VF. As there's no PF - VF interface defined for QoS, These features cannot be implemented on VF now.
Have to put them on PF, and let PF play as a controller.
There's discussion about if we should rich PF host features. So, I put these functions to rte_pmd_i40e.h to show they're experimental and temporary features.

There's another thread started by Cristian for a generic QoS solution. After it's accepted and the PF-VF interfaces are defined by kernel driver. We can use a generic solution to replace this one.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence
  2017-02-24  7:23   ` Lu, Wenzhuo
@ 2017-02-24  9:14     ` Vincent JARDIN
  2017-02-28  5:04       ` Lu, Wenzhuo
  0 siblings, 1 reply; 24+ messages in thread
From: Vincent JARDIN @ 2017-02-24  9:14 UTC (permalink / raw)
  To: Lu, Wenzhuo, Stephen Hemminger; +Cc: dev

Le 24/02/2017 à 08:23, Lu, Wenzhuo a écrit :
>> It is good to allow setting QoS on device, but it looks like this is a device
>> specific API, not a generic PMD function. I don't think any feature in DPDK
>> should be hardcoded to one device type.
> Yes, they're private APIs.
> Normally we want to support kernel PF + dpdk VF. As there's no PF - VF interface defined for QoS, These features cannot be implemented on VF now.
> Have to put them on PF, and let PF play as a controller.
> There's discussion about if we should rich PF host features. So, I put these functions to rte_pmd_i40e.h to show they're experimental and temporary features.
>
> There's another thread started by Cristian for a generic QoS solution. After it's accepted and the PF-VF interfaces are defined by kernel driver. We can use a generic solution to replace this one.

Same, DPDK continues to diverge from the Linux kernel for PF 
capabilities. Intel did commit previously that you'll do some works for 
proper PF support into the kernel to avoid it. It is not happening. So, 
I would rather keep nack'ing such series unless:
   - either it is under experimental compilation option
   - either it is showing up into the kernel

Best regards,
   Vincent

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence
  2017-02-24  9:14     ` [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence Vincent JARDIN
@ 2017-02-28  5:04       ` Lu, Wenzhuo
  0 siblings, 0 replies; 24+ messages in thread
From: Lu, Wenzhuo @ 2017-02-28  5:04 UTC (permalink / raw)
  To: Vincent JARDIN, Stephen Hemminger; +Cc: dev

Hi Vincent,

> -----Original Message-----
> From: Vincent JARDIN [mailto:vincent.jardin@6wind.com]
> Sent: Friday, February 24, 2017 5:14 PM
> To: Lu, Wenzhuo; Stephen Hemminger
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel
> divergence
> 
> Le 24/02/2017 à 08:23, Lu, Wenzhuo a écrit :
> >> It is good to allow setting QoS on device, but it looks like this is
> >> a device specific API, not a generic PMD function. I don't think any
> >> feature in DPDK should be hardcoded to one device type.
> > Yes, they're private APIs.
> > Normally we want to support kernel PF + dpdk VF. As there's no PF - VF
> interface defined for QoS, These features cannot be implemented on VF now.
> > Have to put them on PF, and let PF play as a controller.
> > There's discussion about if we should rich PF host features. So, I put these
> functions to rte_pmd_i40e.h to show they're experimental and temporary
> features.
> >
> > There's another thread started by Cristian for a generic QoS solution. After it's
> accepted and the PF-VF interfaces are defined by kernel driver. We can use a
> generic solution to replace this one.
> 
> Same, DPDK continues to diverge from the Linux kernel for PF capabilities. Intel
> did commit previously that you'll do some works for proper PF support into the
> kernel to avoid it. It is not happening. So, I would rather keep nack'ing such
> series unless:
>    - either it is under experimental compilation option
Yes, they're experimental. I put the functions in the rte_pmd_i40e.h. All the functions in this file are announced experimental.

>    - either it is showing up into the kernel
We're discussing this internally in parallel.

> 
> Best regards,
>    Vincent

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
@ 2017-03-24  5:01   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:01 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:24 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF
> 
> Support setting VF max bandwidth from PF.
> User can call the API on PF to set a specific VF's max bandwidth.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC bandwidth from PF
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC " Wenzhuo Lu
@ 2017-03-24  5:10   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:10 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:24 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC bandwidth from PF
> 
> Allocate all TCs' relative bandwidth (percentage) on a specific VF.
> It can be taken as relative min bandwidth setting.
> User can call the API to set VF TC's min bandwidth from PF.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max bandwidth from PF
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max " Wenzhuo Lu
@ 2017-03-24  5:15   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:15 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max bandwidth from PF
> 
> Set a specific TC's max bandwidth on a VF.
> User can call the API to set VF TC's max bandwidth from PF.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode Wenzhuo Lu
@ 2017-03-24  5:19   ` Wu, Jingjing
  2017-03-24  7:07     ` Lu, Wenzhuo
  0 siblings, 1 reply; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:19 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
> 
> Set some TCs to strict priority mode.
> It's a global setting on a physical port.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> ---
>  doc/guides/nics/i40e.rst                  |  10 +++
>  doc/guides/rel_notes/release_17_05.rst    |   7 ++
>  drivers/net/i40e/i40e_ethdev.c            | 119
> ++++++++++++++++++++++++++++++
>  drivers/net/i40e/i40e_ethdev.h            |   1 +
>  drivers/net/i40e/rte_pmd_i40e.h           |  15 ++++
>  drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
>  6 files changed, 153 insertions(+)
> 
> diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index
> 260287e..361d9d9 100644
> --- a/doc/guides/nics/i40e.rst
> +++ b/doc/guides/nics/i40e.rst
> @@ -478,3 +478,13 @@ enabled. If so, return failure.
>  When enabling per TC max bandwidth, SW will check if per VF max bandwidth
> is enabled. If so, disable per VF max bandwidth and continue with per TC max
> bandwidth setting.
> +
> +TC TX scheduling mode setting
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +There're 2 TX scheduling modes for TCs, round robin and strict priority mode.
> +If a TC is set to strict priority mode, it can consume unlimited bandwidth.
> +It means if APP has set the max bandwidth for that TC, it comes to no
> +effect.
> +It's suggested to set the strict priority mode for a TC that is latency
> +sensitive but no consuming much bandwidth.
> diff --git a/doc/guides/rel_notes/release_17_05.rst
> b/doc/guides/rel_notes/release_17_05.rst
> index d31435c..99811a2 100644
> --- a/doc/guides/rel_notes/release_17_05.rst
> +++ b/doc/guides/rel_notes/release_17_05.rst
> @@ -55,6 +55,13 @@ New Features
>    i40e HW supports to set the max bandwidth for a TC on a VF. Enable this
>    capability.
> 
> +* **Added TC strict priority mode setting on i40e.**
> +
> +  There're 2 TX scheduling modes supported for TCs by i40e HW, round
> + ribon mode  and strict priority mode. By default it's round robin
> + mode. Enable the  capability to change the TX scheduling mode for a
> + TC. It's a global setting  on a physical port.
> +
>  Resolved Issues


> +	if (!veb->strict_prio_tc)
> +		ret = i40e_aq_config_switch_comp_ets(
> +			hw, veb->uplink_seid,
> +			&ets_data, i40e_aqc_opc_enable_switching_comp_ets,
> +			NULL);

How about to check the tc_map when the first time to set strict_prio_tc?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth Wenzhuo Lu
@ 2017-03-24  5:21   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:21 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth
> 
> Add CLI to set a specific VF's TX max bandwidth from PF.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth Wenzhuo Lu
@ 2017-03-24  5:22   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:22 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth
> 
> Add CLI to set TCs' min bandwidth on a specific VF from PF.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth Wenzhuo Lu
@ 2017-03-24  5:22   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:22 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth
> 
> Add CLI to set a specific TC's max bandwidth on a specific VF from PF.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode
  2017-02-24  3:24 ` [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode Wenzhuo Lu
@ 2017-03-24  5:23   ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  5:23 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev; +Cc: Lu, Wenzhuo



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> Sent: Friday, February 24, 2017 11:25 AM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Subject: [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode
> 
> Add a CLI to set some TCs' strict link priority mode on a physical port.
> 
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>


Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
  2017-03-24  5:19   ` Wu, Jingjing
@ 2017-03-24  7:07     ` Lu, Wenzhuo
  2017-03-24  9:34       ` Wu, Jingjing
  0 siblings, 1 reply; 24+ messages in thread
From: Lu, Wenzhuo @ 2017-03-24  7:07 UTC (permalink / raw)
  To: Wu, Jingjing, dev

Hi Jingjing,

> -----Original Message-----
> From: Wu, Jingjing
> Sent: Friday, March 24, 2017 1:20 PM
> To: Lu, Wenzhuo; dev@dpdk.org
> Cc: Lu, Wenzhuo
> Subject: RE: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> > Sent: Friday, February 24, 2017 11:25 AM
> > To: dev@dpdk.org
> > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > Subject: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
> >
> > Set some TCs to strict priority mode.
> > It's a global setting on a physical port.
> >
> > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > ---
> >  doc/guides/nics/i40e.rst                  |  10 +++
> >  doc/guides/rel_notes/release_17_05.rst    |   7 ++
> >  drivers/net/i40e/i40e_ethdev.c            | 119
> > ++++++++++++++++++++++++++++++
> >  drivers/net/i40e/i40e_ethdev.h            |   1 +
> >  drivers/net/i40e/rte_pmd_i40e.h           |  15 ++++
> >  drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
> >  6 files changed, 153 insertions(+)
> >
> > diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst index
> > 260287e..361d9d9 100644
> > --- a/doc/guides/nics/i40e.rst
> > +++ b/doc/guides/nics/i40e.rst
> > @@ -478,3 +478,13 @@ enabled. If so, return failure.
> >  When enabling per TC max bandwidth, SW will check if per VF max
> > bandwidth is enabled. If so, disable per VF max bandwidth and continue
> > with per TC max bandwidth setting.
> > +
> > +TC TX scheduling mode setting
> > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > +
> > +There're 2 TX scheduling modes for TCs, round robin and strict priority
> mode.
> > +If a TC is set to strict priority mode, it can consume unlimited bandwidth.
> > +It means if APP has set the max bandwidth for that TC, it comes to no
> > +effect.
> > +It's suggested to set the strict priority mode for a TC that is
> > +latency sensitive but no consuming much bandwidth.
> > diff --git a/doc/guides/rel_notes/release_17_05.rst
> > b/doc/guides/rel_notes/release_17_05.rst
> > index d31435c..99811a2 100644
> > --- a/doc/guides/rel_notes/release_17_05.rst
> > +++ b/doc/guides/rel_notes/release_17_05.rst
> > @@ -55,6 +55,13 @@ New Features
> >    i40e HW supports to set the max bandwidth for a TC on a VF. Enable this
> >    capability.
> >
> > +* **Added TC strict priority mode setting on i40e.**
> > +
> > +  There're 2 TX scheduling modes supported for TCs by i40e HW, round
> > + ribon mode  and strict priority mode. By default it's round robin
> > + mode. Enable the  capability to change the TX scheduling mode for a
> > + TC. It's a global setting  on a physical port.
> > +
> >  Resolved Issues
> 
> 
> > +	if (!veb->strict_prio_tc)
> > +		ret = i40e_aq_config_switch_comp_ets(
> > +			hw, veb->uplink_seid,
> > +			&ets_data,
> i40e_aqc_opc_enable_switching_comp_ets,
> > +			NULL);
> 
> How about to check the tc_map when the first time to set strict_prio_tc?
Thanks for the comment. I didn't consider that before.
But I checked my patch, in the previous code, I've checked if tc_map is equal to strict_prio_tc. So if it's the first time to set strict_prio_tc, tc_map cannot be 0. Lucky :)

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
  2017-03-24  7:07     ` Lu, Wenzhuo
@ 2017-03-24  9:34       ` Wu, Jingjing
  0 siblings, 0 replies; 24+ messages in thread
From: Wu, Jingjing @ 2017-03-24  9:34 UTC (permalink / raw)
  To: Lu, Wenzhuo, dev



> -----Original Message-----
> From: Lu, Wenzhuo
> Sent: Friday, March 24, 2017 3:07 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org
> Subject: RE: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode
> 
> Hi Jingjing,
> 
> > -----Original Message-----
> > From: Wu, Jingjing
> > Sent: Friday, March 24, 2017 1:20 PM
> > To: Lu, Wenzhuo; dev@dpdk.org
> > Cc: Lu, Wenzhuo
> > Subject: RE: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority
> > mode
> >
> >
> >
> > > -----Original Message-----
> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu
> > > Sent: Friday, February 24, 2017 11:25 AM
> > > To: dev@dpdk.org
> > > Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> > > Subject: [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority
> > > mode
> > >
> > > Set some TCs to strict priority mode.
> > > It's a global setting on a physical port.
> > >
> > > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > > ---
> > >  doc/guides/nics/i40e.rst                  |  10 +++
> > >  doc/guides/rel_notes/release_17_05.rst    |   7 ++
> > >  drivers/net/i40e/i40e_ethdev.c            | 119
> > > ++++++++++++++++++++++++++++++
> > >  drivers/net/i40e/i40e_ethdev.h            |   1 +
> > >  drivers/net/i40e/rte_pmd_i40e.h           |  15 ++++
> > >  drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
> > >  6 files changed, 153 insertions(+)
> > >
> > > diff --git a/doc/guides/nics/i40e.rst b/doc/guides/nics/i40e.rst
> > > index
> > > 260287e..361d9d9 100644
> > > --- a/doc/guides/nics/i40e.rst
> > > +++ b/doc/guides/nics/i40e.rst
> > > @@ -478,3 +478,13 @@ enabled. If so, return failure.
> > >  When enabling per TC max bandwidth, SW will check if per VF max
> > > bandwidth is enabled. If so, disable per VF max bandwidth and
> > > continue with per TC max bandwidth setting.
> > > +
> > > +TC TX scheduling mode setting
> > > +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > +
> > > +There're 2 TX scheduling modes for TCs, round robin and strict
> > > +priority
> > mode.
> > > +If a TC is set to strict priority mode, it can consume unlimited bandwidth.
> > > +It means if APP has set the max bandwidth for that TC, it comes to
> > > +no effect.
> > > +It's suggested to set the strict priority mode for a TC that is
> > > +latency sensitive but no consuming much bandwidth.
> > > diff --git a/doc/guides/rel_notes/release_17_05.rst
> > > b/doc/guides/rel_notes/release_17_05.rst
> > > index d31435c..99811a2 100644
> > > --- a/doc/guides/rel_notes/release_17_05.rst
> > > +++ b/doc/guides/rel_notes/release_17_05.rst
> > > @@ -55,6 +55,13 @@ New Features
> > >    i40e HW supports to set the max bandwidth for a TC on a VF. Enable this
> > >    capability.
> > >
> > > +* **Added TC strict priority mode setting on i40e.**
> > > +
> > > +  There're 2 TX scheduling modes supported for TCs by i40e HW,
> > > + round ribon mode  and strict priority mode. By default it's round
> > > + robin mode. Enable the  capability to change the TX scheduling
> > > + mode for a TC. It's a global setting  on a physical port.
> > > +
> > >  Resolved Issues
> >
> >
> > > +	if (!veb->strict_prio_tc)
> > > +		ret = i40e_aq_config_switch_comp_ets(
> > > +			hw, veb->uplink_seid,
> > > +			&ets_data,
> > i40e_aqc_opc_enable_switching_comp_ets,
> > > +			NULL);
> >
> > How about to check the tc_map when the first time to set strict_prio_tc?
> Thanks for the comment. I didn't consider that before.
> But I checked my patch, in the previous code, I've checked if tc_map is equal to
> strict_prio_tc. So if it's the first time to set strict_prio_tc, tc_map cannot be 0.
> Lucky :)

OK. Then I'm fine to ACK this patch.

Acked-by Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [dpdk-dev] [PATCH 0/8] QoS features on i40e
  2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
                   ` (8 preceding siblings ...)
  2017-02-24  6:55 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Stephen Hemminger
@ 2017-03-27 15:13 ` Ferruh Yigit
  9 siblings, 0 replies; 24+ messages in thread
From: Ferruh Yigit @ 2017-03-27 15:13 UTC (permalink / raw)
  To: Wenzhuo Lu, dev

On 2/24/2017 3:24 AM, Wenzhuo Lu wrote:
> This patch set enables several QoS features on i40e.
> 1, VF max bandwidth setting.
> 2, TC min bandwidth setting on a VF.
> 3, TC max bandwidth setting on a VF.
> 4, TC TX scheduling mode setting.
> As there're no new interface between PF and VF defined, all the settings
> for VF are done on PF. PF acts as a controller for the VFs.
> 
> Wenzhuo Lu (8):
>   net/i40e: set VF max bandwidth from PF
>   net/i40e: allocate VF TC bandwidth from PF
>   net/i40e: set VF TC max bandwidth from PF
>   net/i40e: set TC strict priority mode
>   app/testpmd: set VF TX max bandwidth
>   app/testpmd: set VF TC TX min bandwidth
>   app/testpmd: set VF TC TX max bandwidth
>   app/testpmd: set TC strict link priority mode

Series applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2017-03-27 15:13 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-24  3:24 [dpdk-dev] [PATCH 0/8] QoS features on i40e Wenzhuo Lu
2017-02-24  3:24 ` [dpdk-dev] [PATCH 1/8] net/i40e: set VF max bandwidth from PF Wenzhuo Lu
2017-03-24  5:01   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 2/8] net/i40e: allocate VF TC " Wenzhuo Lu
2017-03-24  5:10   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 3/8] net/i40e: set VF TC max " Wenzhuo Lu
2017-03-24  5:15   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 4/8] net/i40e: set TC strict priority mode Wenzhuo Lu
2017-03-24  5:19   ` Wu, Jingjing
2017-03-24  7:07     ` Lu, Wenzhuo
2017-03-24  9:34       ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 5/8] app/testpmd: set VF TX max bandwidth Wenzhuo Lu
2017-03-24  5:21   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 6/8] app/testpmd: set VF TC TX min bandwidth Wenzhuo Lu
2017-03-24  5:22   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 7/8] app/testpmd: set VF TC TX max bandwidth Wenzhuo Lu
2017-03-24  5:22   ` Wu, Jingjing
2017-02-24  3:24 ` [dpdk-dev] [PATCH 8/8] app/testpmd: set TC strict link priority mode Wenzhuo Lu
2017-03-24  5:23   ` Wu, Jingjing
2017-02-24  6:55 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Stephen Hemminger
2017-02-24  7:23   ` Lu, Wenzhuo
2017-02-24  9:14     ` [dpdk-dev] [PATCH 0/8] QoS features on i40e - Linux kernel divergence Vincent JARDIN
2017-02-28  5:04       ` Lu, Wenzhuo
2017-03-27 15:13 ` [dpdk-dev] [PATCH 0/8] QoS features on i40e Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).