From patchwork Wed Dec 23 08:49:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jijiang Liu X-Patchwork-Id: 9643 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4BEAF8E5A; Wed, 23 Dec 2015 09:50:16 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 668275A9D for ; Wed, 23 Dec 2015 09:50:10 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP; 23 Dec 2015 00:50:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,468,1444719600"; d="scan'208";a="877328107" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 23 Dec 2015 00:50:03 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id tBN8o1tg022341; Wed, 23 Dec 2015 16:50:01 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id tBN8nxqE012722; Wed, 23 Dec 2015 16:50:01 +0800 Received: (from jijiangl@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id tBN8nwe6012718; Wed, 23 Dec 2015 16:49:58 +0800 From: Jijiang Liu To: dev@dpdk.org Date: Wed, 23 Dec 2015 16:49:48 +0800 Message-Id: <1450860592-12673-3-git-send-email-jijiang.liu@intel.com> X-Mailer: git-send-email 1.7.12.2 In-Reply-To: <1450860592-12673-1-git-send-email-jijiang.liu@intel.com> References: <1450860592-12673-1-git-send-email-jijiang.liu@intel.com> Subject: [dpdk-dev] [RFC PATCH 2/6] rte_ether: define tunnel flow structure and APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add the struct 'rte_eth_tunnel_conf' and the tunnel configuration API. Signed-off-by: Jijiang Liu --- lib/librte_ether/rte_ethdev.h | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index bada8ad..cb4d9a2 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -630,6 +630,18 @@ struct rte_eth_rxconf { uint8_t rx_deferred_start; /**< Do not start queue with rte_eth_dev_start(). */ }; +/** + * A structure used to configure tunnel flow of an Ethernet port. + */ +struct rte_eth_tunnel_conf { + uint16_t rx_queue; + uint16_t tx_queue; + uint16_t udp_tunnel_port; + uint16_t nb_flow; + uint16_t filter_type; + struct rte_eth_tunnel_flow *tunnel_flow; +}; + #define ETH_TXQ_FLAGS_NOMULTSEGS 0x0001 /**< nb_segs=1 for all mbufs */ #define ETH_TXQ_FLAGS_NOREFCOUNT 0x0002 /**< refcnt can be ignored */ #define ETH_TXQ_FLAGS_NOMULTMEMP 0x0004 /**< all bufs come from same mempool */ @@ -810,6 +822,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008 #define DEV_RX_OFFLOAD_TCP_LRO 0x00000010 #define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020 +#define DEV_RX_OFFLOAD_TUNNEL_DECAP 0x00000040 /** * TX offload capabilities of a device. @@ -1210,6 +1223,10 @@ typedef int (*eth_udp_tunnel_add_t)(struct rte_eth_dev *dev, typedef int (*eth_udp_tunnel_del_t)(struct rte_eth_dev *dev, struct rte_eth_udp_tunnel *tunnel_udp); + +typedef int (*eth_tunnel_flow_conf_t)(struct rte_eth_dev *dev, + struct rte_eth_tunnel_conf *tunnel_conf); + /**< @internal Delete tunneling UDP info */ typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev, @@ -1385,6 +1402,7 @@ struct eth_dev_ops { eth_set_vf_vlan_filter_t set_vf_vlan_filter; /**< Set VF VLAN filter */ eth_udp_tunnel_add_t udp_tunnel_add; eth_udp_tunnel_del_t udp_tunnel_del; + eth_tunnel_flow_conf_t tunnel_configure; 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. */ @@ -1821,6 +1839,16 @@ extern int rte_eth_dev_configure(uint8_t port_id, const struct rte_eth_conf *eth_conf); /** + * Configure an Ethernet device for tunnelling packet. + * + * @return + * - 0: Success, device configured. + * - <0: Error code returned by the driver configuration function. + */ +extern int rte_eth_dev_tunnel_configure(uint8_t port_id, + struct rte_eth_tunnel_conf *tunnel_conf); + +/** * Allocate and set up a receive queue for an Ethernet device. * * The function allocates a contiguous block of memory for *nb_rx_desc*