DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jijiang Liu <jijiang.liu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC PATCH 2/6] rte_ether: define tunnel flow structure and APIs
Date: Wed, 23 Dec 2015 16:49:48 +0800	[thread overview]
Message-ID: <1450860592-12673-3-git-send-email-jijiang.liu@intel.com> (raw)
In-Reply-To: <1450860592-12673-1-git-send-email-jijiang.liu@intel.com>

Add the struct 'rte_eth_tunnel_conf' and the tunnel configuration API. 

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
---
 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*
-- 
1.7.7.6

  parent reply	other threads:[~2015-12-23  8:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-23  8:49 [dpdk-dev] [RFC PATCH 0/6] General tunneling APIs Jijiang Liu
2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 1/6] rte_ether: extend rte_eth_tunnel_flow structure Jijiang Liu
2015-12-23  8:49 ` Jijiang Liu [this message]
2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 3/6] rte_ether: implement tunnel config API Jijiang Liu
2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 4/6] rte_ether: define rte_eth_vxlan_decap and rte_eth_vxlan_encap Jijiang Liu
2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 5/6] rte_ether: implement encap and decap APIs Jijiang Liu
2015-12-23 18:32   ` Stephen Hemminger
2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 6/6] driver/i40e: tunnel configure in i40e Jijiang Liu
2015-12-23 11:17 ` [dpdk-dev] [RFC PATCH 0/6] General tunneling APIs Walukiewicz, Miroslaw
2015-12-28  5:54   ` Liu, Jijiang
2016-01-04 10:48     ` Walukiewicz, Miroslaw
2015-12-23 18:31 ` Stephen Hemminger
2015-12-28  1:46   ` Liu, Jijiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450860592-12673-3-git-send-email-jijiang.liu@intel.com \
    --to=jijiang.liu@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).