diff options
| author | Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | 2014-09-29 18:39:33 +0800 |
|---|---|---|
| committer | Tom Zanussi <tom.zanussi@linux.intel.com> | 2014-10-01 22:55:45 -0500 |
| commit | a14718dfaee57827a0666b858cf192dc1cb00db5 (patch) | |
| tree | 606bf658f63a18e23dcb27f55adaa94162b93f38 /common | |
| parent | 1c825a06095178c0c51f28d5867549feac8a47f4 (diff) | |
| download | meta-intel-a14718dfaee57827a0666b858cf192dc1cb00db5.tar.gz | |
meta-intel/common: Upgrade DPDK to v1.7.0
Added support for DPDK v1.7.0.
Added PACKAGECONFIG mechanism to explicitly disable the use of fuse
and qat which are dependencies for example apps dpdk_qat and vhost.
Added config variables CONFIG_EXAMPLE_DPDK_QAT and
CONFIG_EXAMPLE_DPDK_VHOST to enable or disable the compilation of
example apps dpdk_qat and vhost.
Resolved the installation failure found in example app ip_pipeline by
cherry-picking the patch from dpdk.org.
Resolved the test failure found in example app ring_pmd_autotest by
cherry-picking the patches from dpdk.org.
Signed-off-by: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com>
Acked-by: Ong Boon Leong <boon.leong.ong@intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Diffstat (limited to 'common')
5 files changed, 541 insertions, 0 deletions
diff --git a/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-Add-config-variables-to-enable-disable-dpdk.patch b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-Add-config-variables-to-enable-disable-dpdk.patch new file mode 100644 index 00000000..d0721ca0 --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-Add-config-variables-to-enable-disable-dpdk.patch | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | From 63f8ccc5a305b193e219d288ef9e43b9a9fa6aa8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | ||
| 3 | Date: Wed, 17 Sep 2014 19:10:01 +0800 | ||
| 4 | Subject: [PATCH] examples: Add config variables to enable/disable dpdk_qat and | ||
| 5 | vhost | ||
| 6 | |||
| 7 | Upstream-Status: Inappropriate [configuration] | ||
| 8 | |||
| 9 | This can be used to export CONFIG_EXAMPLE_DPDK_QAT=n if dpdk_qat is not | ||
| 10 | in PACKAGECONFIG and also allow to export CONFIG_EXAMPLE_DPDK_VHOST=n | ||
| 11 | if vhost is not in PACKAGECONFIG. | ||
| 12 | |||
| 13 | Signed-off-by: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | ||
| 14 | --- | ||
| 15 | examples/Makefile | 4 ++-- | ||
| 16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/examples/Makefile b/examples/Makefile | ||
| 19 | index d0624f6..885c938 100644 | ||
| 20 | --- a/examples/Makefile | ||
| 21 | +++ b/examples/Makefile | ||
| 22 | @@ -39,7 +39,7 @@ include $(RTE_SDK)/mk/rte.vars.mk | ||
| 23 | |||
| 24 | DIRS-y += cmdline | ||
| 25 | ifneq ($(ICP_ROOT),) | ||
| 26 | -DIRS-y += dpdk_qat | ||
| 27 | +DIRS-$(CONFIG_EXAMPLE_DPDK_QAT) += dpdk_qat | ||
| 28 | endif | ||
| 29 | DIRS-y += exception_path | ||
| 30 | DIRS-y += helloworld | ||
| 31 | @@ -61,7 +61,7 @@ DIRS-$(CONFIG_RTE_LIBRTE_METER) += qos_meter | ||
| 32 | DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += qos_sched | ||
| 33 | DIRS-y += quota_watermark | ||
| 34 | DIRS-y += timer | ||
| 35 | -DIRS-y += vhost | ||
| 36 | +DIRS-$(CONFIG_EXAMPLE_DPDK_VHOST) += vhost | ||
| 37 | DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen | ||
| 38 | DIRS-y += vmdq | ||
| 39 | DIRS-y += vmdq_dcb | ||
| 40 | -- | ||
| 41 | 1.9.1 | ||
| 42 | |||
diff --git a/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-pipeline-build-with-all-examples.patch b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-pipeline-build-with-all-examples.patch new file mode 100644 index 00000000..25f029fe --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-examples-pipeline-build-with-all-examples.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 15aef6e666ee2eb0befa153d277d47754f3656e4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 3 | Date: Thu, 17 Jul 2014 10:30:52 +0200 | ||
| 4 | Subject: [PATCH] examples/pipeline: build with all examples | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | When adding this packet framework sample (commit 77a3346), | ||
| 10 | it has been forgotten to add it into the global makefile for | ||
| 11 | "make examples". | ||
| 12 | |||
| 13 | Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com> | ||
| 14 | (cherry picked from commit a6664a09a7caa5e63f9ae625cf1946b0eef7794e) | ||
| 15 | Signed-off-by: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | ||
| 16 | --- | ||
| 17 | examples/Makefile | 1 + | ||
| 18 | 1 file changed, 1 insertion(+) | ||
| 19 | |||
| 20 | diff --git a/examples/Makefile b/examples/Makefile | ||
| 21 | index 885c938..1788d6e 100644 | ||
| 22 | --- a/examples/Makefile | ||
| 23 | +++ b/examples/Makefile | ||
| 24 | @@ -43,6 +43,7 @@ DIRS-$(CONFIG_EXAMPLE_DPDK_QAT) += dpdk_qat | ||
| 25 | endif | ||
| 26 | DIRS-y += exception_path | ||
| 27 | DIRS-y += helloworld | ||
| 28 | +DIRS-y += ip_pipeline | ||
| 29 | DIRS-y += ip_reassembly | ||
| 30 | DIRS-$(CONFIG_RTE_MBUF_SCATTER_GATHER) += ip_fragmentation | ||
| 31 | DIRS-$(CONFIG_RTE_MBUF_SCATTER_GATHER) += ipv4_multicast | ||
| 32 | -- | ||
| 33 | 1.9.1 | ||
| 34 | |||
diff --git a/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-remove-extra-devices-creation-with-vdev-option.patch b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-remove-extra-devices-creation-with-vdev-option.patch new file mode 100644 index 00000000..25a4ea80 --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-remove-extra-devices-creation-with-vdev-option.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | From 70d3d9a6757e0c56ad3c6da0292479433e16aed3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 3 | Date: Wed, 9 Jul 2014 15:35:35 +0100 | ||
| 4 | Subject: [PATCH] ring: remove extra devices creation with --vdev option | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | When passing extra arguments in EAL option --vdev, to create | ||
| 10 | ring ethdevs, API was creating three ethdevs, even if there | ||
| 11 | was just one argument, such as CREATE. | ||
| 12 | |||
| 13 | Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 14 | Acked-by: Neil Horman <nhorman@tuxdriver.com> | ||
| 15 | (cherry picked from commit 546afbc6827f9f0f7ed501d2af1fc51755e40224) | ||
| 16 | Signed-off-by: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | ||
| 17 | --- | ||
| 18 | lib/librte_pmd_ring/rte_eth_ring.c | 3 +-- | ||
| 19 | 1 file changed, 1 insertion(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/lib/librte_pmd_ring/rte_eth_ring.c b/lib/librte_pmd_ring/rte_eth_ring.c | ||
| 22 | index 73c649e..4f1b6ed 100644 | ||
| 23 | --- a/lib/librte_pmd_ring/rte_eth_ring.c | ||
| 24 | +++ b/lib/librte_pmd_ring/rte_eth_ring.c | ||
| 25 | @@ -493,7 +493,6 @@ rte_pmd_ring_devinit(const char *name, const char *params) | ||
| 26 | eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE); | ||
| 27 | return 0; | ||
| 28 | } else { | ||
| 29 | - eth_dev_ring_create(name, rte_socket_id(), DEV_CREATE); | ||
| 30 | ret = rte_kvargs_count(kvlist, ETH_RING_NUMA_NODE_ACTION_ARG); | ||
| 31 | info = rte_zmalloc("struct node_action_list", sizeof(struct node_action_list) + | ||
| 32 | (sizeof(struct node_action_pair) * ret), 0); | ||
| 33 | @@ -510,7 +509,7 @@ rte_pmd_ring_devinit(const char *name, const char *params) | ||
| 34 | goto out_free; | ||
| 35 | |||
| 36 | for (info->count = 0; info->count < info->total; info->count++) { | ||
| 37 | - eth_dev_ring_pair_create(name, info->list[info->count].node, | ||
| 38 | + eth_dev_ring_create(name, info->list[info->count].node, | ||
| 39 | info->list[info->count].action); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | -- | ||
| 43 | 1.9.1 | ||
| 44 | |||
diff --git a/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-simplify-unit-tests.patch b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-simplify-unit-tests.patch new file mode 100644 index 00000000..c17137b2 --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk/dpdk-1.7.0-ring-simplify-unit-tests.patch | |||
| @@ -0,0 +1,380 @@ | |||
| 1 | From 545a5fac5d6bd0b64693dfcb15b321280418ac13 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 3 | Date: Wed, 9 Jul 2014 15:35:36 +0100 | ||
| 4 | Subject: [PATCH] ring: simplify unit tests | ||
| 5 | |||
| 6 | Upstream-Status: Backport | ||
| 7 | Imported patch from: http://dpdk.org/browse/dpdk/log/ | ||
| 8 | |||
| 9 | As this unit test does not create devices anymore, | ||
| 10 | and uses devices created by EAL option --vdev, | ||
| 11 | there were unnecesary tests that were repeated, | ||
| 12 | so they have been removed. | ||
| 13 | |||
| 14 | So now there are three tests: | ||
| 15 | |||
| 16 | 1 - Test two devices that share a ring, one device | ||
| 17 | with just one RX queue and the other with one | ||
| 18 | TX queue. | ||
| 19 | |||
| 20 | 2 - Test a device connected to itself (loopback) by | ||
| 21 | a ring, with both RX and TX queue. | ||
| 22 | |||
| 23 | 3 - Test two devices that share a ring, but both devices | ||
| 24 | with RX and TX queue, so they can send packets to themselves | ||
| 25 | and to the other device. | ||
| 26 | |||
| 27 | Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> | ||
| 28 | Acked-by: Neil Horman <nhorman@tuxdriver.com> | ||
| 29 | (cherry picked from commit 572eb3cd834c5e21d7fa946432b89c1c9d63fe61) | ||
| 30 | Signed-off-by: Sreeju Selvaraj <sreeju.armughanx.selvaraj@intel.com> | ||
| 31 | --- | ||
| 32 | app/test/test_pmd_ring.c | 202 +++++++++++++++++------------------------------ | ||
| 33 | 1 file changed, 72 insertions(+), 130 deletions(-) | ||
| 34 | |||
| 35 | diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c | ||
| 36 | index 0d3d95c..19ad0e9 100644 | ||
| 37 | --- a/app/test/test_pmd_ring.c | ||
| 38 | +++ b/app/test/test_pmd_ring.c | ||
| 39 | @@ -39,18 +39,13 @@ | ||
| 40 | #include <rte_eth_ring.h> | ||
| 41 | #include <rte_ethdev.h> | ||
| 42 | |||
| 43 | -/* two test rings, r1 is used by two ports, r2 just by one */ | ||
| 44 | -static struct rte_ring *r1[2], *r2; | ||
| 45 | - | ||
| 46 | static struct rte_mempool *mp; | ||
| 47 | -static uint8_t start_idx; /* will store the port id of the first of our new ports */ | ||
| 48 | - | ||
| 49 | -#define TX_PORT (uint8_t)(start_idx + 1) | ||
| 50 | -#define RX_PORT (uint8_t)(start_idx + 2) | ||
| 51 | -#define RXTX_PORT (uint8_t)(start_idx + 3) | ||
| 52 | -#define RXTX_PORT2 (uint8_t)(start_idx + 4) | ||
| 53 | -#define RXTX_PORT4 (uint8_t)(start_idx + 6) | ||
| 54 | -#define RXTX_PORT5 (uint8_t)(start_idx + 7) | ||
| 55 | + | ||
| 56 | +#define TX_PORT 0 | ||
| 57 | +#define RX_PORT 1 | ||
| 58 | +#define RXTX_PORT 2 | ||
| 59 | +#define RXTX_PORT2 3 | ||
| 60 | +#define RXTX_PORT3 4 | ||
| 61 | #define SOCKET0 0 | ||
| 62 | |||
| 63 | #define RING_SIZE 256 | ||
| 64 | @@ -86,7 +81,7 @@ test_ethdev_configure(void) | ||
| 65 | return -1; | ||
| 66 | } | ||
| 67 | if (rte_eth_dev_configure(RXTX_PORT, 1, 1, &null_conf) < 0) { | ||
| 68 | - printf("Configure failed for RX port\n"); | ||
| 69 | + printf("Configure failed for RXTX port\n"); | ||
| 70 | return -1; | ||
| 71 | } | ||
| 72 | |||
| 73 | @@ -250,197 +245,162 @@ test_stats_reset(void) | ||
| 74 | } | ||
| 75 | |||
| 76 | static int | ||
| 77 | -test_pmd_ring_init(void) | ||
| 78 | +test_pmd_ring_pair_create_attach(void) | ||
| 79 | { | ||
| 80 | - struct rte_eth_stats stats; | ||
| 81 | + struct rte_eth_stats stats, stats2; | ||
| 82 | struct rte_mbuf buf, *pbuf = &buf; | ||
| 83 | struct rte_eth_conf null_conf; | ||
| 84 | |||
| 85 | - printf("Testing ring pmd init\n"); | ||
| 86 | - | ||
| 87 | - if (RXTX_PORT2 >= RTE_MAX_ETHPORTS) { | ||
| 88 | + if ((RXTX_PORT2 >= RTE_MAX_ETHPORTS) || (RXTX_PORT3 >= RTE_MAX_ETHPORTS)) { | ||
| 89 | printf(" TX/RX port exceed max eth ports\n"); | ||
| 90 | return -1; | ||
| 91 | } | ||
| 92 | - if (rte_eth_dev_configure(RXTX_PORT2, 1, 1, &null_conf) < 0) { | ||
| 93 | + if ((rte_eth_dev_configure(RXTX_PORT2, 1, 1, &null_conf) < 0) | ||
| 94 | + || (rte_eth_dev_configure(RXTX_PORT3, 1, 1, &null_conf) < 0)) { | ||
| 95 | printf("Configure failed for RXTX port\n"); | ||
| 96 | return -1; | ||
| 97 | } | ||
| 98 | |||
| 99 | - if (rte_eth_tx_queue_setup(RXTX_PORT2, 0, RING_SIZE, SOCKET0, NULL) < 0) { | ||
| 100 | + if ((rte_eth_tx_queue_setup(RXTX_PORT2, 0, RING_SIZE, SOCKET0, NULL) < 0) | ||
| 101 | + || (rte_eth_tx_queue_setup(RXTX_PORT3, 0, RING_SIZE, SOCKET0, NULL) < 0)) { | ||
| 102 | printf("TX queue setup failed\n"); | ||
| 103 | return -1; | ||
| 104 | } | ||
| 105 | |||
| 106 | - if (rte_eth_rx_queue_setup(RXTX_PORT2, 0, RING_SIZE, SOCKET0, | ||
| 107 | - NULL, mp) < 0) { | ||
| 108 | + if ((rte_eth_rx_queue_setup(RXTX_PORT2, 0, RING_SIZE, SOCKET0, NULL, mp) < 0) | ||
| 109 | + || (rte_eth_rx_queue_setup(RXTX_PORT3, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)) { | ||
| 110 | printf("RX queue setup failed\n"); | ||
| 111 | return -1; | ||
| 112 | } | ||
| 113 | |||
| 114 | - if (rte_eth_dev_start(RXTX_PORT2) < 0) { | ||
| 115 | - printf("Error starting RX port\n"); | ||
| 116 | + if ((rte_eth_dev_start(RXTX_PORT2) < 0) | ||
| 117 | + || (rte_eth_dev_start(RXTX_PORT3) < 0)) { | ||
| 118 | + printf("Error starting RXTX port\n"); | ||
| 119 | return -1; | ||
| 120 | } | ||
| 121 | |||
| 122 | - /* send and receive 1 packet and check for stats update */ | ||
| 123 | + /* | ||
| 124 | + * send and receive 1 packet (RXTX_PORT2 -> RXTX_PORT3) | ||
| 125 | + * and check for stats update | ||
| 126 | + */ | ||
| 127 | if (rte_eth_tx_burst(RXTX_PORT2, 0, &pbuf, 1) != 1) { | ||
| 128 | printf("Error sending packet to RXTX port\n"); | ||
| 129 | return -1; | ||
| 130 | } | ||
| 131 | |||
| 132 | - if (rte_eth_rx_burst(RXTX_PORT2, 0, &pbuf, 1) != 1) { | ||
| 133 | + if (rte_eth_rx_burst(RXTX_PORT3, 0, &pbuf, 1) != 1) { | ||
| 134 | printf("Error receiving packet from RXTX port\n"); | ||
| 135 | return -1; | ||
| 136 | } | ||
| 137 | |||
| 138 | rte_eth_stats_get(RXTX_PORT2, &stats); | ||
| 139 | - if (stats.ipackets != 1 || stats.opackets != 1 || | ||
| 140 | + rte_eth_stats_get(RXTX_PORT3, &stats2); | ||
| 141 | + if (stats.ipackets != 0 || stats.opackets != 1 || | ||
| 142 | stats.ibytes != 0 || stats.obytes != 0 || | ||
| 143 | stats.ierrors != 0 || stats.oerrors != 0) { | ||
| 144 | printf("Error: RXTX port stats are not as expected\n"); | ||
| 145 | return -1; | ||
| 146 | } | ||
| 147 | |||
| 148 | - rte_eth_dev_stop(RXTX_PORT2); | ||
| 149 | - | ||
| 150 | - return 0; | ||
| 151 | -} | ||
| 152 | - | ||
| 153 | -static int | ||
| 154 | -test_pmd_ring_pair_create(void) | ||
| 155 | -{ | ||
| 156 | - struct rte_eth_stats stats, stats2; | ||
| 157 | - struct rte_mbuf buf, *pbuf = &buf; | ||
| 158 | - struct rte_eth_conf null_conf; | ||
| 159 | - | ||
| 160 | - if ((RXTX_PORT4 >= RTE_MAX_ETHPORTS) || (RXTX_PORT5 >= RTE_MAX_ETHPORTS)) { | ||
| 161 | - printf(" TX/RX port exceed max eth ports\n"); | ||
| 162 | - return -1; | ||
| 163 | - } | ||
| 164 | - if ((rte_eth_dev_configure(RXTX_PORT4, 1, 1, &null_conf) < 0) | ||
| 165 | - || (rte_eth_dev_configure(RXTX_PORT5, 1, 1, &null_conf) < 0)) { | ||
| 166 | - printf("Configure failed for RXTX port\n"); | ||
| 167 | - return -1; | ||
| 168 | - } | ||
| 169 | - | ||
| 170 | - if ((rte_eth_tx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL) < 0) | ||
| 171 | - || (rte_eth_tx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL) < 0)) { | ||
| 172 | - printf("TX queue setup failed\n"); | ||
| 173 | - return -1; | ||
| 174 | - } | ||
| 175 | - | ||
| 176 | - if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0) | ||
| 177 | - || (rte_eth_rx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)) { | ||
| 178 | - printf("RX queue setup failed\n"); | ||
| 179 | - return -1; | ||
| 180 | - } | ||
| 181 | - | ||
| 182 | - if ((rte_eth_dev_start(RXTX_PORT4) < 0) | ||
| 183 | - || (rte_eth_dev_start(RXTX_PORT5) < 0)) { | ||
| 184 | - printf("Error starting RXTX port\n"); | ||
| 185 | + if (stats2.ipackets != 1 || stats2.opackets != 0 || | ||
| 186 | + stats2.ibytes != 0 || stats2.obytes != 0 || | ||
| 187 | + stats2.ierrors != 0 || stats2.oerrors != 0) { | ||
| 188 | + printf("Error: RXTX port stats are not as expected\n"); | ||
| 189 | return -1; | ||
| 190 | } | ||
| 191 | |||
| 192 | - /* send and receive 1 packet and check for stats update */ | ||
| 193 | - if (rte_eth_tx_burst(RXTX_PORT4, 0, &pbuf, 1) != 1) { | ||
| 194 | + /* | ||
| 195 | + * send and receive 1 packet (RXTX_PORT3 -> RXTX_PORT2) | ||
| 196 | + * and check for stats update | ||
| 197 | + */ | ||
| 198 | + if (rte_eth_tx_burst(RXTX_PORT3, 0, &pbuf, 1) != 1) { | ||
| 199 | printf("Error sending packet to RXTX port\n"); | ||
| 200 | return -1; | ||
| 201 | } | ||
| 202 | |||
| 203 | - if (rte_eth_rx_burst(RXTX_PORT5, 0, &pbuf, 1) != 1) { | ||
| 204 | + if (rte_eth_rx_burst(RXTX_PORT2, 0, &pbuf, 1) != 1) { | ||
| 205 | printf("Error receiving packet from RXTX port\n"); | ||
| 206 | return -1; | ||
| 207 | } | ||
| 208 | |||
| 209 | - rte_eth_stats_get(RXTX_PORT4, &stats); | ||
| 210 | - rte_eth_stats_get(RXTX_PORT5, &stats2); | ||
| 211 | - if (stats.ipackets != 0 || stats.opackets != 1 || | ||
| 212 | + rte_eth_stats_get(RXTX_PORT2, &stats); | ||
| 213 | + rte_eth_stats_get(RXTX_PORT3, &stats2); | ||
| 214 | + if (stats.ipackets != 1 || stats.opackets != 1 || | ||
| 215 | stats.ibytes != 0 || stats.obytes != 0 || | ||
| 216 | stats.ierrors != 0 || stats.oerrors != 0) { | ||
| 217 | printf("Error: RXTX port stats are not as expected\n"); | ||
| 218 | return -1; | ||
| 219 | } | ||
| 220 | |||
| 221 | - if (stats2.ipackets != 1 || stats2.opackets != 0 || | ||
| 222 | + if (stats2.ipackets != 1 || stats2.opackets != 1 || | ||
| 223 | stats2.ibytes != 0 || stats2.obytes != 0 || | ||
| 224 | stats2.ierrors != 0 || stats2.oerrors != 0) { | ||
| 225 | printf("Error: RXTX port stats are not as expected\n"); | ||
| 226 | return -1; | ||
| 227 | } | ||
| 228 | |||
| 229 | - rte_eth_dev_stop(RXTX_PORT4); | ||
| 230 | - rte_eth_dev_stop(RXTX_PORT5); | ||
| 231 | - | ||
| 232 | - return 0; | ||
| 233 | -} | ||
| 234 | - | ||
| 235 | -static int | ||
| 236 | -test_pmd_ring_pair_attach(void) | ||
| 237 | -{ | ||
| 238 | - struct rte_eth_stats stats, stats2; | ||
| 239 | - struct rte_mbuf buf, *pbuf = &buf; | ||
| 240 | - struct rte_eth_conf null_conf; | ||
| 241 | - | ||
| 242 | - if ((RXTX_PORT4 >= RTE_MAX_ETHPORTS) || (RXTX_PORT5 >= RTE_MAX_ETHPORTS)) { | ||
| 243 | - printf(" TX/RX port exceed max eth ports\n"); | ||
| 244 | - return -1; | ||
| 245 | - } | ||
| 246 | - if ((rte_eth_dev_configure(RXTX_PORT4, 1, 1, &null_conf) < 0) | ||
| 247 | - || (rte_eth_dev_configure(RXTX_PORT5, 1, 1, &null_conf) < 0)) { | ||
| 248 | - printf("Configure failed for RXTX port\n"); | ||
| 249 | + /* | ||
| 250 | + * send and receive 1 packet (RXTX_PORT2 -> RXTX_PORT2) | ||
| 251 | + * and check for stats update | ||
| 252 | + */ | ||
| 253 | + if (rte_eth_tx_burst(RXTX_PORT2, 0, &pbuf, 1) != 1) { | ||
| 254 | + printf("Error sending packet to RXTX port\n"); | ||
| 255 | return -1; | ||
| 256 | } | ||
| 257 | |||
| 258 | - if ((rte_eth_tx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL) < 0) | ||
| 259 | - || (rte_eth_tx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL) < 0)) { | ||
| 260 | - printf("TX queue setup failed\n"); | ||
| 261 | + if (rte_eth_rx_burst(RXTX_PORT2, 0, &pbuf, 1) != 1) { | ||
| 262 | + printf("Error receiving packet from RXTX port\n"); | ||
| 263 | return -1; | ||
| 264 | } | ||
| 265 | |||
| 266 | - if ((rte_eth_rx_queue_setup(RXTX_PORT4, 0, RING_SIZE, SOCKET0, NULL, mp) < 0) | ||
| 267 | - || (rte_eth_rx_queue_setup(RXTX_PORT5, 0, RING_SIZE, SOCKET0, NULL, mp) < 0)) { | ||
| 268 | - printf("RX queue setup failed\n"); | ||
| 269 | + rte_eth_stats_get(RXTX_PORT2, &stats); | ||
| 270 | + rte_eth_stats_get(RXTX_PORT3, &stats2); | ||
| 271 | + if (stats.ipackets != 2 || stats.opackets != 2 || | ||
| 272 | + stats.ibytes != 0 || stats.obytes != 0 || | ||
| 273 | + stats.ierrors != 0 || stats.oerrors != 0) { | ||
| 274 | + printf("Error: RXTX port stats are not as expected\n"); | ||
| 275 | return -1; | ||
| 276 | } | ||
| 277 | |||
| 278 | - if ((rte_eth_dev_start(RXTX_PORT4) < 0) | ||
| 279 | - || (rte_eth_dev_start(RXTX_PORT5) < 0)) { | ||
| 280 | - printf("Error starting RXTX port\n"); | ||
| 281 | + if (stats2.ipackets != 1 || stats2.opackets != 1 || | ||
| 282 | + stats2.ibytes != 0 || stats2.obytes != 0 || | ||
| 283 | + stats2.ierrors != 0 || stats2.oerrors != 0) { | ||
| 284 | + printf("Error: RXTX port stats are not as expected\n"); | ||
| 285 | return -1; | ||
| 286 | } | ||
| 287 | |||
| 288 | - rte_eth_stats_reset(RXTX_PORT4); | ||
| 289 | - rte_eth_stats_reset(RXTX_PORT5); | ||
| 290 | - | ||
| 291 | - /* send and receive 1 packet and check for stats update */ | ||
| 292 | - if (rte_eth_tx_burst(RXTX_PORT4, 0, &pbuf, 1) != 1) { | ||
| 293 | + /* | ||
| 294 | + * send and receive 1 packet (RXTX_PORT3 -> RXTX_PORT3) | ||
| 295 | + * and check for stats update | ||
| 296 | + */ | ||
| 297 | + if (rte_eth_tx_burst(RXTX_PORT3, 0, &pbuf, 1) != 1) { | ||
| 298 | printf("Error sending packet to RXTX port\n"); | ||
| 299 | return -1; | ||
| 300 | } | ||
| 301 | - if (rte_eth_rx_burst(RXTX_PORT5, 0, &pbuf, 1) != 1) { | ||
| 302 | + | ||
| 303 | + if (rte_eth_rx_burst(RXTX_PORT3, 0, &pbuf, 1) != 1) { | ||
| 304 | printf("Error receiving packet from RXTX port\n"); | ||
| 305 | return -1; | ||
| 306 | } | ||
| 307 | |||
| 308 | - rte_eth_stats_get(RXTX_PORT4, &stats); | ||
| 309 | - rte_eth_stats_get(RXTX_PORT5, &stats2); | ||
| 310 | - if (stats.ipackets != 0 || stats.opackets != 1 || | ||
| 311 | + rte_eth_stats_get(RXTX_PORT2, &stats); | ||
| 312 | + rte_eth_stats_get(RXTX_PORT3, &stats2); | ||
| 313 | + if (stats.ipackets != 2 || stats.opackets != 2 || | ||
| 314 | stats.ibytes != 0 || stats.obytes != 0 || | ||
| 315 | stats.ierrors != 0 || stats.oerrors != 0) { | ||
| 316 | printf("Error: RXTX port stats are not as expected\n"); | ||
| 317 | return -1; | ||
| 318 | } | ||
| 319 | |||
| 320 | - if (stats2.ipackets != 1 || stats2.opackets != 0 || | ||
| 321 | + if (stats2.ipackets != 2 || stats2.opackets != 2 || | ||
| 322 | stats2.ibytes != 0 || stats2.obytes != 0 || | ||
| 323 | stats2.ierrors != 0 || stats2.oerrors != 0) { | ||
| 324 | printf("Error: RXTX port stats are not as expected\n"); | ||
| 325 | return -1; | ||
| 326 | } | ||
| 327 | |||
| 328 | - rte_eth_dev_stop(RXTX_PORT4); | ||
| 329 | - rte_eth_dev_stop(RXTX_PORT5); | ||
| 330 | + rte_eth_dev_stop(RXTX_PORT2); | ||
| 331 | + rte_eth_dev_stop(RXTX_PORT3); | ||
| 332 | |||
| 333 | return 0; | ||
| 334 | } | ||
| 335 | @@ -448,17 +408,6 @@ test_pmd_ring_pair_attach(void) | ||
| 336 | int | ||
| 337 | test_pmd_ring(void) | ||
| 338 | { | ||
| 339 | - r1[0] = rte_ring_create("R1", RING_SIZE, 0, 0); | ||
| 340 | - r1[1] = rte_ring_create("R2", RING_SIZE, 0, 0); | ||
| 341 | - if (r1[0] == NULL && (r1[0] = rte_ring_lookup("R1")) == NULL) | ||
| 342 | - return -1; | ||
| 343 | - if (r1[1] == NULL && (r1[1] = rte_ring_lookup("R2")) == NULL) | ||
| 344 | - return -1; | ||
| 345 | - | ||
| 346 | - r2 = rte_ring_create("R3", RING_SIZE, 0, RING_F_SP_ENQ|RING_F_SC_DEQ); | ||
| 347 | - if (r2 == NULL && (r2 = rte_ring_lookup("R3")) == NULL) | ||
| 348 | - return -1; | ||
| 349 | - | ||
| 350 | mp = rte_mempool_create("mbuf_pool", NB_MBUF, | ||
| 351 | MBUF_SIZE, 32, | ||
| 352 | sizeof(struct rte_pktmbuf_pool_private), | ||
| 353 | @@ -468,8 +417,6 @@ test_pmd_ring(void) | ||
| 354 | if (mp == NULL) | ||
| 355 | return -1; | ||
| 356 | |||
| 357 | - start_idx = rte_eth_dev_count(); | ||
| 358 | - | ||
| 359 | if ((TX_PORT >= RTE_MAX_ETHPORTS) || (RX_PORT >= RTE_MAX_ETHPORTS)\ | ||
| 360 | || (RXTX_PORT >= RTE_MAX_ETHPORTS)) { | ||
| 361 | printf(" TX/RX port exceed max eth ports\n"); | ||
| 362 | @@ -492,14 +439,9 @@ test_pmd_ring(void) | ||
| 363 | rte_eth_dev_stop(TX_PORT); | ||
| 364 | rte_eth_dev_stop(RXTX_PORT); | ||
| 365 | |||
| 366 | - if (test_pmd_ring_init() < 0) | ||
| 367 | + if (test_pmd_ring_pair_create_attach() < 0) | ||
| 368 | return -1; | ||
| 369 | |||
| 370 | - if (test_pmd_ring_pair_create() < 0) | ||
| 371 | - return -1; | ||
| 372 | - | ||
| 373 | - if (test_pmd_ring_pair_attach() < 0) | ||
| 374 | - return -1; | ||
| 375 | return 0; | ||
| 376 | } | ||
| 377 | |||
| 378 | -- | ||
| 379 | 1.9.1 | ||
| 380 | |||
diff --git a/common/recipes-extended/dpdk/dpdk_1.7.0.bb b/common/recipes-extended/dpdk/dpdk_1.7.0.bb new file mode 100644 index 00000000..581f1d4a --- /dev/null +++ b/common/recipes-extended/dpdk/dpdk_1.7.0.bb | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | include dpdk.inc | ||
| 2 | |||
| 3 | SRC_URI = "http://dpdk.org/browse/dpdk/snapshot/dpdk-${PV}.tar.gz;name=dpdk \ | ||
| 4 | file://dpdk-1.7.0-examples-Add-config-variables-to-enable-disable-dpdk.patch \ | ||
| 5 | file://dpdk-1.7.0-examples-pipeline-build-with-all-examples.patch \ | ||
| 6 | file://dpdk-1.7.0-ring-remove-extra-devices-creation-with-vdev-option.patch \ | ||
| 7 | file://dpdk-1.7.0-ring-simplify-unit-tests.patch \ | ||
| 8 | " | ||
| 9 | |||
| 10 | SRC_URI[dpdk.md5sum] = "07907d7b1a64888a459a971c45818038" | ||
| 11 | SRC_URI[dpdk.sha256sum] = "aafc290260b5002d248ab8f8c8ffa76454d4b1382aa3c82ae2700ecce481397a" | ||
| 12 | |||
| 13 | export EXAMPLES_BUILD_DIR = "${RTE_TARGET}" | ||
| 14 | |||
| 15 | # dpdk example apps dpdk_qat and vhost have dependancy on fuse and qat. | ||
| 16 | # fuse is in meta-filesystems and qat is not yet upstreamed. | ||
| 17 | # So adding mechanism to explicitly disable the use of fuse and qat. | ||
| 18 | # To enable, uncomment the below line or include in .bbappend. | ||
| 19 | # PACKAGECONFIG ?= " dpdk_qat vhost " | ||
| 20 | |||
| 21 | PACKAGECONFIG[dpdk_qat] = ",,qat" | ||
| 22 | PACKAGECONFIG[vhost] = ",,fuse" | ||
| 23 | |||
| 24 | do_compile_append () { | ||
| 25 | |||
| 26 | cd ${S}/examples/ | ||
| 27 | |||
| 28 | # Disable the compilation of example apps dpdk_qat and vhost if they are | ||
| 29 | # not included in the PACKAGECONFIG | ||
| 30 | export CONFIG_EXAMPLE_DPDK_QAT=${@base_contains('PACKAGECONFIG', 'dpdk_qat', 'y', 'n', d)} | ||
| 31 | export CONFIG_EXAMPLE_DPDK_VHOST="${@base_contains('PACKAGECONFIG', 'vhost', 'y', 'n', d)}" | ||
| 32 | |||
| 33 | ############################################################### | ||
| 34 | # In order to make use of dpdk.inc for example app installation | ||
| 35 | # without failure, override the default build directory | ||
| 36 | ############################################################### | ||
| 37 | oe_runmake CROSS="${TARGET_PREFIX}" O="${S}/examples/$@/" | ||
| 38 | } | ||
| 39 | |||
| 40 | |||
| 41 | |||
