DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [RFC PATCH 0/6] General tunneling APIs
@ 2015-12-23  8:49 Jijiang Liu
  2015-12-23  8:49 ` [dpdk-dev] [RFC PATCH 1/6] rte_ether: extend rte_eth_tunnel_flow structure Jijiang Liu
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Jijiang Liu @ 2015-12-23  8:49 UTC (permalink / raw)
  To: dev

I want to define a set of General tunneling APIs, which are used to accelarate tunneling packet processing in DPDK,
In this RFC patch set, I wll explain my idea using some codes.

1. Using flow director offload to define a tunnel flow in a pair of queues.
   
flow rule: src IP + dst IP + src port + dst port + tunnel ID (for VXLAN)

For example:
	struct rte_eth_tunnel_conf{
	.tunnel_type = VXLAN,
	.rx_queue = 1,
	.tx_queue = 1,
	.filter_type = 'src ip + dst ip + src port + dst port + tunnel id' 
	.flow_tnl {
         	.tunnel_type = VXLAN,
         	.tunnel_id = 100,
         	.remote_mac = 11.22.33.44.55.66,
         .ip_type = ipv4, 
         .outer_ipv4.src_ip = 192.168.10.1
         .outer_ipv4.dst_ip = 10.239.129.11
         .src_port = 1000,
         .dst_port =2000
};
       
2. Configure tunnel flow for a device and for a pair of queues.

rte_eth_dev_tunnel_configure(0, &rte_eth_tunnel_conf);

In this API, it will call RX decapsulation and TX encapsulation callback function if HW doesn't support encap/decap, and
a space will be allocated for tunnel configuration and store a pointer to this new allocated space as dev->post_rx/tx_burst_cbs[].param.

rte_eth_add_rx_callback(port_id, tunnel_conf.rx_queue,
                        rte_eth_tunnel_decap, (void *)tunnel_conf);
rte_eth_add_tx_callback(port_id, tunnel_conf.tx_queue,
                        rte_eth_tunnel_encap, (void *)tunnel_conf)

3. Using rte_vxlan_decap_burst() to do decapsulation of tunneling packet.

4. Using rte_vxlan_encap_burst() to do encapsulation of tunneling packet.
   The 'src ip, dst ip, src port, dst port and  tunnel ID" can be got from tunnel configuration.
   And SIMD is used to accelarate the operation. 

How to use these APIs, there is a example below:

1)at config phase

dev_config(port, ...);
tunnel_config(port,...);
...
dev_start(port);
...
rx_burst(port, rxq,... );
tx_burst(port, txq,...);


2)at transmitting packet phase
The only outer src/dst MAC address need to be set for TX tunnel configuration in dev->post_tx_burst_cbs[].param.

In this patch set, I have not finished all of codes, the purpose of sending patch set is that I would like to collect more comments and sugestions on this idea.


Jijiang Liu (6):
  extend rte_eth_tunnel_flow
  define tunnel flow structure and APIs
  implement tunnel flow APIs
  define rte_vxlan_decap/encap
  implement rte_vxlan_decap/encap
  i40e tunnel configure

 drivers/net/i40e/i40e_ethdev.c             |   41 +++++
 lib/librte_ether/libtunnel/rte_vxlan_opt.c |  251 ++++++++++++++++++++++++++++
 lib/librte_ether/libtunnel/rte_vxlan_opt.h |   49 ++++++
 lib/librte_ether/rte_eth_ctrl.h            |   14 ++-
 lib/librte_ether/rte_ethdev.h              |   28 +++
 lib/librte_ether/rte_ethdev.c              |   60 ++
 5 files changed, 440 insertions(+), 3 deletions(-)
 create mode 100644 lib/librte_ether/libtunnel/rte_vxlan_opt.c
 create mode 100644 lib/librte_ether/libtunnel/rte_vxlan_opt.h

-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-01-04 10:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [dpdk-dev] [RFC PATCH 2/6] rte_ether: define tunnel flow structure and APIs Jijiang Liu
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

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).