From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 29048A0A03; Tue, 19 Jan 2021 05:26:35 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE634140E5A; Tue, 19 Jan 2021 05:26:34 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 276A7140E48 for ; Tue, 19 Jan 2021 05:26:31 +0100 (CET) IronPort-SDR: Pg6x99InZO3xMsW2Fzw4bMJ/EfvbxyjmtukZZ2PPLfaVaX4cL9X7dl2WG7nxzMjWxOx3rN1WFG g2llwVTNKdzw== X-IronPort-AV: E=McAfee;i="6000,8403,9868"; a="240415958" X-IronPort-AV: E=Sophos;i="5.79,357,1602572400"; d="scan'208";a="240415958" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2021 20:26:26 -0800 IronPort-SDR: sWckHpvkV8FVNwlfJXQ7Bm0+vm0+io6uUrthQFuUymKNTzLLcUCXbOUWkN+qs1ME1m7fCbVAvh owrz7sn0vU7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,357,1602572400"; d="scan'208";a="573445320" Received: from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128]) by fmsmga005.fm.intel.com with ESMTP; 18 Jan 2021 20:26:19 -0800 From: Jeff Guo To: qi.z.zhang@intel.com, thomas@monjalon.net, ferruh.yigit@intel.com, andrew.rybchenko@oktetlabs.ru, bernard.iremonger@intel.com, wenzhuo.lu@intel.com, beilei.xing@intel.com Cc: jingjing.wu@intel.com, qiming.yang@intel.com, haiyue.wang@intel.com, dev@dpdk.org, jia.guo@intel.com, simei.su@intel.com, orika@nvidia.com, getelson@nvidia.com, maxime.coquelin@redhat.com, jerinj@marvell.com, ajit.khaparde@broadcom.com, bingz@nvidia.com, ray.kinsella@intel.com, dodji@redhat.com, david.marchand@redhat.com Date: Tue, 19 Jan 2021 12:19:02 +0800 Message-Id: <20210119041902.81524-1-jia.guo@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201216085854.7842-1-jia.guo@intel.com> References: <20201216085854.7842-1-jia.guo@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [dpdk-dev v5] net/ice: enable eCPRI tunnel port configure in dcf X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add eCPRI tunnel port add and rm ops to configure eCPRI UDP tunnel port in dcf. Signed-off-by: Jeff Guo --- 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. + +* **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 -- 2.20.1