[dpdk-dev] [RFC PATCH 2/6] rte_ether: define tunnel flow structure and APIs
Jijiang Liu
jijiang.liu at intel.com
Wed Dec 23 09:49:48 CET 2015
Add the struct 'rte_eth_tunnel_conf' and the tunnel configuration API.
Signed-off-by: Jijiang Liu <jijiang.liu at 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
More information about the dev
mailing list