From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v3 0/2] slow data path communication between DPDK port and Linux
Date: Wed, 9 Mar 2016 11:17:47 +0000 [thread overview]
Message-ID: <1457522269-2198-1-git-send-email-ferruh.yigit@intel.com> (raw)
In-Reply-To: <1455858349-14639-1-git-send-email-ferruh.yigit@intel.com>
This patch sent to keep record of latest status of the work.
This is slow data path communication implementation based on existing KNI.
Difference is: librte_kni converted into a PMD, kdp kernel module is almost
same except all control path functionality removed and some simplification done.
Motivation is to simplify slow path data communication.
Now any application can use this new PMD to send/get data to Linux kernel.
PMD supports two communication methods:
1) KDP kernel module
PMD initialization functions handles creating virtual interfaces (with help of
kdp kernel module) and created FIFO. FIFO is used to share data between
userspace and kernelspace. This is default method.
2) tun/tap module
When KDP module is not inserted, PMD creates tap interface and transfers
packets using tap interface.
In long term this patch intends to replace the KNI and KNI will be
depreciated.
v3:
* Remove logging helper macros, use pr_fmt
* Replace rw_semaphore with mutex
* Devices are not up by default
* Use unsigned primitive types as possible
* Update module parameters
* Code cleanup, remove useless comments, reorder fields/code.
v2:
* Use rtnetlink to create interfaces
* Include modules.h to prevent compile error in old kernels
Sample usage:
1) Transfer any packet received from NIC that bound to DPDK, to the Linux kernel
a) insert kdp kernel module
insmod build/kmod/rte_kdp.ko
b) bind NIC to the DPDK using dpdk_nic_bind.py
c) ./testpmd --vdev eth_kdp0
c1) testpmd show two ports, one of them physical, other virtual
...
Configuring Port 0 (socket 0)
Port 0: 00:00:00:00:00:00
Configuring Port 1 (socket 0)
...
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Port 1 Link Up - speed 10000 Mbps - full-duplex
Done
c2) This will create "kdp0" Linux interface
$ ip l show kdp0
21: kdp0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
d) Linux port can be used for data
d1)
$ ifconfig kdp0 1.0.0.2
$ ping 1.0.0.1
PING 1.0.0.1 (1.0.0.1) 56(84) bytes of data.
64 bytes from 1.0.0.1: icmp_seq=1 ttl=64 time=0.789 ms
64 bytes from 1.0.0.1: icmp_seq=2 ttl=64 time=0.881 ms
d2)
$ tcpdump -nn -i kdp0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on kdp0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:01:22.407506 IP 1.0.0.1 > 1.0.0.2: ICMP echo request, id 40016, seq 18, length 64
15:01:22.408521 IP 1.0.0.2 > 1.0.0.1: ICMP echo reply, id 40016, seq 18, length 64
2) Data travels between virtual Linux interfaces pass from DPDK application,
application can alter data
a) insert kdp kernel module
insmod build/kmod/rte_kdp.ko
b) No physical NIC involved
c) ./testpmd --vdev eth_kdp0 --vdev eth_kdp1
c1) testpmd show two ports, both of them are virtual
...
Configuring Port 0 (socket 0)
Port 0: 00:00:00:00:00:00
Configuring Port 1 (socket 0)
Port 1: 00:00:00:00:00:00
Checking link statuses...
Port 0 Link Up - speed 10000 Mbps - full-duplex
Port 1 Link Up - speed 10000 Mbps - full-duplex
Done
c2) This will create "kdp0" and "kdp1" Linux interfaces
$ ip l show kdp0; ip l show kdp1
22: kdp0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
23: kdp1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
d) Data travel between virtual ports pass from DPDK application
$ifconfig kdp0 1.0.0.1
$ifconfig kdp1 1.0.0.2
d1)
$ ping 1.0.0.1
PING 1.0.0.1 (1.0.0.1) 56(84) bytes of data.
64 bytes from 1.0.0.1: icmp_seq=1 ttl=64 time=3.57 ms
64 bytes from 1.0.0.1: icmp_seq=2 ttl=64 time=1.85 ms
64 bytes from 1.0.0.1: icmp_seq=3 ttl=64 time=1.89 ms
d2)
$ tcpdump -nn -i kdp0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on kdp0, link-type EN10MB (Ethernet), capture size 262144 bytes
15:20:51.908543 IP 1.0.0.2 > 1.0.0.1: ICMP echo request, id 41234, seq 1, length 64
15:20:51.909570 IP 1.0.0.1 > 1.0.0.2: ICMP echo reply, id 41234, seq 1, length 64
15:20:52.909551 IP 1.0.0.2 > 1.0.0.1: ICMP echo request, id 41234, seq 2, length 64
15:20:52.910577 IP 1.0.0.1 > 1.0.0.2: ICMP echo reply, id 41234, seq 2, length 64
3) tun/tap interface usage
a) No external module required, tun/tap support in kernel required
b) ./testpmd --vdev eth_kdp0 --vdev eth_kdp1
b1) This will create "tap_kdp0" and "tap_kdp1" Linux interfaces
$ ip l show tap_kdp0; ip l show tap_kdp1
25: tap_kdp0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
link/ether 56:47:97:9c:03:8e brd ff:ff:ff:ff:ff:ff
26: tap_kdp1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 500
link/ether 5e:15:22:b0:52:42 brd ff:ff:ff:ff:ff:ff
Ferruh Yigit (2):
kdp: add kernel data path kernel module
kdp: add virtual PMD for kernel slow data path communication
MAINTAINERS | 5 +
config/common_base | 7 +
config/common_linuxapp | 2 +
doc/guides/nics/pcap_ring.rst | 125 +++-
doc/guides/rel_notes/release_16_04.rst | 5 +
drivers/net/Makefile | 3 +-
drivers/net/kdp/Makefile | 61 ++
drivers/net/kdp/rte_eth_kdp.c | 501 ++++++++++++++
drivers/net/kdp/rte_kdp.c | 633 ++++++++++++++++++
drivers/net/kdp/rte_kdp.h | 116 ++++
drivers/net/kdp/rte_kdp_fifo.h | 91 +++
drivers/net/kdp/rte_kdp_tap.c | 101 +++
drivers/net/kdp/rte_pmd_kdp_version.map | 4 +
lib/librte_eal/common/include/rte_log.h | 3 +-
lib/librte_eal/linuxapp/Makefile | 3 +-
lib/librte_eal/linuxapp/eal/Makefile | 3 +-
.../linuxapp/eal/include/exec-env/rte_kdp_common.h | 134 ++++
lib/librte_eal/linuxapp/kdp/Makefile | 55 ++
lib/librte_eal/linuxapp/kdp/kdp_dev.h | 76 +++
lib/librte_eal/linuxapp/kdp/kdp_fifo.h | 91 +++
lib/librte_eal/linuxapp/kdp/kdp_net.c | 718 +++++++++++++++++++++
mk/rte.app.mk | 3 +-
22 files changed, 2732 insertions(+), 8 deletions(-)
create mode 100644 drivers/net/kdp/Makefile
create mode 100644 drivers/net/kdp/rte_eth_kdp.c
create mode 100644 drivers/net/kdp/rte_kdp.c
create mode 100644 drivers/net/kdp/rte_kdp.h
create mode 100644 drivers/net/kdp/rte_kdp_fifo.h
create mode 100644 drivers/net/kdp/rte_kdp_tap.c
create mode 100644 drivers/net/kdp/rte_pmd_kdp_version.map
create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/rte_kdp_common.h
create mode 100644 lib/librte_eal/linuxapp/kdp/Makefile
create mode 100644 lib/librte_eal/linuxapp/kdp/kdp_dev.h
create mode 100644 lib/librte_eal/linuxapp/kdp/kdp_fifo.h
create mode 100644 lib/librte_eal/linuxapp/kdp/kdp_net.c
--
2.5.0
next prev parent reply other threads:[~2016-03-09 11:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 16:32 [dpdk-dev] [PATCH " Ferruh Yigit
2016-01-27 16:32 ` [dpdk-dev] [PATCH 1/2] kdp: add kernel data path kernel module Ferruh Yigit
2016-02-08 17:14 ` Reshma Pattan
2016-02-09 10:53 ` Ferruh Yigit
2016-01-27 16:32 ` [dpdk-dev] [PATCH 2/2] kdp: add virtual PMD for kernel slow data path communication Ferruh Yigit
2016-01-28 8:16 ` Xu, Qian Q
2016-01-29 16:04 ` Yigit, Ferruh
2016-02-09 17:33 ` Reshma Pattan
2016-02-09 17:51 ` Ferruh Yigit
2016-02-19 5:05 ` [dpdk-dev] [PATCH v2 0/2] slow data path communication between DPDK port and Linux Ferruh Yigit
2016-02-19 5:05 ` [dpdk-dev] [PATCH v2 1/2] kdp: add kernel data path kernel module Ferruh Yigit
2016-02-19 5:05 ` [dpdk-dev] [PATCH v2 2/2] kdp: add virtual PMD for kernel slow data path communication Ferruh Yigit
2016-03-09 11:17 ` Ferruh Yigit [this message]
2016-03-09 11:17 ` [dpdk-dev] [PATCH v3 1/2] kdp: add kernel data path kernel module Ferruh Yigit
2016-03-09 11:17 ` [dpdk-dev] [PATCH v3 2/2] kdp: add virtual PMD for kernel slow data path communication Ferruh Yigit
2016-03-14 15:32 ` [dpdk-dev] [PATCH v3 0/2] slow data path communication between DPDK port and Linux Ferruh Yigit
2016-03-16 7:26 ` Panu Matilainen
2016-03-16 8:19 ` Ferruh Yigit
2016-03-16 8:22 ` Panu Matilainen
2016-03-16 10:26 ` Ferruh Yigit
2016-03-16 10:45 ` Thomas Monjalon
2016-03-16 11:07 ` Mcnamara, John
2016-03-16 11:13 ` Ferruh Yigit
2016-03-16 13:23 ` Panu Matilainen
2016-03-16 13:15 ` Panu Matilainen
2016-03-16 13:58 ` Thomas Monjalon
2016-03-16 15:03 ` Panu Matilainen
2016-03-16 15:15 ` Thomas Monjalon
2016-03-16 11:07 ` Bruce Richardson
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=1457522269-2198-1-git-send-email-ferruh.yigit@intel.com \
--to=ferruh.yigit@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).