DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
@ 2016-12-09 11:27 Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
                   ` (15 more replies)
  0 siblings, 16 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (5):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
 app/test-pmd/config.c                       |  31 ++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 6 files changed, 678 insertions(+), 21 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
@ 2016-12-09 11:27 ` Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions Bernard Iremonger
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 ++++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 377 insertions(+)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..f863cf4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -4883,6 +4883,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
@ 2016-12-09 11:27 ` Bernard Iremonger
  2016-12-09 11:56   ` Ferruh Yigit
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
                   ` (13 subsequent siblings)
  15 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c |  2 +-
 app/test-pmd/config.c  | 31 +++++++++++--------------------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..12f799b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6708,7 +6708,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..ea129db 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2332,16 +2335,16 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,10 +2358,10 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 
@@ -2388,23 +2391,11 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
-- 
2.10.1

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

* [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions Bernard Iremonger
@ 2016-12-09 11:27 ` Bernard Iremonger
  2016-12-09 12:02   ` Ferruh Yigit
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 4/5] app/testpmd: add command for set VF receive Bernard Iremonger
                   ` (12 subsequent siblings)
  15 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Add the following command to testpmd:
set vf vlan filter <port_id> <vlan_id> <vf_mask> <on|off>

Add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 98 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 105 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12f799b..3603526 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -291,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN antispoof for a VF from the PF.\n\n"
+
+			"set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)\n"
+			"    Set VLAN filter for a VF pool from the PF.\n\n"
 #endif
 
 			"vlan set filter (on|off) (port_id)\n"
@@ -11139,6 +11142,100 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = {
 	},
 };
 
+
+/* vf vlan filter configuration */
+
+/* Common result structure for vf vlan filter */
+struct cmd_vf_vlan_filter_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t vlan;
+	cmdline_fixed_string_t filter;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	uint16_t vf_mask;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan filter enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_filter_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vlan =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_filter =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 filter, "filter");
+cmdline_parse_token_num_t cmd_vf_vlan_filter_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vlan_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vf_mask =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf_mask, UINT16);
+cmdline_parse_token_string_t cmd_vf_vlan_filter_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_filter_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_vlan_filter_result *res = parsed_result;
+	int ret;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_vlan_filter(res->port_id, res->vlan_id, res->vf_mask, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_mask %d or vlan_id %d\n", res->vf_mask, res->vlan_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
+	.f = cmd_set_vf_vlan_filter_parsed,
+	.data = NULL,
+	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> <on_off>",
+	.tokens = {
+		(void *)&cmd_vf_vlan_filter_set,
+		(void *)&cmd_vf_vlan_filter_vf,
+		(void *)&cmd_vf_vlan_filter_vlan,
+		(void *)&cmd_vf_vlan_filter_filter,
+		(void *)&cmd_vf_vlan_filter_port_id,
+		(void *)&cmd_vf_vlan_filter_vlan_id,
+		(void *)&cmd_vf_vlan_filter_vf_mask,
+		(void *)&cmd_vf_vlan_filter_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11620,6 +11717,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
+	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_set_tx_loopback,
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f1c269a..60dcd91 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -535,6 +535,13 @@ Set VLAN insert for a VF from the PF::
 
    testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
 
+vlan set filter (for VF pool)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN filter for a VF pool from the PF::
+
+   testpmd> set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)
+
 vlan set antispoof (for VF)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v1 4/5] app/testpmd: add command for set VF receive
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (2 preceding siblings ...)
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
@ 2016-12-09 11:27 ` Bernard Iremonger
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 5/5] app/testpmd: add command for set VF transmit Bernard Iremonger
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf rx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 3603526..4605ee2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -274,6 +274,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
 			"    Set MAC antispoof for a VF from the PF.\n\n"
+
+			"set vf rx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable RX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11236,6 +11239,87 @@ cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
 	},
 };
 
+/* vf rx configuration */
+
+/* Common result structure for vf rx */
+struct cmd_vf_rx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t rx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf rx enable disable */
+cmdline_parse_token_string_t cmd_vf_rx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_rx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_rx_rx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 rx, "rx");
+cmdline_parse_token_num_t cmd_vf_rx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_rx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_rx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_rx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_rx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_rx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_rx = {
+	.f = cmd_set_vf_rx_parsed,
+	.data = NULL,
+	.help_str = "set vf rx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_rx_set,
+		(void *)&cmd_vf_rx_vf,
+		(void *)&cmd_vf_rx_rx,
+		(void *)&cmd_vf_rx_port_id,
+		(void *)&cmd_vf_rx_vf_id,
+		(void *)&cmd_vf_rx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11722,6 +11806,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 60dcd91..6a058e9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -507,6 +507,13 @@ Set mac antispoof for a VF from the PF::
 
    testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
 
+set rx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable rx for a VF from the PF::
+
+   testpmd> set vf rx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v1 5/5] app/testpmd: add command for set VF transmit
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (3 preceding siblings ...)
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 4/5] app/testpmd: add command for set VF receive Bernard Iremonger
@ 2016-12-09 11:27 ` Bernard Iremonger
  2016-12-09 11:54 ` [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Ferruh Yigit
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:27 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf tx <port_id> <vf_id> <on|off>

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4605ee2..e813b24 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -277,6 +277,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf rx (port_id) (vf_id) (on|off).\n"
 			"    Enable or disable RX for a VF from the PF.\n\n"
+
+			"set vf tx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable TX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11320,6 +11323,87 @@ cmdline_parse_inst_t cmd_set_vf_rx = {
 	},
 };
 
+/* vf tx configuration */
+
+/* Common result structure for vf tx */
+struct cmd_vf_tx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf tx enable disable */
+cmdline_parse_token_string_t cmd_vf_tx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tx_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 tx, "tx");
+cmdline_parse_token_num_t cmd_vf_tx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_tx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_tx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_tx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_tx = {
+	.f = cmd_set_vf_tx_parsed,
+	.data = NULL,
+	.help_str = "set vf tx <port_id> <vf_id> <on|off>",
+	.tokens = {
+		(void *)&cmd_vf_tx_set,
+		(void *)&cmd_vf_tx_vf,
+		(void *)&cmd_vf_tx_tx,
+		(void *)&cmd_vf_tx_port_id,
+		(void *)&cmd_vf_tx_vf_id,
+		(void *)&cmd_vf_tx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11807,6 +11891,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
 	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
+	(cmdline_parse_inst_t *)&cmd_set_vf_tx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 6a058e9..1de4c5f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -514,6 +514,13 @@ Enable/disable rx for a VF from the PF::
 
    testpmd> set vf rx (port_id) (vf_id) (on|off)
 
+set tx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable tx for a VF from the PF::
+
+   testpmd> set vf tx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (4 preceding siblings ...)
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 5/5] app/testpmd: add command for set VF transmit Bernard Iremonger
@ 2016-12-09 11:54 ` Ferruh Yigit
  2016-12-09 12:00   ` Iremonger, Bernard
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-09 11:54 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> This patchset implements the following deprecation notice:
> [PATCH v1] doc: announce API and ABI change for librte_ether
> 
> The following functions from eth_dev_ops have been moved to the ixgbe PMD
> and renamed:
> 
> ixgbe_set_pool_rx_mode
> ixgbe_set_pool_rx
> ixgbe_set_pool_tx
> ixgbe_set_pool_vlan_filter
> ixgbe_set_vf_rate_limit
> 
> Renamed the functions to the following:
> 
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> Testpmd has been modified to use the following functions:
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> New testpmd commands have been added to test the following functions:
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> 
> The testpmd user guide has been updated for the new commands.
> 
> Bernard Iremonger (5):
>   net/ixgbe: move set VF functions from the ethdev
>   app/testpmd: use ixgbe public functions
>   app/testpmd: add command for set VF VLAN filter
>   app/testpmd: add command for set VF receive
>   app/testpmd: add command for set VF transmit
> 
>  app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
>  app/test-pmd/config.c                       |  31 ++--
>  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
>  drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
>  drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
>  drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
>  6 files changed, 678 insertions(+), 21 deletions(-)
> 

Why this patchset doesn't remove ethdev updates for these functions?

ixgbe is the only user for these eth-dev_ops, since code moved to ixgbe
driver, they and relevant rte_eth_xx functions (and deprecation notice)
can be removed in this patchset. Most probably after testpmd updated to
prevent compilation errors.

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

* Re: [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions Bernard Iremonger
@ 2016-12-09 11:56   ` Ferruh Yigit
  2016-12-09 12:08     ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-09 11:56 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> Use the the following ixgbe public functions:
> 
> rte_pmd_ixgbe_set_vf_rate_limit
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

<...>

> @@ -2388,23 +2391,11 @@ int
>  set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
>  {
>  	int diag;
> -	struct rte_eth_link link;
> -
> -	if (q_msk == 0)
> -		return 0;
>  
> -	if (port_id_is_invalid(port_id, ENABLED_WARN))
> -		return 1;
> -	rte_eth_link_get_nowait(port_id, &link);
> -	if (rate > link.link_speed) {
> -		printf("Invalid rate value:%u bigger than link speed: %u\n",
> -			rate, link.link_speed);
> -		return 1;
> -	}

Why these changes required? Isn't only change is location and naming of
the ...set_vf_rate_limit() ?

> -	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
> +	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
>  	if (diag == 0)
>  		return diag;
> -	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
> +	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
>  		port_id, diag);
>  	return diag;
>  }
> 

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

* Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
  2016-12-09 11:54 ` [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Ferruh Yigit
@ 2016-12-09 12:00   ` Iremonger, Bernard
  2016-12-09 13:04     ` Thomas Monjalon
  0 siblings, 1 reply; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-09 12:00 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev; +Cc: Iremonger, Bernard

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Friday, December 9, 2016 11:54 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
> 
> On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> > This patchset implements the following deprecation notice:
> > [PATCH v1] doc: announce API and ABI change for librte_ether
> >
> > The following functions from eth_dev_ops have been moved to the ixgbe
> > PMD and renamed:
> >
> > ixgbe_set_pool_rx_mode
> > ixgbe_set_pool_rx
> > ixgbe_set_pool_tx
> > ixgbe_set_pool_vlan_filter
> > ixgbe_set_vf_rate_limit
> >
> > Renamed the functions to the following:
> >
> > rte_pmd_ixgbe_set_vf_rxmode
> > rte_pmd_ixgbe_set_vf_rx
> > rte_pmd_ixgbe_set_vf_tx
> > rte_pmd_ixgbe_set_vf_vlan_filter
> > rte_pmd_ixgbe_set_vf_rate_limit
> >
> > Testpmd has been modified to use the following functions:
> > rte_pmd_ixgbe_set_vf_rxmode
> > rte_pmd_ixgbe_set_vf_rate_limit
> >
> > New testpmd commands have been added to test the following functions:
> > rte_pmd_ixgbe_set_vf_rx
> > rte_pmd_ixgbe_set_vf_tx
> > rte_pmd_ixgbe_set_vf_vlan_filter
> >
> > The testpmd user guide has been updated for the new commands.
> >
> > Bernard Iremonger (5):
> >   net/ixgbe: move set VF functions from the ethdev
> >   app/testpmd: use ixgbe public functions
> >   app/testpmd: add command for set VF VLAN filter
> >   app/testpmd: add command for set VF receive
> >   app/testpmd: add command for set VF transmit
> >
> >  app/test-pmd/cmdline.c                      | 270
> +++++++++++++++++++++++++++-
> >  app/test-pmd/config.c                       |  31 ++--
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
> >  drivers/net/ixgbe/ixgbe_ethdev.c            | 263
> +++++++++++++++++++++++++++
> >  drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
> >  drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
> >  6 files changed, 678 insertions(+), 21 deletions(-)
> >
> 
> Why this patchset doesn't remove ethdev updates for these functions?
> 
> ixgbe is the only user for these eth-dev_ops, since code moved to ixgbe
> driver, they and relevant rte_eth_xx functions (and deprecation notice) can
> be removed in this patchset. Most probably after testpmd updated to
> prevent compilation errors.

My understanding is that the functions should be copied and reworked before being removed from the ethdev, and that the removal should be done in a separate patch set.

Hi Thomas,

Could you clarify please.

Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter
  2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
@ 2016-12-09 12:02   ` Ferruh Yigit
  2016-12-09 12:10     ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-09 12:02 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> Add the following command to testpmd:
> set vf vlan filter <port_id> <vlan_id> <vf_mask> <on|off>
> 
> Add command to the testpmd user guide.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---

<...>

> +
> +cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
> +	.f = cmd_set_vf_vlan_filter_parsed,
> +	.data = NULL,
> +	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> <on_off>",

s/<on_off>/on|off

Only variables should be wrapped with "<>", fixed string with options
can be used as a|b|c .

similar issues in other testpmd patches.

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

* Re: [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions
  2016-12-09 11:56   ` Ferruh Yigit
@ 2016-12-09 12:08     ` Iremonger, Bernard
  0 siblings, 0 replies; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-09 12:08 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Friday, December 9, 2016 11:57 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public
> functions
> 
> On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> > Use the the following ixgbe public functions:
> >
> > rte_pmd_ixgbe_set_vf_rate_limit
> > rte_pmd_ixgbe_set_vf_rx
> > rte_pmd_ixgbe_set_vf_rxmode
> > rte_pmd_ixgbe_set_vf_tx
> > rte_pmd_ixgbe_set_vf_vlan_filter
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> 
> <...>
> 
> > @@ -2388,23 +2391,11 @@ int
> >  set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate,
> > uint64_t q_msk)  {
> >  	int diag;
> > -	struct rte_eth_link link;
> > -
> > -	if (q_msk == 0)
> > -		return 0;
> >
> > -	if (port_id_is_invalid(port_id, ENABLED_WARN))
> > -		return 1;
> > -	rte_eth_link_get_nowait(port_id, &link);
> > -	if (rate > link.link_speed) {
> > -		printf("Invalid rate value:%u bigger than link speed: %u\n",
> > -			rate, link.link_speed);
> > -		return 1;
> > -	}
> 
> Why these changes required? Isn't only change is location and naming of the
> ...set_vf_rate_limit() ?

This change is a cleanup as the parameter checking is now done in rte_pmd_ixgbe_set_vf_rate_limit().
It was not possible to test the parameter checking in rte_pmd_ixgbe_set_vf_rate_limit() if the parameters were checked in  the set_vf_rate_limit() function.

> 
> > -	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
> > +	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
> >  	if (diag == 0)
> >  		return diag;
> > -	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
> > +	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed
> > +diag=%d\n",
> >  		port_id, diag);
> >  	return diag;
> >  }
> >

Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter
  2016-12-09 12:02   ` Ferruh Yigit
@ 2016-12-09 12:10     ` Iremonger, Bernard
  0 siblings, 0 replies; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-09 12:10 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Friday, December 9, 2016 12:03 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set
> VF VLAN filter
> 
> On 12/9/2016 11:27 AM, Bernard Iremonger wrote:
> > Add the following command to testpmd:
> > set vf vlan filter <port_id> <vlan_id> <vf_mask> <on|off>
> >
> > Add command to the testpmd user guide.
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> 
> <...>
> 
> > +
> > +cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
> > +	.f = cmd_set_vf_vlan_filter_parsed,
> > +	.data = NULL,
> > +	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask>
> > +<on_off>",
> 
> s/<on_off>/on|off
> 
> Only variables should be wrapped with "<>", fixed string with options can be
> used as a|b|c .
> 
> similar issues in other testpmd patches.
> 

I will fix in a v2.

Regards,

Bernard.

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

* Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
  2016-12-09 12:00   ` Iremonger, Bernard
@ 2016-12-09 13:04     ` Thomas Monjalon
  2016-12-09 13:23       ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Thomas Monjalon @ 2016-12-09 13:04 UTC (permalink / raw)
  To: Iremonger, Bernard; +Cc: Yigit, Ferruh, dev

2016-12-09 12:00, Iremonger, Bernard:
> From: Yigit, Ferruh
> > Why this patchset doesn't remove ethdev updates for these functions?
> > 
> > ixgbe is the only user for these eth-dev_ops, since code moved to ixgbe
> > driver, they and relevant rte_eth_xx functions (and deprecation notice) can
> > be removed in this patchset. Most probably after testpmd updated to
> > prevent compilation errors.
> 
> My understanding is that the functions should be copied and reworked before being removed from the ethdev, and that the removal should be done in a separate patch set.
> 
> Hi Thomas,
> 
> Could you clarify please.

It was announced that these functions will be removed,
so they can be safely removed in 17.02, right?
In this case, it is a code move: copy, rework and delete in the same patch.
And yes, the deprecation notice must be removed at the same time.

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

* Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
  2016-12-09 13:04     ` Thomas Monjalon
@ 2016-12-09 13:23       ` Iremonger, Bernard
  0 siblings, 0 replies; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-09 13:23 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Yigit, Ferruh, dev

Hi Thomas,

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, December 9, 2016 1:05 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
> 
> 2016-12-09 12:00, Iremonger, Bernard:
> > From: Yigit, Ferruh
> > > Why this patchset doesn't remove ethdev updates for these functions?
> > >
> > > ixgbe is the only user for these eth-dev_ops, since code moved to
> > > ixgbe driver, they and relevant rte_eth_xx functions (and
> > > deprecation notice) can be removed in this patchset. Most probably
> > > after testpmd updated to prevent compilation errors.
> >
> > My understanding is that the functions should be copied and reworked
> before being removed from the ethdev, and that the removal should be
> done in a separate patch set.
> >
> > Hi Thomas,
> >
> > Could you clarify please.
> 
> It was announced that these functions will be removed, so they can be safely
> removed in 17.02, right?

Yes, it was announced in 16.11 that these functions will be removed so I believe they can be safely removed in17.02.

> In this case, it is a code move: copy, rework and delete in the same patch.
> And yes, the deprecation notice must be removed at the same time.


I will add the deletes in a v2 of the patchset.

Regards,

Bernard.

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

* [dpdk-dev] [PATCH v2 0/9] net/ixgbe: move set VF functions.
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (5 preceding siblings ...)
  2016-12-09 11:54 ` [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Ferruh Yigit
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                     ` (9 more replies)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
                   ` (8 subsequent siblings)
  15 siblings, 10 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

Changes in V2:
Update testpmd set vf commands help messages.
Updated ethtool to use the ixgbe public API's.
Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
Removed the rte_eth_dev_set_vf_* API's
Removed the deprecation notice.

Changes in V1:
The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (9):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit
  examples/ethtool: use ixgbe public function
  net/ixgbe: remove static set VF functions
  librte_ether: remove the set VF API's
  doc: remove deprecation notice

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++-
 app/test-pmd/config.c                       |  31 +-
 doc/guides/rel_notes/deprecation.rst        |  13 -
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 ++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 459 ++++++++++++++++------------
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 +
 examples/ethtool/lib/rte_ethtool.c          |   5 +-
 lib/librte_ether/rte_ethdev.c               | 129 --------
 lib/librte_ether/rte_ethdev.h               |  33 --
 10 files changed, 683 insertions(+), 392 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 1/9] net/ixgbe: move set VF functions from the ethdev
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (6 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Use public function internally

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 266 +++++++++++++++++++++++++++-
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 379 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..37b82a4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2294,7 +2294,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 		for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
 			for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
 				if (vfinfo[vf].tx_rate[idx] != 0)
-					ixgbe_set_vf_rate_limit(dev, vf,
+					rte_pmd_ixgbe_set_vf_rate_limit(
+						dev->data->port_id, vf,
 						vfinfo[vf].tx_rate[idx],
 						1 << idx);
 	}
@@ -4883,6 +4884,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 2/9] app/testpmd: use ixgbe public functions
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (7 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c |  2 +-
 app/test-pmd/config.c  | 31 +++++++++++--------------------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..12f799b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6708,7 +6708,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..ea129db 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2332,16 +2335,16 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,10 +2358,10 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 
@@ -2388,23 +2391,11 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 3/9] app/testpmd: add command for set VF VLAN filter
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (8 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Add the following command to testpmd:
set vf vlan filter <port_id> <vlan_id> <vf_mask> on|off

Add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 98 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 105 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12f799b..947c698 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -291,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN antispoof for a VF from the PF.\n\n"
+
+			"set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)\n"
+			"    Set VLAN filter for a VF pool from the PF.\n\n"
 #endif
 
 			"vlan set filter (on|off) (port_id)\n"
@@ -11139,6 +11142,100 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = {
 	},
 };
 
+
+/* vf vlan filter configuration */
+
+/* Common result structure for vf vlan filter */
+struct cmd_vf_vlan_filter_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t vlan;
+	cmdline_fixed_string_t filter;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	uint16_t vf_mask;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan filter enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_filter_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vlan =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_filter =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 filter, "filter");
+cmdline_parse_token_num_t cmd_vf_vlan_filter_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vlan_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vf_mask =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf_mask, UINT16);
+cmdline_parse_token_string_t cmd_vf_vlan_filter_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_filter_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_vlan_filter_result *res = parsed_result;
+	int ret;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_vlan_filter(res->port_id, res->vlan_id, res->vf_mask, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_mask %d or vlan_id %d\n", res->vf_mask, res->vlan_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
+	.f = cmd_set_vf_vlan_filter_parsed,
+	.data = NULL,
+	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> on|off",
+	.tokens = {
+		(void *)&cmd_vf_vlan_filter_set,
+		(void *)&cmd_vf_vlan_filter_vf,
+		(void *)&cmd_vf_vlan_filter_vlan,
+		(void *)&cmd_vf_vlan_filter_filter,
+		(void *)&cmd_vf_vlan_filter_port_id,
+		(void *)&cmd_vf_vlan_filter_vlan_id,
+		(void *)&cmd_vf_vlan_filter_vf_mask,
+		(void *)&cmd_vf_vlan_filter_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11620,6 +11717,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
+	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_set_tx_loopback,
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f1c269a..60dcd91 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -535,6 +535,13 @@ Set VLAN insert for a VF from the PF::
 
    testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
 
+vlan set filter (for VF pool)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN filter for a VF pool from the PF::
+
+   testpmd> set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)
+
 vlan set antispoof (for VF)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 4/9] app/testpmd: add command for set VF receive
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (9 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf rx <port_id> <vf_id> on|off

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 947c698..4424c0a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -274,6 +274,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
 			"    Set MAC antispoof for a VF from the PF.\n\n"
+
+			"set vf rx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable RX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11236,6 +11239,87 @@ cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
 	},
 };
 
+/* vf rx configuration */
+
+/* Common result structure for vf rx */
+struct cmd_vf_rx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t rx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf rx enable disable */
+cmdline_parse_token_string_t cmd_vf_rx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_rx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_rx_rx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 rx, "rx");
+cmdline_parse_token_num_t cmd_vf_rx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_rx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_rx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_rx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_rx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_rx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_rx = {
+	.f = cmd_set_vf_rx_parsed,
+	.data = NULL,
+	.help_str = "set vf rx <port_id> <vf_id> on|off",
+	.tokens = {
+		(void *)&cmd_vf_rx_set,
+		(void *)&cmd_vf_rx_vf,
+		(void *)&cmd_vf_rx_rx,
+		(void *)&cmd_vf_rx_port_id,
+		(void *)&cmd_vf_rx_vf_id,
+		(void *)&cmd_vf_rx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11722,6 +11806,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 60dcd91..6a058e9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -507,6 +507,13 @@ Set mac antispoof for a VF from the PF::
 
    testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
 
+set rx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable rx for a VF from the PF::
+
+   testpmd> set vf rx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 5/9] app/testpmd: add command for set VF transmit
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (10 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf tx <port_id> <vf_id> on|off

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4424c0a..e385732 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -277,6 +277,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf rx (port_id) (vf_id) (on|off).\n"
 			"    Enable or disable RX for a VF from the PF.\n\n"
+
+			"set vf tx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable TX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11320,6 +11323,87 @@ cmdline_parse_inst_t cmd_set_vf_rx = {
 	},
 };
 
+/* vf tx configuration */
+
+/* Common result structure for vf tx */
+struct cmd_vf_tx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf tx enable disable */
+cmdline_parse_token_string_t cmd_vf_tx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tx_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 tx, "tx");
+cmdline_parse_token_num_t cmd_vf_tx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_tx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_tx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_tx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_tx = {
+	.f = cmd_set_vf_tx_parsed,
+	.data = NULL,
+	.help_str = "set vf tx <port_id> <vf_id> on|off",
+	.tokens = {
+		(void *)&cmd_vf_tx_set,
+		(void *)&cmd_vf_tx_vf,
+		(void *)&cmd_vf_tx_tx,
+		(void *)&cmd_vf_tx_port_id,
+		(void *)&cmd_vf_tx_vf_id,
+		(void *)&cmd_vf_tx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11807,6 +11891,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
 	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
+	(cmdline_parse_inst_t *)&cmd_set_vf_tx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 6a058e9..1de4c5f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -514,6 +514,13 @@ Enable/disable rx for a VF from the PF::
 
    testpmd> set vf rx (port_id) (vf_id) (on|off)
 
+set tx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable tx for a VF from the PF::
+
+   testpmd> set vf tx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 6/9] examples/ethtool: use ixgbe public function
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (11 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 examples/ethtool/lib/rte_ethtool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index a1f91d4..0e539f7 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
 #include <rte_version.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_pmd_ixgbe.h>
 #include "rte_ethtool.h"
 
 #define PKTPOOL_SIZE 512
@@ -354,7 +355,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
 
 	/* Set VF vf_rx_mode, VF unsupport status is discard */
 	for (vf = 0; vf < num_vfs; vf++)
-		rte_eth_dev_set_vf_rxmode(port_id, vf,
+		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
 			ETH_VMDQ_ACCEPT_UNTAG, 0);
 
 	/* Enable Rx vlan filter, VF unspport status is discard */
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 7/9] net/ixgbe: remove static set VF functions
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (12 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
@ 2016-12-09 17:25 ` Bernard Iremonger
  2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's Bernard Iremonger
  2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 9/9] doc: remove deprecation notice Bernard Iremonger
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:25 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following static functions:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 193 ---------------------------------------
 1 file changed, 193 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 37b82a4..8db1410 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -276,12 +276,6 @@ static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct
 		ether_addr * mac_addr, uint8_t on);
 static int ixgbe_uc_all_hash_table_set(struct rte_eth_dev *dev, uint8_t on);
-static int  ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev,  uint16_t pool,
-		uint16_t rx_mask, uint8_t on);
-static int ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-		uint64_t pool_mask, uint8_t vlan_on);
 static int ixgbe_mirror_rule_set(struct rte_eth_dev *dev,
 		struct rte_eth_mirror_conf *mirror_conf,
 		uint8_t rule_id, uint8_t on);
@@ -297,8 +291,6 @@ static void ixgbe_configure_msix(struct rte_eth_dev *dev);
 
 static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 		uint16_t queue_idx, uint16_t tx_rate);
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-		uint16_t tx_rate, uint64_t q_msk);
 
 static void ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
 				 struct ether_addr *mac_addr,
@@ -568,12 +560,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.uc_all_hash_table_set  = ixgbe_uc_all_hash_table_set,
 	.mirror_rule_set      = ixgbe_mirror_rule_set,
 	.mirror_rule_reset    = ixgbe_mirror_rule_reset,
-	.set_vf_rx_mode       = ixgbe_set_pool_rx_mode,
-	.set_vf_rx            = ixgbe_set_pool_rx,
-	.set_vf_tx            = ixgbe_set_pool_tx,
-	.set_vf_vlan_filter   = ixgbe_set_pool_vlan_filter,
 	.set_queue_rate_limit = ixgbe_set_queue_rate_limit,
-	.set_vf_rate_limit    = ixgbe_set_vf_rate_limit,
 	.reta_update          = ixgbe_dev_rss_reta_update,
 	.reta_query           = ixgbe_dev_rss_reta_query,
 #ifdef RTE_NIC_BYPASS
@@ -4547,132 +4534,6 @@ ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val)
 	return new_val;
 }
 
-static int
-ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev, uint16_t pool,
-			       uint16_t rx_mask, uint8_t on)
-{
-	int val = 0;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool));
-
-	if (hw->mac.type == ixgbe_mac_82598EB) {
-		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
-			     " on 82599 hardware and newer");
-		return -ENOTSUP;
-	}
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
-
-	if (on)
-		vmolr |= val;
-	else
-		vmolr &= ~val;
-
-	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFRE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFRE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFTE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFTE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-			uint64_t pool_mask, uint8_t vlan_on)
-{
-	int ret = 0;
-	uint16_t pool_idx;
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-	for (pool_idx = 0; pool_idx < ETH_64_POOLS; pool_idx++) {
-		if (pool_mask & ((uint64_t)(1ULL << pool_idx))) {
-			ret = hw->mac.ops.set_vfta(hw, vlan, pool_idx,
-						   vlan_on, false);
-			if (ret < 0)
-				return ret;
-		}
-	}
-
-	return ret;
-}
 
 int
 rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
@@ -5628,60 +5489,6 @@ static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 	return 0;
 }
 
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-	uint16_t tx_rate, uint64_t q_msk)
-{
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct ixgbe_vf_info *vfinfo =
-		*(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
-	uint8_t  nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
-	uint32_t queue_stride =
-		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
-	uint32_t queue_idx = vf * queue_stride, idx = 0, vf_idx;
-	uint32_t queue_end = queue_idx + nb_q_per_pool - 1;
-	uint16_t total_rate = 0;
-
-	if (queue_end >= hw->mac.max_tx_queues)
-		return -EINVAL;
-
-	if (vfinfo != NULL) {
-		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
-			if (vf_idx == vf)
-				continue;
-			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
-				idx++)
-				total_rate += vfinfo[vf_idx].tx_rate[idx];
-		}
-	} else
-		return -EINVAL;
-
-	/* Store tx_rate for this vf. */
-	for (idx = 0; idx < nb_q_per_pool; idx++) {
-		if (((uint64_t)0x1 << idx) & q_msk) {
-			if (vfinfo[vf].tx_rate[idx] != tx_rate)
-				vfinfo[vf].tx_rate[idx] = tx_rate;
-			total_rate += tx_rate;
-		}
-	}
-
-	if (total_rate > dev->data->dev_link.link_speed) {
-		/*
-		 * Reset stored TX rate of the VF if it causes exceed
-		 * link speed.
-		 */
-		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
-		return -EINVAL;
-	}
-
-	/* Set RTTBCNRC of each queue/pool for vf X  */
-	for (; queue_idx <= queue_end; queue_idx++) {
-		if (0x1 & q_msk)
-			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
-		q_msk = q_msk >> 1;
-	}
-
-	return 0;
-}
 
 static void
 ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (13 preceding siblings ...)
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
@ 2016-12-09 17:26 ` Bernard Iremonger
  2016-12-09 18:00   ` Ferruh Yigit
  2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 9/9] doc: remove deprecation notice Bernard Iremonger
  15 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:26 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following API's:

rte_eth_dev_set_vf_rxmode
rte_eth_dev_set_vf_rx
rte_eth_dev_set_vf_tx
rte_eth_dev_set_vf_vlan_filter
rte_eth_dev_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 lib/librte_ether/rte_ethdev.c | 129 ------------------------------------------
 lib/librte_ether/rte_ethdev.h |  33 -----------
 2 files changed, 162 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 1e0f206..6a93014 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2137,32 +2137,6 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr)
 	return 0;
 }
 
-int
-rte_eth_dev_set_vf_rxmode(uint8_t port_id,  uint16_t vf,
-				uint16_t rx_mode, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:invalid VF id %d\n", vf);
-		return -EINVAL;
-	}
-
-	if (rx_mode == 0) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:mode mask ca not be zero\n");
-		return -EINVAL;
-	}
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx_mode, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx_mode)(dev, vf, rx_mode, on);
-}
 
 /*
  * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find
@@ -2252,76 +2226,6 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on)
 	return (*dev->dev_ops->uc_all_hash_table_set)(dev, on);
 }
 
-int
-rte_eth_dev_set_vf_rx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("port %d: invalid vf id\n", port_id);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_tx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set pool tx:invalid pool id=%d\n", vf);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_tx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_tx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port_id, uint16_t vlan_id,
-			       uint64_t vf_mask, uint8_t vlan_on)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-
-	if (vlan_id > ETHER_MAX_VLAN_ID) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:invalid VLAN id=%d\n",
-			vlan_id);
-		return -EINVAL;
-	}
-
-	if (vf_mask == 0) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:pool_mask can not be 0\n");
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_vlan_filter, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_vlan_filter)(dev, vlan_id,
-						   vf_mask, vlan_on);
-}
-
 int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 					uint16_t tx_rate)
 {
@@ -2352,39 +2256,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate);
 }
 
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, uint16_t tx_rate,
-				uint64_t q_msk)
-{
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-	link = dev->data->dev_link;
-
-	if (vf > dev_info.max_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:port %d: "
-				"invalid vf id=%d\n", port_id, vf);
-		return -EINVAL;
-	}
-
-	if (tx_rate > link.link_speed) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:invalid tx_rate=%d, "
-				"bigger than link speed= %d\n",
-				tx_rate, link.link_speed);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rate_limit, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rate_limit)(dev, vf, tx_rate, q_msk);
-}
-
 int
 rte_eth_mirror_rule_set(uint8_t port_id,
 			struct rte_eth_mirror_conf *mirror_conf,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..269ac77 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1249,39 +1249,11 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 				  uint8_t on);
 /**< @internal Set all Unicast Hash bitmap */
 
-typedef int (*eth_set_vf_rx_mode_t)(struct rte_eth_dev *dev,
-				  uint16_t vf,
-				  uint16_t rx_mode,
-				  uint8_t on);
-/**< @internal Set a VF receive mode */
-
-typedef int (*eth_set_vf_rx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Set a VF receive  mode */
-
-typedef int (*eth_set_vf_tx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Enable or disable a VF transmit   */
-
-typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
-				  uint16_t vlan,
-				  uint64_t vf_mask,
-				  uint8_t vlan_on);
-/**< @internal Set VF VLAN pool filter */
-
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
 				uint16_t tx_rate);
 /**< @internal Set queue TX rate */
 
-typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint16_t tx_rate,
-				uint64_t q_msk);
-/**< @internal Set VF TX rate */
-
 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
 				  struct rte_eth_mirror_conf *mirror_conf,
 				  uint8_t rule_id,
@@ -1479,16 +1451,11 @@ struct eth_dev_ops {
 	eth_uc_all_hash_table_set_t uc_all_hash_table_set;  /**< Set Unicast hash bitmap */
 	eth_mirror_rule_set_t	   mirror_rule_set;  /**< Add a traffic mirror rule.*/
 	eth_mirror_rule_reset_t	   mirror_rule_reset;  /**< reset a traffic mirror rule.*/
-	eth_set_vf_rx_mode_t       set_vf_rx_mode;   /**< Set VF RX mode */
-	eth_set_vf_rx_t            set_vf_rx;  /**< enable/disable a VF receive */
-	eth_set_vf_tx_t            set_vf_tx;  /**< enable/disable a VF transmit */
-	eth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */
 	/** Add UDP tunnel port. */
 	eth_udp_tunnel_port_add_t udp_tunnel_port_add;
 	/** Del UDP tunnel port. */
 	eth_udp_tunnel_port_del_t udp_tunnel_port_del;
 	eth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */
-	eth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */
 	/** Update redirection table. */
 	reta_update_t reta_update;
 	/** Query redirection table. */
-- 
2.10.1

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

* [dpdk-dev] [PATCH v2 9/9] doc: remove deprecation notice
  2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
                   ` (14 preceding siblings ...)
  2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's Bernard Iremonger
@ 2016-12-09 17:26 ` Bernard Iremonger
  15 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 17:26 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove deprecation notice for removing rte_eth_dev_set_vf_* API's.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/deprecation.rst | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 2d17bc6..c897c18 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,19 +38,6 @@ Deprecation Notices
   ``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int``
   instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
 
-* ethdev: for 17.02 it is planned to deprecate the following five functions
-  and move them in ixgbe:
-
-  ``rte_eth_dev_set_vf_rxmode``
-
-  ``rte_eth_dev_set_vf_rx``
-
-  ``rte_eth_dev_set_vf_tx``
-
-  ``rte_eth_dev_set_vf_vlan_filter``
-
-  ``rte_eth_set_vf_rate_limit``
-
 * ABI changes are planned for 17.02 in the ``rte_mbuf`` structure: some fields
   may be reordered to facilitate the writing of ``data_off``, ``refcnt``, and
   ``nb_segs`` in one operation, because some platforms have an overhead if the
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's
  2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's Bernard Iremonger
@ 2016-12-09 18:00   ` Ferruh Yigit
  0 siblings, 0 replies; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-09 18:00 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/9/2016 5:26 PM, Bernard Iremonger wrote:
> remove the following API's:
> 
> rte_eth_dev_set_vf_rxmode
> rte_eth_dev_set_vf_rx
> rte_eth_dev_set_vf_tx
> rte_eth_dev_set_vf_vlan_filter
> rte_eth_dev_set_vf_rate_limit

This patch should also remove above function definitions from
rte_ethdev.h and rte_ether_version.map too.

And it may be good to squash next patch (remove deprecation notice) to
this one to show what caused to notice removal.

Also need to increase LIBABIVER, and update release notes for ABI
breakage, somewhere in this patchset, I would do in this patch but not
quite sure.

> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  lib/librte_ether/rte_ethdev.c | 129 ------------------------------------------
>  lib/librte_ether/rte_ethdev.h |  33 -----------
>  2 files changed, 162 deletions(-)
> 

<...>

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

* [dpdk-dev] [PATCH v3 0/9] net/ixgbe: move set VF functions.
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 0/7] " Bernard Iremonger
                       ` (7 more replies)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
                     ` (8 subsequent siblings)
  9 siblings, 8 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

Changes in V3:
Updated LIBABIVER in Makefile in librte_ether patch.
Updated rte_ethdev.h and ret_ether_version.map in librte_ether patch.
Squashed deprecation notice patch into librte_ether patch.
Added release_note patch.

Changes in V2:
Update testpmd set vf commands help messages.
Updated ethtool to use the ixgbe public API's.
Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
Removed the rte_eth_dev_set_vf_* API's
Removed the deprecation notice.

Changes in V1:
The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (9):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit
  examples/ethtool: use ixgbe public function
  net/ixgbe: remove static set VF functions
  librte_ether: remove the set VF API's
  doc: update release notes

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++-
 app/test-pmd/config.c                       |  31 +-
 doc/guides/rel_notes/deprecation.rst        |  13 -
 doc/guides/rel_notes/release_17_02.rst      |  20 ++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 ++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 459 ++++++++++++++++------------
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 +
 examples/ethtool/lib/rte_ethtool.c          |   5 +-
 lib/librte_ether/Makefile                   |   4 +-
 lib/librte_ether/rte_ethdev.c               | 129 --------
 lib/librte_ether/rte_ethdev.h               | 140 ---------
 lib/librte_ether/rte_ether_version.map      |   7 +-
 13 files changed, 706 insertions(+), 507 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 1/9] net/ixgbe: move set VF functions from the ethdev
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
                     ` (7 subsequent siblings)
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Use public function internally

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 266 +++++++++++++++++++++++++++-
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 379 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..37b82a4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2294,7 +2294,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 		for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
 			for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
 				if (vfinfo[vf].tx_rate[idx] != 0)
-					ixgbe_set_vf_rate_limit(dev, vf,
+					rte_pmd_ixgbe_set_vf_rate_limit(
+						dev->data->port_id, vf,
 						vfinfo[vf].tx_rate[idx],
 						1 << idx);
 	}
@@ -4883,6 +4884,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 2/9] app/testpmd: use ixgbe public functions
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
                     ` (6 subsequent siblings)
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c |  2 +-
 app/test-pmd/config.c  | 31 +++++++++++--------------------
 2 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..12f799b 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6708,7 +6708,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..ea129db 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2332,16 +2335,16 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,10 +2358,10 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
 
@@ -2388,23 +2391,11 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 3/9] app/testpmd: add command for set VF VLAN filter
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (2 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
                     ` (5 subsequent siblings)
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Add the following command to testpmd:
set vf vlan filter <port_id> <vlan_id> <vf_mask> on|off

Add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 98 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 105 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 12f799b..947c698 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -291,6 +291,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf vlan antispoof (port_id) (vf_id) (on|off)\n"
 			"    Set VLAN antispoof for a VF from the PF.\n\n"
+
+			"set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)\n"
+			"    Set VLAN filter for a VF pool from the PF.\n\n"
 #endif
 
 			"vlan set filter (on|off) (port_id)\n"
@@ -11139,6 +11142,100 @@ cmdline_parse_inst_t cmd_set_vf_vlan_insert = {
 	},
 };
 
+
+/* vf vlan filter configuration */
+
+/* Common result structure for vf vlan filter */
+struct cmd_vf_vlan_filter_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t vlan;
+	cmdline_fixed_string_t filter;
+	uint8_t port_id;
+	uint16_t vlan_id;
+	uint16_t vf_mask;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf vlan filter enable disable */
+cmdline_parse_token_string_t cmd_vf_vlan_filter_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_vlan =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan, "vlan");
+cmdline_parse_token_string_t cmd_vf_vlan_filter_filter =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 filter, "filter");
+cmdline_parse_token_num_t cmd_vf_vlan_filter_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vlan_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vlan_id, UINT16);
+cmdline_parse_token_num_t cmd_vf_vlan_filter_vf_mask =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 vf_mask, UINT16);
+cmdline_parse_token_string_t cmd_vf_vlan_filter_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_vlan_filter_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_vlan_filter_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_vlan_filter_result *res = parsed_result;
+	int ret;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_vlan_filter(res->port_id, res->vlan_id, res->vf_mask, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_mask %d or vlan_id %d\n", res->vf_mask, res->vlan_id);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
+	.f = cmd_set_vf_vlan_filter_parsed,
+	.data = NULL,
+	.help_str = "set vf vlan filter <port_id> <vlan_id> <vf_mask> on|off",
+	.tokens = {
+		(void *)&cmd_vf_vlan_filter_set,
+		(void *)&cmd_vf_vlan_filter_vf,
+		(void *)&cmd_vf_vlan_filter_vlan,
+		(void *)&cmd_vf_vlan_filter_filter,
+		(void *)&cmd_vf_vlan_filter_port_id,
+		(void *)&cmd_vf_vlan_filter_vlan_id,
+		(void *)&cmd_vf_vlan_filter_vf_mask,
+		(void *)&cmd_vf_vlan_filter_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11620,6 +11717,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_anti_spoof,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_stripq,
 	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_insert,
+	(cmdline_parse_inst_t *)&cmd_set_vf_vlan_filter,
 	(cmdline_parse_inst_t *)&cmd_set_tx_loopback,
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index f1c269a..60dcd91 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -535,6 +535,13 @@ Set VLAN insert for a VF from the PF::
 
    testpmd> set vf vlan insert (port_id) (vf_id) (vlan_id)
 
+vlan set filter (for VF pool)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set VLAN filter for a VF pool from the PF::
+
+   testpmd> set vf vlan filter (port_id) (vlan_id) (vf_mask) (on|off)
+
 vlan set antispoof (for VF)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 4/9] app/testpmd: add command for set VF receive
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (3 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
                     ` (4 subsequent siblings)
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf rx <port_id> <vf_id> on|off

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 947c698..4424c0a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -274,6 +274,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf mac antispoof (port_id) (vf_id) (on|off).\n"
 			"    Set MAC antispoof for a VF from the PF.\n\n"
+
+			"set vf rx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable RX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11236,6 +11239,87 @@ cmdline_parse_inst_t cmd_set_vf_vlan_filter = {
 	},
 };
 
+/* vf rx configuration */
+
+/* Common result structure for vf rx */
+struct cmd_vf_rx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t rx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf rx enable disable */
+cmdline_parse_token_string_t cmd_vf_rx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_rx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_rx_rx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 rx, "rx");
+cmdline_parse_token_num_t cmd_vf_rx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_rx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_rx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_rx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_rx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_rx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_rx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_rx = {
+	.f = cmd_set_vf_rx_parsed,
+	.data = NULL,
+	.help_str = "set vf rx <port_id> <vf_id> on|off",
+	.tokens = {
+		(void *)&cmd_vf_rx_set,
+		(void *)&cmd_vf_rx_vf,
+		(void *)&cmd_vf_rx_rx,
+		(void *)&cmd_vf_rx_port_id,
+		(void *)&cmd_vf_rx_vf_id,
+		(void *)&cmd_vf_rx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11722,6 +11806,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 60dcd91..6a058e9 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -507,6 +507,13 @@ Set mac antispoof for a VF from the PF::
 
    testpmd> set vf mac antispoof  (port_id) (vf_id) (on|off)
 
+set rx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable rx for a VF from the PF::
+
+   testpmd> set vf rx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 5/9] app/testpmd: add command for set VF transmit
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (4 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
                     ` (3 subsequent siblings)
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

add the following command to testpmd:

set vf tx <port_id> <vf_id> on|off

add command to the testpmd user guide.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c                      | 85 +++++++++++++++++++++++++++++
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++
 2 files changed, 92 insertions(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4424c0a..e385732 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -277,6 +277,9 @@ static void cmd_help_long_parsed(void *parsed_result,
 
 			"set vf rx (port_id) (vf_id) (on|off).\n"
 			"    Enable or disable RX for a VF from the PF.\n\n"
+
+			"set vf tx (port_id) (vf_id) (on|off).\n"
+			"    Enable or disable TX for a VF from the PF.\n\n"
 #endif
 
 			"vlan set strip (on|off) (port_id)\n"
@@ -11320,6 +11323,87 @@ cmdline_parse_inst_t cmd_set_vf_rx = {
 	},
 };
 
+/* vf tx configuration */
+
+/* Common result structure for vf tx */
+struct cmd_vf_tx_result {
+	cmdline_fixed_string_t set;
+	cmdline_fixed_string_t vf;
+	cmdline_fixed_string_t tx;
+	uint8_t port_id;
+	uint16_t vf_id;
+	cmdline_fixed_string_t on_off;
+};
+
+/* Common CLI fields for vf tx enable disable */
+cmdline_parse_token_string_t cmd_vf_tx_set =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 set, "set");
+cmdline_parse_token_string_t cmd_vf_tx_vf =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf, "vf");
+cmdline_parse_token_string_t cmd_vf_tx_tx =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 tx, "tx");
+cmdline_parse_token_num_t cmd_vf_tx_port_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 port_id, UINT8);
+cmdline_parse_token_num_t cmd_vf_tx_vf_id =
+	TOKEN_NUM_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 vf_id, UINT16);
+cmdline_parse_token_string_t cmd_vf_tx_on_off =
+	TOKEN_STRING_INITIALIZER
+		(struct cmd_vf_tx_result,
+		 on_off, "on#off");
+
+static void
+cmd_set_vf_tx_parsed(
+	void *parsed_result,
+	__attribute__((unused)) struct cmdline *cl,
+	__attribute__((unused)) void *data)
+{
+	struct cmd_vf_tx_result *res = parsed_result;
+	int ret = 0;
+	int is_on = (strcmp(res->on_off, "on") == 0) ? 1 : 0;
+
+	ret = rte_pmd_ixgbe_set_vf_tx(res->port_id, res->vf_id, is_on);
+	switch (ret) {
+	case 0:
+		break;
+	case -EINVAL:
+		printf("invalid vf_id %d or is_on %d\n", res->vf_id, is_on);
+		break;
+	case -ENODEV:
+		printf("invalid port_id %d\n", res->port_id);
+		break;
+	case -ENOTSUP:
+		printf("not supported on vf port %d\n", res->port_id);
+		break;
+	default:
+		printf("programming error: (%s)\n", strerror(-ret));
+	}
+}
+
+cmdline_parse_inst_t cmd_set_vf_tx = {
+	.f = cmd_set_vf_tx_parsed,
+	.data = NULL,
+	.help_str = "set vf tx <port_id> <vf_id> on|off",
+	.tokens = {
+		(void *)&cmd_vf_tx_set,
+		(void *)&cmd_vf_tx_vf,
+		(void *)&cmd_vf_tx_tx,
+		(void *)&cmd_vf_tx_port_id,
+		(void *)&cmd_vf_tx_vf_id,
+		(void *)&cmd_vf_tx_on_off,
+		NULL,
+	},
+};
+
 /* tx loopback configuration */
 
 /* Common result structure for tx loopback */
@@ -11807,6 +11891,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
 	(cmdline_parse_inst_t *)&cmd_set_vf_rx,
+	(cmdline_parse_inst_t *)&cmd_set_vf_tx,
 #endif
 	NULL,
 };
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 6a058e9..1de4c5f 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -514,6 +514,13 @@ Enable/disable rx for a VF from the PF::
 
    testpmd> set vf rx (port_id) (vf_id) (on|off)
 
+set tx (for VF)
+~~~~~~~~~~~~~~~
+
+Enable/disable tx for a VF from the PF::
+
+   testpmd> set vf tx (port_id) (vf_id) (on|off)
+
 vlan set strip
 ~~~~~~~~~~~~~~
 
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (5 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 16:25     ` Ferruh Yigit
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
                     ` (2 subsequent siblings)
  9 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 examples/ethtool/lib/rte_ethtool.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index a1f91d4..0e539f7 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,7 @@
 #include <rte_version.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#include <rte_pmd_ixgbe.h>
 #include "rte_ethtool.h"
 
 #define PKTPOOL_SIZE 512
@@ -354,7 +355,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
 
 	/* Set VF vf_rx_mode, VF unsupport status is discard */
 	for (vf = 0; vf < num_vfs; vf++)
-		rte_eth_dev_set_vf_rxmode(port_id, vf,
+		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
 			ETH_VMDQ_ACCEPT_UNTAG, 0);
 
 	/* Enable Rx vlan filter, VF unspport status is discard */
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 7/9] net/ixgbe: remove static set VF functions
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (6 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 8/9] librte_ether: remove the set VF API's Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 9/9] doc: update release notes Bernard Iremonger
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following static functions:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 193 ---------------------------------------
 1 file changed, 193 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 37b82a4..8db1410 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -276,12 +276,6 @@ static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct
 		ether_addr * mac_addr, uint8_t on);
 static int ixgbe_uc_all_hash_table_set(struct rte_eth_dev *dev, uint8_t on);
-static int  ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev,  uint16_t pool,
-		uint16_t rx_mask, uint8_t on);
-static int ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-		uint64_t pool_mask, uint8_t vlan_on);
 static int ixgbe_mirror_rule_set(struct rte_eth_dev *dev,
 		struct rte_eth_mirror_conf *mirror_conf,
 		uint8_t rule_id, uint8_t on);
@@ -297,8 +291,6 @@ static void ixgbe_configure_msix(struct rte_eth_dev *dev);
 
 static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 		uint16_t queue_idx, uint16_t tx_rate);
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-		uint16_t tx_rate, uint64_t q_msk);
 
 static void ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
 				 struct ether_addr *mac_addr,
@@ -568,12 +560,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.uc_all_hash_table_set  = ixgbe_uc_all_hash_table_set,
 	.mirror_rule_set      = ixgbe_mirror_rule_set,
 	.mirror_rule_reset    = ixgbe_mirror_rule_reset,
-	.set_vf_rx_mode       = ixgbe_set_pool_rx_mode,
-	.set_vf_rx            = ixgbe_set_pool_rx,
-	.set_vf_tx            = ixgbe_set_pool_tx,
-	.set_vf_vlan_filter   = ixgbe_set_pool_vlan_filter,
 	.set_queue_rate_limit = ixgbe_set_queue_rate_limit,
-	.set_vf_rate_limit    = ixgbe_set_vf_rate_limit,
 	.reta_update          = ixgbe_dev_rss_reta_update,
 	.reta_query           = ixgbe_dev_rss_reta_query,
 #ifdef RTE_NIC_BYPASS
@@ -4547,132 +4534,6 @@ ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val)
 	return new_val;
 }
 
-static int
-ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev, uint16_t pool,
-			       uint16_t rx_mask, uint8_t on)
-{
-	int val = 0;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool));
-
-	if (hw->mac.type == ixgbe_mac_82598EB) {
-		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
-			     " on 82599 hardware and newer");
-		return -ENOTSUP;
-	}
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
-
-	if (on)
-		vmolr |= val;
-	else
-		vmolr &= ~val;
-
-	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFRE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFRE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFTE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFTE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-			uint64_t pool_mask, uint8_t vlan_on)
-{
-	int ret = 0;
-	uint16_t pool_idx;
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-	for (pool_idx = 0; pool_idx < ETH_64_POOLS; pool_idx++) {
-		if (pool_mask & ((uint64_t)(1ULL << pool_idx))) {
-			ret = hw->mac.ops.set_vfta(hw, vlan, pool_idx,
-						   vlan_on, false);
-			if (ret < 0)
-				return ret;
-		}
-	}
-
-	return ret;
-}
 
 int
 rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
@@ -5628,60 +5489,6 @@ static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 	return 0;
 }
 
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-	uint16_t tx_rate, uint64_t q_msk)
-{
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct ixgbe_vf_info *vfinfo =
-		*(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
-	uint8_t  nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
-	uint32_t queue_stride =
-		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
-	uint32_t queue_idx = vf * queue_stride, idx = 0, vf_idx;
-	uint32_t queue_end = queue_idx + nb_q_per_pool - 1;
-	uint16_t total_rate = 0;
-
-	if (queue_end >= hw->mac.max_tx_queues)
-		return -EINVAL;
-
-	if (vfinfo != NULL) {
-		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
-			if (vf_idx == vf)
-				continue;
-			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
-				idx++)
-				total_rate += vfinfo[vf_idx].tx_rate[idx];
-		}
-	} else
-		return -EINVAL;
-
-	/* Store tx_rate for this vf. */
-	for (idx = 0; idx < nb_q_per_pool; idx++) {
-		if (((uint64_t)0x1 << idx) & q_msk) {
-			if (vfinfo[vf].tx_rate[idx] != tx_rate)
-				vfinfo[vf].tx_rate[idx] = tx_rate;
-			total_rate += tx_rate;
-		}
-	}
-
-	if (total_rate > dev->data->dev_link.link_speed) {
-		/*
-		 * Reset stored TX rate of the VF if it causes exceed
-		 * link speed.
-		 */
-		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
-		return -EINVAL;
-	}
-
-	/* Set RTTBCNRC of each queue/pool for vf X  */
-	for (; queue_idx <= queue_end; queue_idx++) {
-		if (0x1 & q_msk)
-			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
-		q_msk = q_msk >> 1;
-	}
-
-	return 0;
-}
 
 static void
 ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 8/9] librte_ether: remove the set VF API's
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (7 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 9/9] doc: update release notes Bernard Iremonger
  9 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following API's:

rte_eth_dev_set_vf_rxmode
rte_eth_dev_set_vf_rx
rte_eth_dev_set_vf_tx
rte_eth_dev_set_vf_vlan_filter
rte_eth_dev_set_vf_rate_limit

Increment LIBABIVER in Makefile
Remove deprecation notice for removing rte_eth_dev_set_vf_* API's.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/deprecation.rst   |  13 ---
 lib/librte_ether/Makefile              |   4 +-
 lib/librte_ether/rte_ethdev.c          | 129 ------------------------------
 lib/librte_ether/rte_ethdev.h          | 140 ---------------------------------
 lib/librte_ether/rte_ether_version.map |   7 +-
 5 files changed, 3 insertions(+), 290 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 2d17bc6..c897c18 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,19 +38,6 @@ Deprecation Notices
   ``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int``
   instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
 
-* ethdev: for 17.02 it is planned to deprecate the following five functions
-  and move them in ixgbe:
-
-  ``rte_eth_dev_set_vf_rxmode``
-
-  ``rte_eth_dev_set_vf_rx``
-
-  ``rte_eth_dev_set_vf_tx``
-
-  ``rte_eth_dev_set_vf_vlan_filter``
-
-  ``rte_eth_set_vf_rate_limit``
-
 * ABI changes are planned for 17.02 in the ``rte_mbuf`` structure: some fields
   may be reordered to facilitate the writing of ``data_off``, ``refcnt``, and
   ``nb_segs`` in one operation, because some platforms have an overhead if the
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index efe1e5f..d23015c 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_ether_version.map
 
-LIBABIVER := 5
+LIBABIVER := 6
 
 SRCS-y += rte_ethdev.c
 
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 1e0f206..6a93014 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2137,32 +2137,6 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr)
 	return 0;
 }
 
-int
-rte_eth_dev_set_vf_rxmode(uint8_t port_id,  uint16_t vf,
-				uint16_t rx_mode, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:invalid VF id %d\n", vf);
-		return -EINVAL;
-	}
-
-	if (rx_mode == 0) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:mode mask ca not be zero\n");
-		return -EINVAL;
-	}
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx_mode, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx_mode)(dev, vf, rx_mode, on);
-}
 
 /*
  * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find
@@ -2252,76 +2226,6 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on)
 	return (*dev->dev_ops->uc_all_hash_table_set)(dev, on);
 }
 
-int
-rte_eth_dev_set_vf_rx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("port %d: invalid vf id\n", port_id);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_tx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set pool tx:invalid pool id=%d\n", vf);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_tx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_tx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port_id, uint16_t vlan_id,
-			       uint64_t vf_mask, uint8_t vlan_on)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-
-	if (vlan_id > ETHER_MAX_VLAN_ID) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:invalid VLAN id=%d\n",
-			vlan_id);
-		return -EINVAL;
-	}
-
-	if (vf_mask == 0) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:pool_mask can not be 0\n");
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_vlan_filter, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_vlan_filter)(dev, vlan_id,
-						   vf_mask, vlan_on);
-}
-
 int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 					uint16_t tx_rate)
 {
@@ -2352,39 +2256,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate);
 }
 
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, uint16_t tx_rate,
-				uint64_t q_msk)
-{
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-	link = dev->data->dev_link;
-
-	if (vf > dev_info.max_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:port %d: "
-				"invalid vf id=%d\n", port_id, vf);
-		return -EINVAL;
-	}
-
-	if (tx_rate > link.link_speed) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:invalid tx_rate=%d, "
-				"bigger than link speed= %d\n",
-				tx_rate, link.link_speed);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rate_limit, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rate_limit)(dev, vf, tx_rate, q_msk);
-}
-
 int
 rte_eth_mirror_rule_set(uint8_t port_id,
 			struct rte_eth_mirror_conf *mirror_conf,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..c602d7d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1249,39 +1249,11 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 				  uint8_t on);
 /**< @internal Set all Unicast Hash bitmap */
 
-typedef int (*eth_set_vf_rx_mode_t)(struct rte_eth_dev *dev,
-				  uint16_t vf,
-				  uint16_t rx_mode,
-				  uint8_t on);
-/**< @internal Set a VF receive mode */
-
-typedef int (*eth_set_vf_rx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Set a VF receive  mode */
-
-typedef int (*eth_set_vf_tx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Enable or disable a VF transmit   */
-
-typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
-				  uint16_t vlan,
-				  uint64_t vf_mask,
-				  uint8_t vlan_on);
-/**< @internal Set VF VLAN pool filter */
-
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
 				uint16_t tx_rate);
 /**< @internal Set queue TX rate */
 
-typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint16_t tx_rate,
-				uint64_t q_msk);
-/**< @internal Set VF TX rate */
-
 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
 				  struct rte_eth_mirror_conf *mirror_conf,
 				  uint8_t rule_id,
@@ -1479,16 +1451,11 @@ struct eth_dev_ops {
 	eth_uc_all_hash_table_set_t uc_all_hash_table_set;  /**< Set Unicast hash bitmap */
 	eth_mirror_rule_set_t	   mirror_rule_set;  /**< Add a traffic mirror rule.*/
 	eth_mirror_rule_reset_t	   mirror_rule_reset;  /**< reset a traffic mirror rule.*/
-	eth_set_vf_rx_mode_t       set_vf_rx_mode;   /**< Set VF RX mode */
-	eth_set_vf_rx_t            set_vf_rx;  /**< enable/disable a VF receive */
-	eth_set_vf_tx_t            set_vf_tx;  /**< enable/disable a VF transmit */
-	eth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */
 	/** Add UDP tunnel port. */
 	eth_udp_tunnel_port_add_t udp_tunnel_port_add;
 	/** Del UDP tunnel port. */
 	eth_udp_tunnel_port_del_t udp_tunnel_port_del;
 	eth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */
-	eth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */
 	/** Update redirection table. */
 	reta_update_t reta_update;
 	/** Query redirection table. */
@@ -3403,93 +3370,6 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr,
  */
 int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on);
 
- /**
- * Set RX L2 Filtering mode of a VF of an Ethernet device.
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param vf
- *   VF id.
- * @param rx_mode
- *    The RX mode mask, which  is one or more of  accepting Untagged Packets,
- *    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
- *    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
- *    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
- *    in rx_mode.
- * @param on
- *    1 - Enable a VF RX mode.
- *    0 - Disable a VF RX mode.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support.
- *   - (-ENOTSUP) if hardware doesn't support.
- *   - (-EINVAL) if bad parameter.
- */
-int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mode,
-				uint8_t on);
-
-/**
-* Enable or disable a VF traffic transmit of the Ethernet device.
-*
-* @param port
-*   The port identifier of the Ethernet device.
-* @param vf
-*   VF id.
-* @param on
-*    1 - Enable a VF traffic transmit.
-*    0 - Disable a VF traffic transmit.
-* @return
-*   - (0) if successful.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable or disable a VF traffic receive of an Ethernet device.
-*
-* @param port
-*   The port identifier of the Ethernet device.
-* @param vf
-*   VF id.
-* @param on
-*    1 - Enable a VF traffic receive.
-*    0 - Disable a VF traffic receive.
-* @return
-*   - (0) if successful.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_rx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
-* received VLAN packets tagged with a given VLAN Tag Identifier.
-*
-* @param port id
-*   The port identifier of the Ethernet device.
-* @param vlan_id
-*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
-* @param vf_mask
-*    Bitmap listing which VFs participate in the VLAN filtering.
-* @param vlan_on
-*    1 - Enable VFs VLAN filtering.
-*    0 - Disable VFs VLAN filtering.
-* @return
-*   - (0) if successful.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
-				uint64_t vf_mask,
-				uint8_t vlan_on);
-
 /**
  * Set a traffic mirroring rule on an Ethernet device
  *
@@ -3551,26 +3431,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 			uint16_t tx_rate);
 
 /**
- * Set the rate limitation for a vf on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param vf
- *   VF id.
- * @param tx_rate
- *   The tx rate allocated from the total link speed for this VF id.
- * @param q_msk
- *   The queue mask which need to set the rate.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support this feature.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if bad parameter.
- */
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk);
-
-/**
  * Initialize bypass logic. This function needs to be called before
  * executing any other bypass API.
  *
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 72be66d..7594416 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -61,10 +61,6 @@ DPDK_2.2 {
 	rte_eth_dev_set_mtu;
 	rte_eth_dev_set_rx_queue_stats_mapping;
 	rte_eth_dev_set_tx_queue_stats_mapping;
-	rte_eth_dev_set_vf_rx;
-	rte_eth_dev_set_vf_rxmode;
-	rte_eth_dev_set_vf_tx;
-	rte_eth_dev_set_vf_vlan_filter;
 	rte_eth_dev_set_vlan_offload;
 	rte_eth_dev_set_vlan_pvid;
 	rte_eth_dev_set_vlan_strip_on_queue;
@@ -94,7 +90,6 @@ DPDK_2.2 {
 	rte_eth_rx_queue_info_get;
 	rte_eth_rx_queue_setup;
 	rte_eth_set_queue_rate_limit;
-	rte_eth_set_vf_rate_limit;
 	rte_eth_stats;
 	rte_eth_stats_get;
 	rte_eth_stats_reset;
@@ -146,4 +141,4 @@ DPDK_16.11 {
 	rte_eth_dev_pci_probe;
 	rte_eth_dev_pci_remove;
 
-} DPDK_16.07;
+} DPDK_16.07;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v3 9/9] doc: update release notes
  2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
                     ` (8 preceding siblings ...)
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 8/9] librte_ether: remove the set VF API's Bernard Iremonger
@ 2016-12-12 13:50   ` Bernard Iremonger
  2016-12-12 15:51     ` Ferruh Yigit
  9 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-12 13:50 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]

Add release note for removing set VF API's from the ethdev,
renaming the API's and moving them to the ixgbe PMD.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_17_02.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
index 3b65038..d30b258 100644
--- a/doc/guides/rel_notes/release_17_02.rst
+++ b/doc/guides/rel_notes/release_17_02.rst
@@ -38,6 +38,26 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Moved five APIs for VF management from the ethdev to the ixgbe PMD.**
+
+  The following five APIs for VF management from the PF have been removed from the ethdev,
+  renamed and added to the ixgbe PMD::
+
+    rte_eth_dev_set_vf_rate_limit
+    rte_eth_dev_set_vf_rx
+    rte_eth_dev_set_vf_rxmode
+    rte_eth_dev_set_vf_tx
+    rte_eth_dev_set_vf_vlan_filter
+
+  The API's have been renamed to the following::
+
+    rte_pmd_ixgbe_set_vf_rate_limit
+    rte_pmd_ixgbe_set_vf_rx
+    rte_pmd_ixgbe_set_vf_rxmode
+    rte_pmd_ixgbe_set_vf_tx
+    rte_pmd_ixgbe_set_vf_vlan_filter
+
+  The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
 
 Resolved Issues
 ---------------
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v3 9/9] doc: update release notes
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 9/9] doc: update release notes Bernard Iremonger
@ 2016-12-12 15:51     ` Ferruh Yigit
  2016-12-12 15:55       ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-12 15:51 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

Hi Bernard,

On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
> Add release note for removing set VF API's from the ethdev,
> renaming the API's and moving them to the ixgbe PMD.

Sorry, my bad, I wasn't clear enough.

I was thinking about updating "Shared Library Versions" section of the
release notes, and increasing the librte_ethdev.so version (from 5 to 6)
I believe new feature section does not require an update.

If you don't mind I can update library version with previous patch, and
you don't need to send a new version of the patch. Please let me know.

> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  doc/guides/rel_notes/release_17_02.rst | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
> index 3b65038..d30b258 100644
> --- a/doc/guides/rel_notes/release_17_02.rst
> +++ b/doc/guides/rel_notes/release_17_02.rst
> @@ -38,6 +38,26 @@ New Features
>       Also, make sure to start the actual text at the margin.
>       =========================================================
>  
> +* **Moved five APIs for VF management from the ethdev to the ixgbe PMD.**
> +
> +  The following five APIs for VF management from the PF have been removed from the ethdev,
> +  renamed and added to the ixgbe PMD::
> +
> +    rte_eth_dev_set_vf_rate_limit
> +    rte_eth_dev_set_vf_rx
> +    rte_eth_dev_set_vf_rxmode
> +    rte_eth_dev_set_vf_tx
> +    rte_eth_dev_set_vf_vlan_filter
> +
> +  The API's have been renamed to the following::
> +
> +    rte_pmd_ixgbe_set_vf_rate_limit
> +    rte_pmd_ixgbe_set_vf_rx
> +    rte_pmd_ixgbe_set_vf_rxmode
> +    rte_pmd_ixgbe_set_vf_tx
> +    rte_pmd_ixgbe_set_vf_vlan_filter
> +
> +  The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
>  
>  Resolved Issues
>  ---------------
> 

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

* Re: [dpdk-dev] [PATCH v3 9/9] doc: update release notes
  2016-12-12 15:51     ` Ferruh Yigit
@ 2016-12-12 15:55       ` Iremonger, Bernard
  2016-12-12 16:07         ` Ferruh Yigit
  0 siblings, 1 reply; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-12 15:55 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev

Hi Ferruh,


> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, December 12, 2016 3:52 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 9/9] doc: update release notes
> 
> Hi Bernard,
> 
> On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
> > Add release note for removing set VF API's from the ethdev, renaming
> > the API's and moving them to the ixgbe PMD.
> 
> Sorry, my bad, I wasn't clear enough.
> 
> I was thinking about updating "Shared Library Versions" section of the
> release notes, and increasing the librte_ethdev.so version (from 5 to 6) I
> believe new feature section does not require an update.
> 
> If you don't mind I can update library version with previous patch, and you
> don't need to send a new version of the patch. Please let me know.

Yes, that's fine with me.

 
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  doc/guides/rel_notes/release_17_02.rst | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/doc/guides/rel_notes/release_17_02.rst
> > b/doc/guides/rel_notes/release_17_02.rst
> > index 3b65038..d30b258 100644
> > --- a/doc/guides/rel_notes/release_17_02.rst
> > +++ b/doc/guides/rel_notes/release_17_02.rst
> > @@ -38,6 +38,26 @@ New Features
> >       Also, make sure to start the actual text at the margin.
> >
> =========================================================
> >
> > +* **Moved five APIs for VF management from the ethdev to the ixgbe
> > +PMD.**
> > +
> > +  The following five APIs for VF management from the PF have been
> > + removed from the ethdev,  renamed and added to the ixgbe PMD::
> > +
> > +    rte_eth_dev_set_vf_rate_limit
> > +    rte_eth_dev_set_vf_rx
> > +    rte_eth_dev_set_vf_rxmode
> > +    rte_eth_dev_set_vf_tx
> > +    rte_eth_dev_set_vf_vlan_filter
> > +
> > +  The API's have been renamed to the following::
> > +
> > +    rte_pmd_ixgbe_set_vf_rate_limit
> > +    rte_pmd_ixgbe_set_vf_rx
> > +    rte_pmd_ixgbe_set_vf_rxmode
> > +    rte_pmd_ixgbe_set_vf_tx
> > +    rte_pmd_ixgbe_set_vf_vlan_filter
> > +
> > +  The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
> >
> >  Resolved Issues
> >  ---------------
> >
Regards,

Bernard.


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

* Re: [dpdk-dev] [PATCH v3 9/9] doc: update release notes
  2016-12-12 15:55       ` Iremonger, Bernard
@ 2016-12-12 16:07         ` Ferruh Yigit
  0 siblings, 0 replies; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-12 16:07 UTC (permalink / raw)
  To: Iremonger, Bernard, thomas.monjalon, dev

On 12/12/2016 3:55 PM, Iremonger, Bernard wrote:
> Hi Ferruh,
> 
> 
>> -----Original Message-----
>> From: Yigit, Ferruh
>> Sent: Monday, December 12, 2016 3:52 PM
>> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
>> thomas.monjalon@6wind.com; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH v3 9/9] doc: update release notes
>>
>> Hi Bernard,
>>
>> On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
>>> Add release note for removing set VF API's from the ethdev, renaming
>>> the API's and moving them to the ixgbe PMD.
>>
>> Sorry, my bad, I wasn't clear enough.
>>
>> I was thinking about updating "Shared Library Versions" section of the
>> release notes, and increasing the librte_ethdev.so version (from 5 to 6) I
>> believe new feature section does not require an update.
>>
>> If you don't mind I can update library version with previous patch, and you
>> don't need to send a new version of the patch. Please let me know.
> 
> Yes, that's fine with me.

It seems already increased for this release, by another patch, so no
change required there.

I will move your release notes changes to "API Changes" section.

> 
>  
>>>
>>> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>>> ---
>>>  doc/guides/rel_notes/release_17_02.rst | 20 ++++++++++++++++++++
>>>  1 file changed, 20 insertions(+)
>>>
>>> diff --git a/doc/guides/rel_notes/release_17_02.rst
>>> b/doc/guides/rel_notes/release_17_02.rst
>>> index 3b65038..d30b258 100644
>>> --- a/doc/guides/rel_notes/release_17_02.rst
>>> +++ b/doc/guides/rel_notes/release_17_02.rst
>>> @@ -38,6 +38,26 @@ New Features
>>>       Also, make sure to start the actual text at the margin.
>>>
>> =========================================================
>>>
>>> +* **Moved five APIs for VF management from the ethdev to the ixgbe
>>> +PMD.**
>>> +
>>> +  The following five APIs for VF management from the PF have been
>>> + removed from the ethdev,  renamed and added to the ixgbe PMD::
>>> +
>>> +    rte_eth_dev_set_vf_rate_limit
>>> +    rte_eth_dev_set_vf_rx
>>> +    rte_eth_dev_set_vf_rxmode
>>> +    rte_eth_dev_set_vf_tx
>>> +    rte_eth_dev_set_vf_vlan_filter
>>> +
>>> +  The API's have been renamed to the following::
>>> +
>>> +    rte_pmd_ixgbe_set_vf_rate_limit
>>> +    rte_pmd_ixgbe_set_vf_rx
>>> +    rte_pmd_ixgbe_set_vf_rxmode
>>> +    rte_pmd_ixgbe_set_vf_tx
>>> +    rte_pmd_ixgbe_set_vf_vlan_filter
>>> +
>>> +  The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
>>>
>>>  Resolved Issues
>>>  ---------------
>>>
> Regards,
> 
> Bernard.
> 

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

* Re: [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
@ 2016-12-12 16:25     ` Ferruh Yigit
  2016-12-13  9:04       ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-12 16:25 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
> Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> ---
>  examples/ethtool/lib/rte_ethtool.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
> index a1f91d4..0e539f7 100644
> --- a/examples/ethtool/lib/rte_ethtool.c
> +++ b/examples/ethtool/lib/rte_ethtool.c
> @@ -1,7 +1,7 @@
>  /*-
>   *   BSD LICENSE
>   *
> - *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> + *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
>   *   All rights reserved.
>   *
>   *   Redistribution and use in source and binary forms, with or without
> @@ -36,6 +36,7 @@
>  #include <rte_version.h>
>  #include <rte_ethdev.h>
>  #include <rte_ether.h>
> +#include <rte_pmd_ixgbe.h>
>  #include "rte_ethtool.h"
>  
>  #define PKTPOOL_SIZE 512
> @@ -354,7 +355,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
>  
>  	/* Set VF vf_rx_mode, VF unsupport status is discard */
>  	for (vf = 0; vf < num_vfs; vf++)
> -		rte_eth_dev_set_vf_rxmode(port_id, vf,
> +		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,

Will these cause a build error if IXGBE_PMD is not enabled?

>  			ETH_VMDQ_ACCEPT_UNTAG, 0);
>  
>  	/* Enable Rx vlan filter, VF unspport status is discard */
> 

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

* Re: [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function
  2016-12-12 16:25     ` Ferruh Yigit
@ 2016-12-13  9:04       ` Iremonger, Bernard
  0 siblings, 0 replies; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-13  9:04 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev

Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Monday, December 12, 2016 4:25 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public
> function
> 
> On 12/12/2016 1:50 PM, Bernard Iremonger wrote:
> > Replace rte_eth_dev_set_vf_rxmode with
> rte_pmd_ixgbe_set_vf_rx_mode.
> >
> > Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
> > ---
> >  examples/ethtool/lib/rte_ethtool.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/examples/ethtool/lib/rte_ethtool.c
> b/examples/ethtool/lib/rte_ethtool.c
> > index a1f91d4..0e539f7 100644
> > --- a/examples/ethtool/lib/rte_ethtool.c
> > +++ b/examples/ethtool/lib/rte_ethtool.c
> > @@ -1,7 +1,7 @@
> >  /*-
> >   *   BSD LICENSE
> >   *
> > - *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
> > + *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
> >   *   All rights reserved.
> >   *
> >   *   Redistribution and use in source and binary forms, with or without
> > @@ -36,6 +36,7 @@
> >  #include <rte_version.h>
> >  #include <rte_ethdev.h>
> >  #include <rte_ether.h>
> > +#include <rte_pmd_ixgbe.h>
> >  #include "rte_ethtool.h"
> >
> >  #define PKTPOOL_SIZE 512
> > @@ -354,7 +355,7 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
> >
> >  	/* Set VF vf_rx_mode, VF unsupport status is discard */
> >  	for (vf = 0; vf < num_vfs; vf++)
> > -		rte_eth_dev_set_vf_rxmode(port_id, vf,
> > +		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
> 
> Will these cause a build error if IXGBE_PMD is not enabled?

Yes, I will send a v4.

> 
> >  			ETH_VMDQ_ACCEPT_UNTAG, 0);
> >
> >  	/* Enable Rx vlan filter, VF unspport status is discard */
> >
Regards,

Bernard.

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

* [dpdk-dev] [PATCH v4 0/7] net/ixgbe: move set VF functions.
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 13:36       ` Ferruh Yigit
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 1/7] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
                       ` (6 subsequent siblings)
  7 siblings, 1 reply; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

Changes in  V4:
Fixed compile issues when ixgbe PMD is not present.
Removed duplicate testpmd commands.
Added cleanup patch for testpmd.
Updated release note.

Changes in V3:
Updated LIBABIVER in Makefile in librte_ether patch.
Updated rte_ethdev.h and ret_ether_version.map in librte_ether patch.
Squashed deprecation notice patch into librte_ether patch.
Added release_note patch.

Changes in V2:
Update testpmd set vf commands help messages.
Updated ethtool to use the ixgbe public API's.
Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
Removed the rte_eth_dev_set_vf_* API's
Removed the deprecation notice.

Changes in V1:
The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (7):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: cleanup parameter checking
  examples/ethtool: use ixgbe public function
  net/ixgbe: remove static set VF functions
  librte_ether: remove the set VF API's
  doc: update release notes

 app/test-pmd/cmdline.c                      |  18 +-
 app/test-pmd/config.c                       |  43 ++-
 doc/guides/rel_notes/deprecation.rst        |  13 -
 doc/guides/rel_notes/release_17_02.rst      |  23 +-
 drivers/net/ixgbe/ixgbe_ethdev.c            | 459 ++++++++++++++++------------
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 +
 examples/ethtool/lib/rte_ethtool.c          |  12 +-
 lib/librte_ether/Makefile                   |   4 +-
 lib/librte_ether/rte_ethdev.c               | 129 --------
 lib/librte_ether/rte_ethdev.h               | 140 ---------
 lib/librte_ether/rte_ether_version.map      |   7 +-
 12 files changed, 442 insertions(+), 520 deletions(-)

-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 1/7] net/ixgbe: move set VF functions from the ethdev
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 0/7] " Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 2/7] app/testpmd: use ixgbe public functions Bernard Iremonger
                       ` (5 subsequent siblings)
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Move the following functions from eth_dev_ops to the ixgbe PMD and rename:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Rename the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Use public function internally

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c            | 266 +++++++++++++++++++++++++++-
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 3 files changed, 379 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index edc9b22..37b82a4 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2294,7 +2294,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev)
 		for (vf = 0; vf < dev->pci_dev->max_vfs; vf++)
 			for (idx = 0; idx < IXGBE_MAX_QUEUE_NUM_PER_VF; idx++)
 				if (vfinfo[vf].tx_rate[idx] != 0)
-					ixgbe_set_vf_rate_limit(dev, vf,
+					rte_pmd_ixgbe_set_vf_rate_limit(
+						dev->data->port_id, vf,
 						vfinfo[vf].tx_rate[idx],
 						1 << idx);
 	}
@@ -4883,6 +4884,269 @@ rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on)
 	return 0;
 }
 
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on)
+{
+	int val = 0;
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	uint32_t vmolr;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf));
+
+	if (hw->mac.type == ixgbe_mac_82598EB) {
+		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
+			     " on 82599 hardware and newer");
+		return -ENOTSUP;
+	}
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
+
+	if (on)
+		vmolr |= val;
+	else
+		vmolr &= ~val;
+
+	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(vf), vmolr);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFRE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFRE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	uint32_t reg, addr;
+	uint32_t val;
+	const uint8_t bit1 = 0x1;
+
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (on > 1)
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	/* for vf >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
+	if (vf >= 32) {
+		addr = IXGBE_VFTE(1);
+		val = bit1 << (vf - 32);
+	} else {
+		addr = IXGBE_VFTE(0);
+		val = bit1 << vf;
+	}
+
+	reg = IXGBE_READ_REG(hw, addr);
+
+	if (on)
+		reg |= val;
+	else
+		reg &= ~val;
+
+	IXGBE_WRITE_REG(hw, addr, reg);
+
+	return 0;
+}
+
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan,
+			uint64_t vf_mask, uint8_t vlan_on)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	int ret = 0;
+	uint16_t vf_idx;
+	struct ixgbe_hw *hw;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if ((vlan > ETHER_MAX_VLAN_ID) || (vf_mask == 0))
+		return -EINVAL;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	if (ixgbe_vmdq_mode_check(hw) < 0)
+		return -ENOTSUP;
+
+	for (vf_idx = 0; vf_idx < 64; vf_idx++) {
+		if (vf_mask & ((uint64_t)(1ULL << vf_idx))) {
+			ret = hw->mac.ops.set_vfta(hw, vlan, vf_idx,
+						   vlan_on, false);
+			if (ret < 0)
+				return ret;
+		}
+	}
+
+	return ret;
+}
+
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf,
+	uint16_t tx_rate, uint64_t q_msk)
+{
+	struct rte_eth_dev *dev;
+	struct rte_eth_dev_info dev_info;
+	struct ixgbe_hw *hw;
+	struct ixgbe_vf_info *vfinfo;
+	struct rte_eth_link link;
+	uint8_t  nb_q_per_pool;
+	uint32_t queue_stride;
+	uint32_t queue_idx, idx = 0, vf_idx;
+	uint32_t queue_end;
+	uint16_t total_rate = 0;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);
+
+	dev = &rte_eth_devices[port];
+	rte_eth_dev_info_get(port, &dev_info);
+	rte_eth_link_get_nowait(port, &link);
+
+	if (strstr(dev_info.driver_name, "ixgbe_vf"))
+		return -ENOTSUP;
+
+	if (vf >= dev_info.max_vfs)
+		return -EINVAL;
+
+	if (tx_rate > link.link_speed)
+		return -EINVAL;
+
+	if (q_msk == 0)
+		return 0;
+
+	hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
+	nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
+	queue_stride = IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
+	queue_idx = vf * queue_stride;
+	queue_end = queue_idx + nb_q_per_pool - 1;
+	if (queue_end >= hw->mac.max_tx_queues)
+		return -EINVAL;
+
+	if (vfinfo) {
+		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
+			if (vf_idx == vf)
+				continue;
+			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
+				idx++)
+				total_rate += vfinfo[vf_idx].tx_rate[idx];
+		}
+	} else {
+		return -EINVAL;
+	}
+
+	/* Store tx_rate for this vf. */
+	for (idx = 0; idx < nb_q_per_pool; idx++) {
+		if (((uint64_t)0x1 << idx) & q_msk) {
+			if (vfinfo[vf].tx_rate[idx] != tx_rate)
+				vfinfo[vf].tx_rate[idx] = tx_rate;
+			total_rate += tx_rate;
+		}
+	}
+
+	if (total_rate > dev->data->dev_link.link_speed) {
+		/* Reset stored TX rate of the VF if it causes exceed
+		 * link speed.
+		 */
+		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
+		return -EINVAL;
+	}
+
+	/* Set RTTBCNRC of each queue/pool for vf X  */
+	for (; queue_idx <= queue_end; queue_idx++) {
+		if (0x1 & q_msk)
+			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
+		q_msk = q_msk >> 1;
+	}
+
+	return 0;
+}
+
 #define IXGBE_MRCTL_VPME  0x01 /* Virtual Pool Mirroring. */
 #define IXGBE_MRCTL_UPME  0x02 /* Uplink Port Mirroring. */
 #define IXGBE_MRCTL_DPME  0x04 /* Downlink Port Mirroring. */
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h
index c2fb826..4eb0c9a 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe.h
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h
@@ -183,6 +183,110 @@ int
 rte_pmd_ixgbe_set_vf_vlan_stripq(uint8_t port, uint16_t vf, uint8_t on);
 
 /**
+* Set RX L2 Filtering mode of a VF of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param rx_mode
+*    The RX mode mask, which is one or more of accepting Untagged Packets,
+*    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
+*    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
+*    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
+*    in rx_mode.
+* @param on
+*    1 - Enable a VF RX mode.
+*    0 - Disable a VF RX mode.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mask, uint8_t on);
+
+/**
+* Enable or disable a VF traffic receive of an Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic receive.
+*    0 - Disable a VF traffic receive.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_rx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable or disable a VF traffic transmit of the Ethernet device.
+*
+* @param port
+*   The port identifier of the Ethernet device.
+* @param vf
+*   VF id.
+* @param on
+*    1 - Enable a VF traffic transmit.
+*    0 - Disable a VF traffic transmit.
+* @return
+*   - (0) if successful.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_tx(uint8_t port, uint16_t vf, uint8_t on);
+
+/**
+* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
+* received VLAN packets tagged with a given VLAN Tag Identifier.
+*
+* @param port id
+*   The port identifier of the Ethernet device.
+* @param vlan_id
+*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
+* @param vf_mask
+*    Bitmap listing which VFs participate in the VLAN filtering.
+* @param vlan_on
+*    1 - Enable VFs VLAN filtering.
+*    0 - Disable VFs VLAN filtering.
+* @return
+*   - (0) if successful.
+*   - (-ENOTSUP) if hardware doesn't support.
+*   - (-ENODEV) if *port_id* invalid.
+*   - (-EINVAL) if bad parameter.
+*/
+int
+rte_pmd_ixgbe_set_vf_vlan_filter(uint8_t port, uint16_t vlan, uint64_t vf_mask, uint8_t vlan_on);
+
+/**
+ * Set the rate limitation for a vf on an Ethernet device.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param vf
+ *   VF id.
+ * @param tx_rate
+ *   The tx rate allocated from the total link speed for this VF id.
+ * @param q_msk
+ *   The queue mask which need to set the rate.
+ * @return
+ *   - (0) if successful.
+ *   - (-ENOTSUP) if hardware doesn't support this feature.
+ *   - (-ENODEV) if *port_id* invalid.
+ *   - (-EINVAL) if bad parameter.
+ */
+int rte_pmd_ixgbe_set_vf_rate_limit(uint8_t port, uint16_t vf, uint16_t tx_rate, uint64_t q_msk);
+
+/**
  * Response sent back to ixgbe driver from user app after callback
  */
 enum rte_pmd_ixgbe_mb_event_rsp {
diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
index 92434f3..5252bc2 100644
--- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
+++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map
@@ -15,3 +15,13 @@ DPDK_16.11 {
 	rte_pmd_ixgbe_set_vf_vlan_insert;
 	rte_pmd_ixgbe_set_vf_vlan_stripq;
 } DPDK_2.0;
+
+DPDK_17.02 {
+	global:
+
+	rte_pmd_ixgbe_set_vf_rate_limit;
+	rte_pmd_ixgbe_set_vf_rx;
+	rte_pmd_ixgbe_set_vf_rxmode;
+	rte_pmd_ixgbe_set_vf_tx;
+	rte_pmd_ixgbe_set_vf_vlan_filter;
+} DPDK_16.11;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 2/7] app/testpmd: use ixgbe public functions
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 0/7] " Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 1/7] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 3/7] app/testpmd: cleanup parameter checking Bernard Iremonger
                       ` (4 subsequent siblings)
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Use the the following ixgbe public functions:

rte_pmd_ixgbe_set_vf_rate_limit
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/cmdline.c | 18 +++++++++++++-----
 app/test-pmd/config.c  | 26 ++++++++++++++++++--------
 2 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index d03a592..ed84d7a 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6614,6 +6614,7 @@ cmdline_parse_inst_t cmd_set_vf_macvlan_filter = {
 	},
 };
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** CONFIGURE VF TRAFFIC CONTROL *** */
 struct cmd_set_vf_traffic {
 	cmdline_fixed_string_t set;
@@ -6674,7 +6675,9 @@ cmdline_parse_inst_t cmd_set_vf_traffic = {
 		NULL,
 	},
 };
+#endif
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** CONFIGURE VF RECEIVE MODE *** */
 struct cmd_set_vf_rxmode {
 	cmdline_fixed_string_t set;
@@ -6708,7 +6711,7 @@ cmd_set_vf_rxmode_parsed(void *parsed_result,
 			rx_mode |= ETH_VMDQ_ACCEPT_MULTICAST;
 	}
 
-	ret = rte_eth_dev_set_vf_rxmode(res->port_id,res->vf_id,rx_mode,(uint8_t)is_on);
+	ret = rte_pmd_ixgbe_set_vf_rxmode(res->port_id, res->vf_id, rx_mode, (uint8_t)is_on);
 	if (ret < 0)
 		printf("bad VF receive mode parameter, return code = %d \n",
 		ret);
@@ -6756,6 +6759,7 @@ cmdline_parse_inst_t cmd_set_vf_rxmode = {
 		NULL,
 	},
 };
+#endif
 
 /* *** ADD MAC ADDRESS FILTER FOR A VF OF A PORT *** */
 struct cmd_vf_mac_addr_result {
@@ -6822,6 +6826,7 @@ cmdline_parse_inst_t cmd_vf_mac_addr_filter = {
 	},
 };
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** ADD/REMOVE A VLAN IDENTIFIER TO/FROM A PORT VLAN RX FILTER *** */
 struct cmd_vf_rx_vlan_filter {
 	cmdline_fixed_string_t rx_vlan;
@@ -6884,6 +6889,7 @@ cmdline_parse_inst_t cmd_vf_rxvlan_filter = {
 		NULL,
 	},
 };
+#endif
 
 /* *** SET RATE LIMIT FOR A QUEUE OF A PORT *** */
 struct cmd_queue_rate_limit_result {
@@ -6952,6 +6958,7 @@ cmdline_parse_inst_t cmd_queue_rate_limit = {
 	},
 };
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 /* *** SET RATE LIMIT FOR A VF OF A PORT *** */
 struct cmd_vf_rate_limit_result {
 	cmdline_fixed_string_t set;
@@ -7030,6 +7037,7 @@ cmdline_parse_inst_t cmd_vf_rate_limit = {
 		NULL,
 	},
 };
+#endif
 
 /* *** ADD TUNNEL FILTER OF A PORT *** */
 struct cmd_tunnel_filter_result {
@@ -11561,15 +11569,11 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_config_burst,
 	(cmdline_parse_inst_t *)&cmd_config_thresh,
 	(cmdline_parse_inst_t *)&cmd_config_threshold,
-	(cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
 	(cmdline_parse_inst_t *)&cmd_set_uc_hash_filter,
 	(cmdline_parse_inst_t *)&cmd_set_uc_all_hash_filter,
 	(cmdline_parse_inst_t *)&cmd_vf_mac_addr_filter,
 	(cmdline_parse_inst_t *)&cmd_set_vf_macvlan_filter,
-	(cmdline_parse_inst_t *)&cmd_set_vf_traffic,
-	(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,
 	(cmdline_parse_inst_t *)&cmd_queue_rate_limit,
-	(cmdline_parse_inst_t *)&cmd_vf_rate_limit,
 	(cmdline_parse_inst_t *)&cmd_tunnel_filter,
 	(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,
 	(cmdline_parse_inst_t *)&cmd_global_config,
@@ -11624,6 +11628,10 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_set_all_queues_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_split_drop_en,
 	(cmdline_parse_inst_t *)&cmd_set_vf_mac_addr,
+	(cmdline_parse_inst_t *)&cmd_set_vf_rxmode,
+	(cmdline_parse_inst_t *)&cmd_set_vf_traffic,
+	(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,
+	(cmdline_parse_inst_t *)&cmd_vf_rate_limit,
 #endif
 	NULL,
 };
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf537d..73b0ffa 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -92,6 +92,9 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_cycles.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 
 #include "testpmd.h"
 
@@ -2324,6 +2327,7 @@ fdir_set_flex_payload(portid_t port_id, struct rte_eth_flex_payload_cfg *cfg)
 
 }
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 void
 set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 {
@@ -2332,16 +2336,17 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 	if (port_id_is_invalid(port_id, ENABLED_WARN))
 		return;
 	if (is_rx)
-		diag = rte_eth_dev_set_vf_rx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
-		diag = rte_eth_dev_set_vf_tx(port_id,vf,on);
+		diag = rte_pmd_ixgbe_set_vf_tx(port_id, vf, on);
+
 	if (diag == 0)
 		return;
 	if(is_rx)
-		printf("rte_eth_dev_set_vf_rx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_rx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 	else
-		printf("rte_eth_dev_set_vf_tx for port_id=%d failed "
+		printf("rte_pmd_ixgbe_set_vf_tx for port_id=%d failed "
 	       		"diag=%d\n", port_id, diag);
 
 }
@@ -2355,12 +2360,15 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 		return;
 	if (vlan_id_is_invalid(vlan_id))
 		return;
-	diag = rte_eth_dev_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+
+	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
+
 	if (diag == 0)
 		return;
-	printf("rte_eth_dev_set_vf_vlan_filter for port_id=%d failed "
+	printf("rte_pmd_ixgbe_set_vf_vlan_filter for port_id=%d failed "
 	       "diag=%d\n", port_id, diag);
 }
+#endif
 
 int
 set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
@@ -2384,6 +2392,7 @@ set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
 	return diag;
 }
 
+#ifdef RTE_LIBRTE_IXGBE_PMD
 int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
@@ -2401,13 +2410,14 @@ set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 			rate, link.link_speed);
 		return 1;
 	}
-	diag = rte_eth_set_vf_rate_limit(port_id, vf, rate, q_msk);
+	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-	printf("rte_eth_set_vf_rate_limit for port_id=%d failed diag=%d\n",
+	printf("rte_pmd_ixgbe_set_vf_rate_limit for port_id=%d failed diag=%d\n",
 		port_id, diag);
 	return diag;
 }
+#endif
 
 /*
  * Functions to manage the set of filtered Multicast MAC addresses.
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 3/7] app/testpmd: cleanup parameter checking
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                       ` (2 preceding siblings ...)
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 2/7] app/testpmd: use ixgbe public functions Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 4/7] examples/ethtool: use ixgbe public function Bernard Iremonger
                       ` (3 subsequent siblings)
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Parameter checking is done in the rte_pmd_ixgbe_* functions.
Remove parameter checking from before calls to the rte_pmd_ixgbe_*
functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 73b0ffa..fc0424a 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -2333,8 +2333,6 @@ set_vf_traffic(portid_t port_id, uint8_t is_rx, uint16_t vf, uint8_t on)
 {
 	int diag;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
 	if (is_rx)
 		diag = rte_pmd_ixgbe_set_vf_rx(port_id, vf, on);
 	else
@@ -2356,11 +2354,6 @@ set_vf_rx_vlan(portid_t port_id, uint16_t vlan_id, uint64_t vf_mask, uint8_t on)
 {
 	int diag;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return;
-	if (vlan_id_is_invalid(vlan_id))
-		return;
-
 	diag = rte_pmd_ixgbe_set_vf_vlan_filter(port_id, vlan_id, vf_mask, on);
 
 	if (diag == 0)
@@ -2397,19 +2390,7 @@ int
 set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
 {
 	int diag;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
 
-	if (port_id_is_invalid(port_id, ENABLED_WARN))
-		return 1;
-	rte_eth_link_get_nowait(port_id, &link);
-	if (rate > link.link_speed) {
-		printf("Invalid rate value:%u bigger than link speed: %u\n",
-			rate, link.link_speed);
-		return 1;
-	}
 	diag = rte_pmd_ixgbe_set_vf_rate_limit(port_id, vf, rate, q_msk);
 	if (diag == 0)
 		return diag;
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 4/7] examples/ethtool: use ixgbe public function
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                       ` (3 preceding siblings ...)
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 3/7] app/testpmd: cleanup parameter checking Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 5/7] net/ixgbe: remove static set VF functions Bernard Iremonger
                       ` (2 subsequent siblings)
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

Replace rte_eth_dev_set_vf_rxmode with rte_pmd_ixgbe_set_vf_rx_mode.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 examples/ethtool/lib/rte_ethtool.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index a1f91d4..bf50660 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -36,6 +36,9 @@
 #include <rte_version.h>
 #include <rte_ethdev.h>
 #include <rte_ether.h>
+#ifdef RTE_LIBRTE_IXGBE_PMD
+#include <rte_pmd_ixgbe.h>
+#endif
 #include "rte_ethtool.h"
 
 #define PKTPOOL_SIZE 512
@@ -353,9 +356,12 @@ rte_ethtool_net_set_rx_mode(uint8_t port_id)
 	num_vfs = dev_info.max_vfs;
 
 	/* Set VF vf_rx_mode, VF unsupport status is discard */
-	for (vf = 0; vf < num_vfs; vf++)
-		rte_eth_dev_set_vf_rxmode(port_id, vf,
+	for (vf = 0; vf < num_vfs; vf++) {
+#ifdef RTE_LIBRTE_IXGBE_PMD
+		rte_pmd_ixgbe_set_vf_rxmode(port_id, vf,
 			ETH_VMDQ_ACCEPT_UNTAG, 0);
+#endif
+	}
 
 	/* Enable Rx vlan filter, VF unspport status is discard */
 	rte_eth_dev_set_vlan_offload(port_id, ETH_VLAN_FILTER_MASK);
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 5/7] net/ixgbe: remove static set VF functions
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                       ` (4 preceding siblings ...)
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 4/7] examples/ethtool: use ixgbe public function Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 6/7] librte_ether: remove the set VF API's Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 7/7] doc: update release notes Bernard Iremonger
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following static functions:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 193 ---------------------------------------
 1 file changed, 193 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 37b82a4..8db1410 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -276,12 +276,6 @@ static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev);
 static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct
 		ether_addr * mac_addr, uint8_t on);
 static int ixgbe_uc_all_hash_table_set(struct rte_eth_dev *dev, uint8_t on);
-static int  ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev,  uint16_t pool,
-		uint16_t rx_mask, uint8_t on);
-static int ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on);
-static int ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-		uint64_t pool_mask, uint8_t vlan_on);
 static int ixgbe_mirror_rule_set(struct rte_eth_dev *dev,
 		struct rte_eth_mirror_conf *mirror_conf,
 		uint8_t rule_id, uint8_t on);
@@ -297,8 +291,6 @@ static void ixgbe_configure_msix(struct rte_eth_dev *dev);
 
 static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 		uint16_t queue_idx, uint16_t tx_rate);
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-		uint16_t tx_rate, uint64_t q_msk);
 
 static void ixgbevf_add_mac_addr(struct rte_eth_dev *dev,
 				 struct ether_addr *mac_addr,
@@ -568,12 +560,7 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {
 	.uc_all_hash_table_set  = ixgbe_uc_all_hash_table_set,
 	.mirror_rule_set      = ixgbe_mirror_rule_set,
 	.mirror_rule_reset    = ixgbe_mirror_rule_reset,
-	.set_vf_rx_mode       = ixgbe_set_pool_rx_mode,
-	.set_vf_rx            = ixgbe_set_pool_rx,
-	.set_vf_tx            = ixgbe_set_pool_tx,
-	.set_vf_vlan_filter   = ixgbe_set_pool_vlan_filter,
 	.set_queue_rate_limit = ixgbe_set_queue_rate_limit,
-	.set_vf_rate_limit    = ixgbe_set_vf_rate_limit,
 	.reta_update          = ixgbe_dev_rss_reta_update,
 	.reta_query           = ixgbe_dev_rss_reta_query,
 #ifdef RTE_NIC_BYPASS
@@ -4547,132 +4534,6 @@ ixgbe_convert_vm_rx_mask_to_val(uint16_t rx_mask, uint32_t orig_val)
 	return new_val;
 }
 
-static int
-ixgbe_set_pool_rx_mode(struct rte_eth_dev *dev, uint16_t pool,
-			       uint16_t rx_mask, uint8_t on)
-{
-	int val = 0;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	uint32_t vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(pool));
-
-	if (hw->mac.type == ixgbe_mac_82598EB) {
-		PMD_INIT_LOG(ERR, "setting VF receive mode set should be done"
-			     " on 82599 hardware and newer");
-		return -ENOTSUP;
-	}
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	val = ixgbe_convert_vm_rx_mask_to_val(rx_mask, val);
-
-	if (on)
-		vmolr |= val;
-	else
-		vmolr &= ~val;
-
-	IXGBE_WRITE_REG(hw, IXGBE_VMOLR(pool), vmolr);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_rx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFRE[1], otherwise PFVFRE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFRE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFRE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_tx(struct rte_eth_dev *dev, uint16_t pool, uint8_t on)
-{
-	uint32_t reg, addr;
-	uint32_t val;
-	const uint8_t bit1 = 0x1;
-
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-
-	if (pool >= ETH_64_POOLS)
-		return -EINVAL;
-
-	/* for pool >= 32, set bit in PFVFTE[1], otherwise PFVFTE[0] */
-	if (pool >= 32) {
-		addr = IXGBE_VFTE(1);
-		val = bit1 << (pool - 32);
-	} else {
-		addr = IXGBE_VFTE(0);
-		val = bit1 << pool;
-	}
-
-	reg = IXGBE_READ_REG(hw, addr);
-
-	if (on)
-		reg |= val;
-	else
-		reg &= ~val;
-
-	IXGBE_WRITE_REG(hw, addr, reg);
-
-	return 0;
-}
-
-static int
-ixgbe_set_pool_vlan_filter(struct rte_eth_dev *dev, uint16_t vlan,
-			uint64_t pool_mask, uint8_t vlan_on)
-{
-	int ret = 0;
-	uint16_t pool_idx;
-	struct ixgbe_hw *hw =
-		IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-
-	if (ixgbe_vmdq_mode_check(hw) < 0)
-		return -ENOTSUP;
-	for (pool_idx = 0; pool_idx < ETH_64_POOLS; pool_idx++) {
-		if (pool_mask & ((uint64_t)(1ULL << pool_idx))) {
-			ret = hw->mac.ops.set_vfta(hw, vlan, pool_idx,
-						   vlan_on, false);
-			if (ret < 0)
-				return ret;
-		}
-	}
-
-	return ret;
-}
 
 int
 rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint8_t port, uint16_t vf, uint8_t on)
@@ -5628,60 +5489,6 @@ static int ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev,
 	return 0;
 }
 
-static int ixgbe_set_vf_rate_limit(struct rte_eth_dev *dev, uint16_t vf,
-	uint16_t tx_rate, uint64_t q_msk)
-{
-	struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
-	struct ixgbe_vf_info *vfinfo =
-		*(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private));
-	uint8_t  nb_q_per_pool = RTE_ETH_DEV_SRIOV(dev).nb_q_per_pool;
-	uint32_t queue_stride =
-		IXGBE_MAX_RX_QUEUE_NUM / RTE_ETH_DEV_SRIOV(dev).active;
-	uint32_t queue_idx = vf * queue_stride, idx = 0, vf_idx;
-	uint32_t queue_end = queue_idx + nb_q_per_pool - 1;
-	uint16_t total_rate = 0;
-
-	if (queue_end >= hw->mac.max_tx_queues)
-		return -EINVAL;
-
-	if (vfinfo != NULL) {
-		for (vf_idx = 0; vf_idx < dev->pci_dev->max_vfs; vf_idx++) {
-			if (vf_idx == vf)
-				continue;
-			for (idx = 0; idx < RTE_DIM(vfinfo[vf_idx].tx_rate);
-				idx++)
-				total_rate += vfinfo[vf_idx].tx_rate[idx];
-		}
-	} else
-		return -EINVAL;
-
-	/* Store tx_rate for this vf. */
-	for (idx = 0; idx < nb_q_per_pool; idx++) {
-		if (((uint64_t)0x1 << idx) & q_msk) {
-			if (vfinfo[vf].tx_rate[idx] != tx_rate)
-				vfinfo[vf].tx_rate[idx] = tx_rate;
-			total_rate += tx_rate;
-		}
-	}
-
-	if (total_rate > dev->data->dev_link.link_speed) {
-		/*
-		 * Reset stored TX rate of the VF if it causes exceed
-		 * link speed.
-		 */
-		memset(vfinfo[vf].tx_rate, 0, sizeof(vfinfo[vf].tx_rate));
-		return -EINVAL;
-	}
-
-	/* Set RTTBCNRC of each queue/pool for vf X  */
-	for (; queue_idx <= queue_end; queue_idx++) {
-		if (0x1 & q_msk)
-			ixgbe_set_queue_rate_limit(dev, queue_idx, tx_rate);
-		q_msk = q_msk >> 1;
-	}
-
-	return 0;
-}
 
 static void
 ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 6/7] librte_ether: remove the set VF API's
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                       ` (5 preceding siblings ...)
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 5/7] net/ixgbe: remove static set VF functions Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 7/7] doc: update release notes Bernard Iremonger
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

remove the following API's:

rte_eth_dev_set_vf_rxmode
rte_eth_dev_set_vf_rx
rte_eth_dev_set_vf_tx
rte_eth_dev_set_vf_vlan_filter
rte_eth_dev_set_vf_rate_limit

Increment LIBABIVER in Makefile
Remove deprecation notice for removing rte_eth_dev_set_vf_* API's.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/deprecation.rst   |  13 ---
 lib/librte_ether/Makefile              |   4 +-
 lib/librte_ether/rte_ethdev.c          | 129 ------------------------------
 lib/librte_ether/rte_ethdev.h          | 140 ---------------------------------
 lib/librte_ether/rte_ether_version.map |   7 +-
 5 files changed, 3 insertions(+), 290 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 2d17bc6..c897c18 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -38,19 +38,6 @@ Deprecation Notices
   ``_rte_eth_dev_callback_process``. In 17.02 the function will return an ``int``
   instead of ``void`` and a fourth parameter ``void *ret_param`` will be added.
 
-* ethdev: for 17.02 it is planned to deprecate the following five functions
-  and move them in ixgbe:
-
-  ``rte_eth_dev_set_vf_rxmode``
-
-  ``rte_eth_dev_set_vf_rx``
-
-  ``rte_eth_dev_set_vf_tx``
-
-  ``rte_eth_dev_set_vf_vlan_filter``
-
-  ``rte_eth_set_vf_rate_limit``
-
 * ABI changes are planned for 17.02 in the ``rte_mbuf`` structure: some fields
   may be reordered to facilitate the writing of ``data_off``, ``refcnt``, and
   ``nb_segs`` in one operation, because some platforms have an overhead if the
diff --git a/lib/librte_ether/Makefile b/lib/librte_ether/Makefile
index efe1e5f..d23015c 100644
--- a/lib/librte_ether/Makefile
+++ b/lib/librte_ether/Makefile
@@ -1,6 +1,6 @@
 #   BSD LICENSE
 #
-#   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+#   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
 #   All rights reserved.
 #
 #   Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@ CFLAGS += $(WERROR_FLAGS)
 
 EXPORT_MAP := rte_ether_version.map
 
-LIBABIVER := 5
+LIBABIVER := 6
 
 SRCS-y += rte_ethdev.c
 
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 1e0f206..6a93014 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2137,32 +2137,6 @@ rte_eth_dev_default_mac_addr_set(uint8_t port_id, struct ether_addr *addr)
 	return 0;
 }
 
-int
-rte_eth_dev_set_vf_rxmode(uint8_t port_id,  uint16_t vf,
-				uint16_t rx_mode, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:invalid VF id %d\n", vf);
-		return -EINVAL;
-	}
-
-	if (rx_mode == 0) {
-		RTE_PMD_DEBUG_TRACE("set VF RX mode:mode mask ca not be zero\n");
-		return -EINVAL;
-	}
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx_mode, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx_mode)(dev, vf, rx_mode, on);
-}
 
 /*
  * Returns index into MAC address array of addr. Use 00:00:00:00:00:00 to find
@@ -2252,76 +2226,6 @@ rte_eth_dev_uc_all_hash_table_set(uint8_t port_id, uint8_t on)
 	return (*dev->dev_ops->uc_all_hash_table_set)(dev, on);
 }
 
-int
-rte_eth_dev_set_vf_rx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("port %d: invalid vf id\n", port_id);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_tx(uint8_t port_id, uint16_t vf, uint8_t on)
-{
-	uint16_t num_vfs;
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-
-	num_vfs = dev_info.max_vfs;
-	if (vf > num_vfs) {
-		RTE_PMD_DEBUG_TRACE("set pool tx:invalid pool id=%d\n", vf);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_tx, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_tx)(dev, vf, on);
-}
-
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port_id, uint16_t vlan_id,
-			       uint64_t vf_mask, uint8_t vlan_on)
-{
-	struct rte_eth_dev *dev;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-
-	if (vlan_id > ETHER_MAX_VLAN_ID) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:invalid VLAN id=%d\n",
-			vlan_id);
-		return -EINVAL;
-	}
-
-	if (vf_mask == 0) {
-		RTE_PMD_DEBUG_TRACE("VF VLAN filter:pool_mask can not be 0\n");
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_vlan_filter, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_vlan_filter)(dev, vlan_id,
-						   vf_mask, vlan_on);
-}
-
 int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 					uint16_t tx_rate)
 {
@@ -2352,39 +2256,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 	return (*dev->dev_ops->set_queue_rate_limit)(dev, queue_idx, tx_rate);
 }
 
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf, uint16_t tx_rate,
-				uint64_t q_msk)
-{
-	struct rte_eth_dev *dev;
-	struct rte_eth_dev_info dev_info;
-	struct rte_eth_link link;
-
-	if (q_msk == 0)
-		return 0;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
-
-	dev = &rte_eth_devices[port_id];
-	rte_eth_dev_info_get(port_id, &dev_info);
-	link = dev->data->dev_link;
-
-	if (vf > dev_info.max_vfs) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:port %d: "
-				"invalid vf id=%d\n", port_id, vf);
-		return -EINVAL;
-	}
-
-	if (tx_rate > link.link_speed) {
-		RTE_PMD_DEBUG_TRACE("set VF rate limit:invalid tx_rate=%d, "
-				"bigger than link speed= %d\n",
-				tx_rate, link.link_speed);
-		return -EINVAL;
-	}
-
-	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->set_vf_rate_limit, -ENOTSUP);
-	return (*dev->dev_ops->set_vf_rate_limit)(dev, vf, tx_rate, q_msk);
-}
-
 int
 rte_eth_mirror_rule_set(uint8_t port_id,
 			struct rte_eth_mirror_conf *mirror_conf,
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 9678179..c602d7d 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1249,39 +1249,11 @@ typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
 				  uint8_t on);
 /**< @internal Set all Unicast Hash bitmap */
 
-typedef int (*eth_set_vf_rx_mode_t)(struct rte_eth_dev *dev,
-				  uint16_t vf,
-				  uint16_t rx_mode,
-				  uint8_t on);
-/**< @internal Set a VF receive mode */
-
-typedef int (*eth_set_vf_rx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Set a VF receive  mode */
-
-typedef int (*eth_set_vf_tx_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint8_t on);
-/**< @internal Enable or disable a VF transmit   */
-
-typedef int (*eth_set_vf_vlan_filter_t)(struct rte_eth_dev *dev,
-				  uint16_t vlan,
-				  uint64_t vf_mask,
-				  uint8_t vlan_on);
-/**< @internal Set VF VLAN pool filter */
-
 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
 				uint16_t queue_idx,
 				uint16_t tx_rate);
 /**< @internal Set queue TX rate */
 
-typedef int (*eth_set_vf_rate_limit_t)(struct rte_eth_dev *dev,
-				uint16_t vf,
-				uint16_t tx_rate,
-				uint64_t q_msk);
-/**< @internal Set VF TX rate */
-
 typedef int (*eth_mirror_rule_set_t)(struct rte_eth_dev *dev,
 				  struct rte_eth_mirror_conf *mirror_conf,
 				  uint8_t rule_id,
@@ -1479,16 +1451,11 @@ struct eth_dev_ops {
 	eth_uc_all_hash_table_set_t uc_all_hash_table_set;  /**< Set Unicast hash bitmap */
 	eth_mirror_rule_set_t	   mirror_rule_set;  /**< Add a traffic mirror rule.*/
 	eth_mirror_rule_reset_t	   mirror_rule_reset;  /**< reset a traffic mirror rule.*/
-	eth_set_vf_rx_mode_t       set_vf_rx_mode;   /**< Set VF RX mode */
-	eth_set_vf_rx_t            set_vf_rx;  /**< enable/disable a VF receive */
-	eth_set_vf_tx_t            set_vf_tx;  /**< enable/disable a VF transmit */
-	eth_set_vf_vlan_filter_t   set_vf_vlan_filter;  /**< Set VF VLAN filter */
 	/** Add UDP tunnel port. */
 	eth_udp_tunnel_port_add_t udp_tunnel_port_add;
 	/** Del UDP tunnel port. */
 	eth_udp_tunnel_port_del_t udp_tunnel_port_del;
 	eth_set_queue_rate_limit_t set_queue_rate_limit;   /**< Set queue rate limit */
-	eth_set_vf_rate_limit_t    set_vf_rate_limit;   /**< Set VF rate limit */
 	/** Update redirection table. */
 	reta_update_t reta_update;
 	/** Query redirection table. */
@@ -3403,93 +3370,6 @@ int rte_eth_dev_uc_hash_table_set(uint8_t port,struct ether_addr *addr,
  */
 int rte_eth_dev_uc_all_hash_table_set(uint8_t port,uint8_t on);
 
- /**
- * Set RX L2 Filtering mode of a VF of an Ethernet device.
- *
- * @param port
- *   The port identifier of the Ethernet device.
- * @param vf
- *   VF id.
- * @param rx_mode
- *    The RX mode mask, which  is one or more of  accepting Untagged Packets,
- *    packets that match the PFUTA table, Broadcast and Multicast Promiscuous.
- *    ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC,
- *    ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used
- *    in rx_mode.
- * @param on
- *    1 - Enable a VF RX mode.
- *    0 - Disable a VF RX mode.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support.
- *   - (-ENOTSUP) if hardware doesn't support.
- *   - (-EINVAL) if bad parameter.
- */
-int rte_eth_dev_set_vf_rxmode(uint8_t port, uint16_t vf, uint16_t rx_mode,
-				uint8_t on);
-
-/**
-* Enable or disable a VF traffic transmit of the Ethernet device.
-*
-* @param port
-*   The port identifier of the Ethernet device.
-* @param vf
-*   VF id.
-* @param on
-*    1 - Enable a VF traffic transmit.
-*    0 - Disable a VF traffic transmit.
-* @return
-*   - (0) if successful.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_tx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable or disable a VF traffic receive of an Ethernet device.
-*
-* @param port
-*   The port identifier of the Ethernet device.
-* @param vf
-*   VF id.
-* @param on
-*    1 - Enable a VF traffic receive.
-*    0 - Disable a VF traffic receive.
-* @return
-*   - (0) if successful.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_rx(uint8_t port,uint16_t vf, uint8_t on);
-
-/**
-* Enable/Disable hardware VF VLAN filtering by an Ethernet device of
-* received VLAN packets tagged with a given VLAN Tag Identifier.
-*
-* @param port id
-*   The port identifier of the Ethernet device.
-* @param vlan_id
-*   The VLAN Tag Identifier whose filtering must be enabled or disabled.
-* @param vf_mask
-*    Bitmap listing which VFs participate in the VLAN filtering.
-* @param vlan_on
-*    1 - Enable VFs VLAN filtering.
-*    0 - Disable VFs VLAN filtering.
-* @return
-*   - (0) if successful.
-*   - (-ENOTSUP) if hardware doesn't support.
-*   - (-ENODEV) if *port_id* invalid.
-*   - (-EINVAL) if bad parameter.
-*/
-int
-rte_eth_dev_set_vf_vlan_filter(uint8_t port, uint16_t vlan_id,
-				uint64_t vf_mask,
-				uint8_t vlan_on);
-
 /**
  * Set a traffic mirroring rule on an Ethernet device
  *
@@ -3551,26 +3431,6 @@ int rte_eth_set_queue_rate_limit(uint8_t port_id, uint16_t queue_idx,
 			uint16_t tx_rate);
 
 /**
- * Set the rate limitation for a vf on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param vf
- *   VF id.
- * @param tx_rate
- *   The tx rate allocated from the total link speed for this VF id.
- * @param q_msk
- *   The queue mask which need to set the rate.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support this feature.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if bad parameter.
- */
-int rte_eth_set_vf_rate_limit(uint8_t port_id, uint16_t vf,
-			uint16_t tx_rate, uint64_t q_msk);
-
-/**
  * Initialize bypass logic. This function needs to be called before
  * executing any other bypass API.
  *
diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map
index 72be66d..7594416 100644
--- a/lib/librte_ether/rte_ether_version.map
+++ b/lib/librte_ether/rte_ether_version.map
@@ -61,10 +61,6 @@ DPDK_2.2 {
 	rte_eth_dev_set_mtu;
 	rte_eth_dev_set_rx_queue_stats_mapping;
 	rte_eth_dev_set_tx_queue_stats_mapping;
-	rte_eth_dev_set_vf_rx;
-	rte_eth_dev_set_vf_rxmode;
-	rte_eth_dev_set_vf_tx;
-	rte_eth_dev_set_vf_vlan_filter;
 	rte_eth_dev_set_vlan_offload;
 	rte_eth_dev_set_vlan_pvid;
 	rte_eth_dev_set_vlan_strip_on_queue;
@@ -94,7 +90,6 @@ DPDK_2.2 {
 	rte_eth_rx_queue_info_get;
 	rte_eth_rx_queue_setup;
 	rte_eth_set_queue_rate_limit;
-	rte_eth_set_vf_rate_limit;
 	rte_eth_stats;
 	rte_eth_stats_get;
 	rte_eth_stats_reset;
@@ -146,4 +141,4 @@ DPDK_16.11 {
 	rte_eth_dev_pci_probe;
 	rte_eth_dev_pci_remove;
 
-} DPDK_16.07;
+} DPDK_16.07;
\ No newline at end of file
-- 
2.10.1

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

* [dpdk-dev] [PATCH v4 7/7] doc: update release notes
  2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
                       ` (6 preceding siblings ...)
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 6/7] librte_ether: remove the set VF API's Bernard Iremonger
@ 2016-12-13 11:40     ` Bernard Iremonger
  7 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-13 11:40 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1871 bytes --]

Add release note for removing set VF API's from the ethdev,
renaming the API's and moving them to the ixgbe PMD.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 doc/guides/rel_notes/release_17_02.rst | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/doc/guides/rel_notes/release_17_02.rst b/doc/guides/rel_notes/release_17_02.rst
index 3b65038..7a40057 100644
--- a/doc/guides/rel_notes/release_17_02.rst
+++ b/doc/guides/rel_notes/release_17_02.rst
@@ -38,7 +38,6 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
-
 Resolved Issues
 ---------------
 
@@ -102,6 +101,26 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =========================================================
 
+* **Moved five APIs for VF management from the ethdev to the ixgbe PMD.**
+
+  The following five APIs for VF management from the PF have been removed from the ethdev,
+  renamed and added to the ixgbe PMD::
+
+    rte_eth_dev_set_vf_rate_limit
+    rte_eth_dev_set_vf_rx
+    rte_eth_dev_set_vf_rxmode
+    rte_eth_dev_set_vf_tx
+    rte_eth_dev_set_vf_vlan_filter
+
+  The API's have been renamed to the following::
+
+    rte_pmd_ixgbe_set_vf_rate_limit
+    rte_pmd_ixgbe_set_vf_rx
+    rte_pmd_ixgbe_set_vf_rxmode
+    rte_pmd_ixgbe_set_vf_tx
+    rte_pmd_ixgbe_set_vf_vlan_filter
+
+  The declarations for the API’s can be found in ``rte_pmd_ixgbe.h``.
 
 ABI Changes
 -----------
@@ -142,7 +161,7 @@ The libraries prepended with a plus sign were incremented in this version.
      librte_cryptodev.so.2
      librte_distributor.so.1
      librte_eal.so.3
-     librte_ethdev.so.5
+     +librte_ethdev.so.6
      librte_hash.so.2
      librte_ip_frag.so.1
      librte_jobstats.so.1
-- 
2.10.1

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

* Re: [dpdk-dev] [PATCH v4 0/7] net/ixgbe: move set VF functions.
  2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 0/7] " Bernard Iremonger
@ 2016-12-13 13:36       ` Ferruh Yigit
  2016-12-13 13:46         ` Iremonger, Bernard
  0 siblings, 1 reply; 51+ messages in thread
From: Ferruh Yigit @ 2016-12-13 13:36 UTC (permalink / raw)
  To: Bernard Iremonger, thomas.monjalon, dev

On 12/13/2016 11:40 AM, Bernard Iremonger wrote:
> This patchset implements the following deprecation notice:
> [PATCH v1] doc: announce API and ABI change for librte_ether
> 
> Changes in  V4:
> Fixed compile issues when ixgbe PMD is not present.
> Removed duplicate testpmd commands.
> Added cleanup patch for testpmd.
> Updated release note.
> 
> Changes in V3:
> Updated LIBABIVER in Makefile in librte_ether patch.
> Updated rte_ethdev.h and ret_ether_version.map in librte_ether patch.
> Squashed deprecation notice patch into librte_ether patch.
> Added release_note patch.
> 
> Changes in V2:
> Update testpmd set vf commands help messages.
> Updated ethtool to use the ixgbe public API's.
> Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
> Removed the rte_eth_dev_set_vf_* API's
> Removed the deprecation notice.
> 
> Changes in V1:
> The following functions from eth_dev_ops have been moved to the ixgbe PMD
> and renamed:
> 
> ixgbe_set_pool_rx_mode
> ixgbe_set_pool_rx
> ixgbe_set_pool_tx
> ixgbe_set_pool_vlan_filter
> ixgbe_set_vf_rate_limit
> 
> Renamed the functions to the following:
> 
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> Testpmd has been modified to use the following functions:
> rte_pmd_ixgbe_set_vf_rxmode
> rte_pmd_ixgbe_set_vf_rate_limit
> 
> New testpmd commands have been added to test the following functions:
> rte_pmd_ixgbe_set_vf_rx
> rte_pmd_ixgbe_set_vf_tx
> rte_pmd_ixgbe_set_vf_vlan_filter
> 
> The testpmd user guide has been updated for the new commands.
> 
> Bernard Iremonger (7):
>   net/ixgbe: move set VF functions from the ethdev
>   app/testpmd: use ixgbe public functions
>   app/testpmd: cleanup parameter checking
>   examples/ethtool: use ixgbe public function
>   net/ixgbe: remove static set VF functions
>   librte_ether: remove the set VF API's
>   doc: update release notes
> 

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

Last patch squashed.

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

* Re: [dpdk-dev] [PATCH v4 0/7] net/ixgbe: move set VF functions.
  2016-12-13 13:36       ` Ferruh Yigit
@ 2016-12-13 13:46         ` Iremonger, Bernard
  0 siblings, 0 replies; 51+ messages in thread
From: Iremonger, Bernard @ 2016-12-13 13:46 UTC (permalink / raw)
  To: Yigit, Ferruh, thomas.monjalon, dev


Hi Ferruh,

> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, December 13, 2016 1:37 PM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>;
> thomas.monjalon@6wind.com; dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v4 0/7] net/ixgbe: move set VF functions.
> 
> On 12/13/2016 11:40 AM, Bernard Iremonger wrote:
> > This patchset implements the following deprecation notice:
> > [PATCH v1] doc: announce API and ABI change for librte_ether
> >
> > Changes in  V4:
> > Fixed compile issues when ixgbe PMD is not present.
> > Removed duplicate testpmd commands.
> > Added cleanup patch for testpmd.
> > Updated release note.
> >
> > Changes in V3:
> > Updated LIBABIVER in Makefile in librte_ether patch.
> > Updated rte_ethdev.h and ret_ether_version.map in librte_ether patch.
> > Squashed deprecation notice patch into librte_ether patch.
> > Added release_note patch.
> >
> > Changes in V2:
> > Update testpmd set vf commands help messages.
> > Updated ethtool to use the ixgbe public API's.
> > Removed the ixgbe_set_pool_* and ixgbe_set_vf_rate_limit functions.
> > Removed the rte_eth_dev_set_vf_* API's Removed the deprecation
> notice.
> >
> > Changes in V1:
> > The following functions from eth_dev_ops have been moved to the ixgbe
> > PMD and renamed:
> >
> > ixgbe_set_pool_rx_mode
> > ixgbe_set_pool_rx
> > ixgbe_set_pool_tx
> > ixgbe_set_pool_vlan_filter
> > ixgbe_set_vf_rate_limit
> >
> > Renamed the functions to the following:
> >
> > rte_pmd_ixgbe_set_vf_rxmode
> > rte_pmd_ixgbe_set_vf_rx
> > rte_pmd_ixgbe_set_vf_tx
> > rte_pmd_ixgbe_set_vf_vlan_filter
> > rte_pmd_ixgbe_set_vf_rate_limit
> >
> > Testpmd has been modified to use the following functions:
> > rte_pmd_ixgbe_set_vf_rxmode
> > rte_pmd_ixgbe_set_vf_rate_limit
> >
> > New testpmd commands have been added to test the following functions:
> > rte_pmd_ixgbe_set_vf_rx
> > rte_pmd_ixgbe_set_vf_tx
> > rte_pmd_ixgbe_set_vf_vlan_filter
> >
> > The testpmd user guide has been updated for the new commands.
> >
> > Bernard Iremonger (7):
> >   net/ixgbe: move set VF functions from the ethdev
> >   app/testpmd: use ixgbe public functions
> >   app/testpmd: cleanup parameter checking
> >   examples/ethtool: use ixgbe public function
> >   net/ixgbe: remove static set VF functions
> >   librte_ether: remove the set VF API's
> >   doc: update release notes
> >
> 
> Series applied to dpdk-next-net/master, thanks.
> 
> Last patch squashed.

Thanks.

Regards,

Bernard.

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

* [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions.
@ 2016-12-09 11:17 Bernard Iremonger
  0 siblings, 0 replies; 51+ messages in thread
From: Bernard Iremonger @ 2016-12-09 11:17 UTC (permalink / raw)
  To: thomas.monjalon, dev; +Cc: Bernard Iremonger

This patchset implements the following deprecation notice:
[PATCH v1] doc: announce API and ABI change for librte_ether

The following functions from eth_dev_ops have been moved to the ixgbe PMD
and renamed:

ixgbe_set_pool_rx_mode
ixgbe_set_pool_rx
ixgbe_set_pool_tx
ixgbe_set_pool_vlan_filter
ixgbe_set_vf_rate_limit

Renamed the functions to the following:

rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter
rte_pmd_ixgbe_set_vf_rate_limit

Testpmd has been modified to use the following functions:
rte_pmd_ixgbe_set_vf_rxmode
rte_pmd_ixgbe_set_vf_rate_limit

New testpmd commands have been added to test the following functions:
rte_pmd_ixgbe_set_vf_rx
rte_pmd_ixgbe_set_vf_tx
rte_pmd_ixgbe_set_vf_vlan_filter

The testpmd user guide has been updated for the new commands.

Bernard Iremonger (5):
  net/ixgbe: move set VF functions from the ethdev
  app/testpmd: use ixgbe public functions
  app/testpmd: add command for set VF VLAN filter
  app/testpmd: add command for set VF receive
  app/testpmd: add command for set VF transmit

 app/test-pmd/cmdline.c                      | 270 +++++++++++++++++++++++++++-
 app/test-pmd/config.c                       |  31 ++--
 doc/guides/testpmd_app_ug/testpmd_funcs.rst |  21 +++
 drivers/net/ixgbe/ixgbe_ethdev.c            | 263 +++++++++++++++++++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe.h           | 104 +++++++++++
 drivers/net/ixgbe/rte_pmd_ixgbe_version.map |  10 ++
 6 files changed, 678 insertions(+), 21 deletions(-)

-- 
2.10.1

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

end of thread, other threads:[~2016-12-13 13:46 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-09 11:27 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger
2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 1/5] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 2/5] app/testpmd: use ixgbe public functions Bernard Iremonger
2016-12-09 11:56   ` Ferruh Yigit
2016-12-09 12:08     ` Iremonger, Bernard
2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 3/5] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
2016-12-09 12:02   ` Ferruh Yigit
2016-12-09 12:10     ` Iremonger, Bernard
2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 4/5] app/testpmd: add command for set VF receive Bernard Iremonger
2016-12-09 11:27 ` [dpdk-dev] [PATCH v1 5/5] app/testpmd: add command for set VF transmit Bernard Iremonger
2016-12-09 11:54 ` [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Ferruh Yigit
2016-12-09 12:00   ` Iremonger, Bernard
2016-12-09 13:04     ` Thomas Monjalon
2016-12-09 13:23       ` Iremonger, Bernard
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 0/9] " Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 " Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 0/7] " Bernard Iremonger
2016-12-13 13:36       ` Ferruh Yigit
2016-12-13 13:46         ` Iremonger, Bernard
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 1/7] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 2/7] app/testpmd: use ixgbe public functions Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 3/7] app/testpmd: cleanup parameter checking Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 4/7] examples/ethtool: use ixgbe public function Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 5/7] net/ixgbe: remove static set VF functions Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 6/7] librte_ether: remove the set VF API's Bernard Iremonger
2016-12-13 11:40     ` [dpdk-dev] [PATCH v4 7/7] doc: update release notes Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
2016-12-12 16:25     ` Ferruh Yigit
2016-12-13  9:04       ` Iremonger, Bernard
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 8/9] librte_ether: remove the set VF API's Bernard Iremonger
2016-12-12 13:50   ` [dpdk-dev] [PATCH v3 9/9] doc: update release notes Bernard Iremonger
2016-12-12 15:51     ` Ferruh Yigit
2016-12-12 15:55       ` Iremonger, Bernard
2016-12-12 16:07         ` Ferruh Yigit
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 1/9] net/ixgbe: move set VF functions from the ethdev Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 2/9] app/testpmd: use ixgbe public functions Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 3/9] app/testpmd: add command for set VF VLAN filter Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 4/9] app/testpmd: add command for set VF receive Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 5/9] app/testpmd: add command for set VF transmit Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 6/9] examples/ethtool: use ixgbe public function Bernard Iremonger
2016-12-09 17:25 ` [dpdk-dev] [PATCH v2 7/9] net/ixgbe: remove static set VF functions Bernard Iremonger
2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 8/9] librte_ether: remove the set VF API's Bernard Iremonger
2016-12-09 18:00   ` Ferruh Yigit
2016-12-09 17:26 ` [dpdk-dev] [PATCH v2 9/9] doc: remove deprecation notice Bernard Iremonger
  -- strict thread matches above, loose matches on Subject: below --
2016-12-09 11:17 [dpdk-dev] [PATCH v1 0/5] net/ixgbe: move set VF functions Bernard Iremonger

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).