[v5] net/ice: enable eCPRI tunnel port configure in dcf

Message ID 20210119041902.81524-1-jia.guo@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v5] net/ice: enable eCPRI tunnel port configure in dcf |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-testing fail Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS

Commit Message

Guo, Jia Jan. 19, 2021, 4:19 a.m. UTC
  Add eCPRI tunnel port add and rm ops to configure eCPRI UDP tunnel port
in dcf.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
---
v5:
rebase patch

v4:
add doc
---
 doc/guides/rel_notes/release_21_02.rst | 12 +++++
 drivers/net/ice/ice_dcf_ethdev.c       | 67 ++++++++++++++++++++++++++
 2 files changed, 79 insertions(+)
  

Comments

Qi Zhang Jan. 20, 2021, 10:14 a.m. UTC | #1
> -----Original Message-----
> From: Guo, Jia <jia.guo@intel.com>
> Sent: Tuesday, January 19, 2021 12:19 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; thomas@monjalon.net; Yigit, Ferruh
> <ferruh.yigit@intel.com>; andrew.rybchenko@oktetlabs.ru; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Xing,
> Beilei <beilei.xing@intel.com>
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>;
> dev@dpdk.org; Guo, Jia <jia.guo@intel.com>; Su, Simei <simei.su@intel.com>;
> orika@nvidia.com; getelson@nvidia.com; maxime.coquelin@redhat.com;
> jerinj@marvell.com; ajit.khaparde@broadcom.com; bingz@nvidia.com; Kinsella,
> Ray <ray.kinsella@intel.com>; dodji@redhat.com; david.marchand@redhat.com
> Subject: [dpdk-dev v5] net/ice: enable eCPRI tunnel port configure in dcf
> 
> Add eCPRI tunnel port add and rm ops to configure eCPRI UDP tunnel port in dcf.
> 
> Signed-off-by: Jeff Guo <jia.guo@intel.com>
> ---
> v5:
> rebase patch
> 
> v4:
> add doc
> ---
>  doc/guides/rel_notes/release_21_02.rst | 12 +++++
>  drivers/net/ice/ice_dcf_ethdev.c       | 67 ++++++++++++++++++++++++++
>  2 files changed, 79 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/release_21_02.rst
> b/doc/guides/rel_notes/release_21_02.rst
> index 78ec2758e2..6b7870779f 100644
> --- a/doc/guides/rel_notes/release_21_02.rst
> +++ b/doc/guides/rel_notes/release_21_02.rst
> @@ -106,6 +106,18 @@ New Features
> 
>    * Added Double VLAN support for DCF switch QinQ filtering.
> 
> +* **Updated the Intel ice driver.**
> +
> +  Updated the Intel ice driver with new features and improvements, including:
> +
> +  * Added support for UDP dynamic port assignment for eCPRI protocol
> feature.

Need to claim this is a feature for ice DCF, reword to

Added support for UDP dynamic port assignment for eCPRI tunnel in DCF.

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  
Thomas Monjalon Jan. 20, 2021, 10:19 a.m. UTC | #2
20/01/2021 11:14, Zhang, Qi Z:
> From: Guo, Jia <jia.guo@intel.com>
> > +  * Added support for UDP dynamic port assignment for eCPRI protocol
> > feature.
> 
> Need to claim this is a feature for ice DCF

What is DCF?
  
Qi Zhang Jan. 20, 2021, 10:23 a.m. UTC | #3
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, January 20, 2021 6:20 PM
> To: Guo, Jia <jia.guo@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>
> Cc: andrew.rybchenko@oktetlabs.ru; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>;
> dev@dpdk.org; Su, Simei <simei.su@intel.com>; orika@nvidia.com;
> getelson@nvidia.com; maxime.coquelin@redhat.com; jerinj@marvell.com;
> ajit.khaparde@broadcom.com; bingz@nvidia.com; Kinsella, Ray
> <ray.kinsella@intel.com>; dodji@redhat.com; david.marchand@redhat.com
> Subject: Re: [dpdk-dev v5] net/ice: enable eCPRI tunnel port configure in dcf
> 
> 20/01/2021 11:14, Zhang, Qi Z:
> > From: Guo, Jia <jia.guo@intel.com>
> > > +  * Added support for UDP dynamic port assignment for eCPRI protocol
> > > feature.
> >
> > Need to claim this is a feature for ice DCF
> 
> What is DCF?
> 
> 
Its "Device Config Function" (DCF), please check ice.rst for detail.

Regards
Qi
  
Thomas Monjalon Jan. 20, 2021, 10:30 a.m. UTC | #4
20/01/2021 11:23, Zhang, Qi Z:
> From: Thomas Monjalon <thomas@monjalon.net>
> > What is DCF?
> > 
> > 
> Its "Device Config Function" (DCF), please check ice.rst for detail.

Thank you.
As you know, I am interested in the privileged rights.
This is what I found in ice.rst:

	A DCF PMD bounds to the device's trusted VF with ID 0
	[...]
	#. Enable the VF0 trust on::
	   ip link set dev enp24s0f0 vf 0 trust on

Does it mean only VF 0 can be trusted?
  
Qi Zhang Jan. 20, 2021, 10:36 a.m. UTC | #5
> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Wednesday, January 20, 2021 6:31 PM
> To: Guo, Jia <jia.guo@intel.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; Lu,
> Wenzhuo <wenzhuo.lu@intel.com>; Xing, Beilei <beilei.xing@intel.com>; Zhang,
> Qi Z <qi.z.zhang@intel.com>
> Cc: andrew.rybchenko@oktetlabs.ru; Iremonger, Bernard
> <bernard.iremonger@intel.com>; Wu, Jingjing <jingjing.wu@intel.com>; Yang,
> Qiming <qiming.yang@intel.com>; Wang, Haiyue <haiyue.wang@intel.com>;
> dev@dpdk.org; Su, Simei <simei.su@intel.com>; orika@nvidia.com;
> getelson@nvidia.com; maxime.coquelin@redhat.com; jerinj@marvell.com;
> ajit.khaparde@broadcom.com; bingz@nvidia.com; Kinsella, Ray
> <ray.kinsella@intel.com>; dodji@redhat.com; david.marchand@redhat.com
> Subject: Re: [dpdk-dev v5] net/ice: enable eCPRI tunnel port configure in dcf
> 
> 20/01/2021 11:23, Zhang, Qi Z:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > What is DCF?
> > >
> > >
> > Its "Device Config Function" (DCF), please check ice.rst for detail.
> 
> Thank you.
> As you know, I am interested in the privileged rights.
> This is what I found in ice.rst:
> 
> 	A DCF PMD bounds to the device's trusted VF with ID 0
> 	[...]
> 	#. Enable the VF0 trust on::
> 	   ip link set dev enp24s0f0 vf 0 trust on
> 
> Does it mean only VF 0 can be trusted?

Yes, currently we only allow VF0 have DCF capability, but that limitation might be removed at some time.
>
  
Thomas Monjalon Jan. 20, 2021, 10:39 a.m. UTC | #6
20/01/2021 11:36, Zhang, Qi Z:
> From: Thomas Monjalon <thomas@monjalon.net>
> > 20/01/2021 11:23, Zhang, Qi Z:
> > > From: Thomas Monjalon <thomas@monjalon.net>
> > > > What is DCF?
> > > >
> > > >
> > > Its "Device Config Function" (DCF), please check ice.rst for detail.
> > 
> > Thank you.
> > As you know, I am interested in the privileged rights.
> > This is what I found in ice.rst:
> > 
> > 	A DCF PMD bounds to the device's trusted VF with ID 0
> > 	[...]
> > 	#. Enable the VF0 trust on::
> > 	   ip link set dev enp24s0f0 vf 0 trust on
> > 
> > Does it mean only VF 0 can be trusted?
> 
> Yes, currently we only allow VF0 have DCF capability, but that limitation might be removed at some time.

OK thanks for the explanations.
  

Patch

diff --git a/doc/guides/rel_notes/release_21_02.rst b/doc/guides/rel_notes/release_21_02.rst
index 78ec2758e2..6b7870779f 100644
--- a/doc/guides/rel_notes/release_21_02.rst
+++ b/doc/guides/rel_notes/release_21_02.rst
@@ -106,6 +106,18 @@  New Features
 
   * Added Double VLAN support for DCF switch QinQ filtering.
 
+* **Updated the Intel ice driver.**
+
+  Updated the Intel ice driver with new features and improvements, including:
+
+  * Added support for UDP dynamic port assignment for eCPRI protocol feature.
+
+* **Updated Intel iavf driver.**
+
+  Updated iavf PMD with new features and improvements, including:
+
+  * Added support for FDIR/RSS packet steering for flow type eCPRI protocol features.
+
 
 Removed Items
 -------------
diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
index d46734a57b..04e42d322a 100644
--- a/drivers/net/ice/ice_dcf_ethdev.c
+++ b/drivers/net/ice/ice_dcf_ethdev.c
@@ -26,6 +26,13 @@ 
 #include "ice_dcf_ethdev.h"
 #include "ice_rxtx.h"
 
+static int
+ice_dcf_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
+				struct rte_eth_udp_tunnel *udp_tunnel);
+static int
+ice_dcf_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
+				struct rte_eth_udp_tunnel *udp_tunnel);
+
 static uint16_t
 ice_dcf_recv_pkts(__rte_unused void *rx_queue,
 		  __rte_unused struct rte_mbuf **bufs,
@@ -870,6 +877,64 @@  ice_dcf_link_update(__rte_unused struct rte_eth_dev *dev,
 	return 0;
 }
 
+/* Add UDP tunneling port */
+static int
+ice_dcf_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
+				struct rte_eth_udp_tunnel *udp_tunnel)
+{
+	struct ice_dcf_adapter *adapter = dev->data->dev_private;
+	struct ice_adapter *parent_adapter = &adapter->parent;
+	struct ice_hw *parent_hw = &parent_adapter->hw;
+	int ret = 0;
+
+	if (!udp_tunnel)
+		return -EINVAL;
+
+	switch (udp_tunnel->prot_type) {
+	case RTE_TUNNEL_TYPE_VXLAN:
+		ret = ice_create_tunnel(parent_hw, TNL_VXLAN,
+					udp_tunnel->udp_port);
+		break;
+	case RTE_TUNNEL_TYPE_ECPRI:
+		ret = ice_create_tunnel(parent_hw, TNL_ECPRI,
+					udp_tunnel->udp_port);
+		break;
+	default:
+		PMD_DRV_LOG(ERR, "Invalid tunnel type");
+		ret = -EINVAL;
+		break;
+	}
+
+	return ret;
+}
+
+/* Delete UDP tunneling port */
+static int
+ice_dcf_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
+				struct rte_eth_udp_tunnel *udp_tunnel)
+{
+	struct ice_dcf_adapter *adapter = dev->data->dev_private;
+	struct ice_adapter *parent_adapter = &adapter->parent;
+	struct ice_hw *parent_hw = &parent_adapter->hw;
+	int ret = 0;
+
+	if (!udp_tunnel)
+		return -EINVAL;
+
+	switch (udp_tunnel->prot_type) {
+	case RTE_TUNNEL_TYPE_VXLAN:
+	case RTE_TUNNEL_TYPE_ECPRI:
+		ret = ice_destroy_tunnel(parent_hw, udp_tunnel->udp_port, 0);
+		break;
+	default:
+		PMD_DRV_LOG(ERR, "Invalid tunnel type");
+		ret = -EINVAL;
+		break;
+	}
+
+	return ret;
+}
+
 static const struct eth_dev_ops ice_dcf_eth_dev_ops = {
 	.dev_start               = ice_dcf_dev_start,
 	.dev_stop                = ice_dcf_dev_stop,
@@ -892,6 +957,8 @@  static const struct eth_dev_ops ice_dcf_eth_dev_ops = {
 	.allmulticast_enable     = ice_dcf_dev_allmulticast_enable,
 	.allmulticast_disable    = ice_dcf_dev_allmulticast_disable,
 	.filter_ctrl             = ice_dcf_dev_filter_ctrl,
+	.udp_tunnel_port_add	 = ice_dcf_dev_udp_tunnel_port_add,
+	.udp_tunnel_port_del	 = ice_dcf_dev_udp_tunnel_port_del,
 };
 
 static int