* [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
@ 2016-07-26 15:56 Maxime Coquelin
2016-07-26 15:56 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new " Maxime Coquelin
` (3 more replies)
0 siblings, 4 replies; 9+ messages in thread
From: Maxime Coquelin @ 2016-07-26 15:56 UTC (permalink / raw)
To: bruce.richardson, pablo.de.lara.guarch; +Cc: dev, Maxime Coquelin
This series adds a new option to enable/disable MAC addresses tweaking in
l2fwd example.
Doing that, we can enable basic VM 2 VM communication easily, without
external projects dependencies, nor real NIC (as with vhost example).
Example of cli with vhost-user:
#l2fwd -c f --socket-mem=1024 \
--vdev 'eth_vhost0,iface=/tmp/vhost-user1,queues=1' \
--vdev 'eth_vhost1,iface=/tmp/vhost-user2,queues=1' \
-- -p3 --no-mac-tweaking
By default, MAC addresses tweaking remains enabled, but maybe we could
consider having it disabled by default to be consistent with l2fwd-cat
for example.
Maxime Coquelin (2):
examples/l2fwd: Add new option to enable/disable MAC addresses
tweaking
doc: l2fwd: document new --[no-]mac-tweaking option
doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg | 311 +++++++++++++++++++++
.../sample_app_ug/l2_forward_real_virtual.rst | 24 +-
examples/l2fwd/main.c | 39 ++-
3 files changed, 358 insertions(+), 16 deletions(-)
create mode 100644 doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new option to enable/disable MAC addresses tweaking
2016-07-26 15:56 [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Maxime Coquelin
@ 2016-07-26 15:56 ` Maxime Coquelin
2016-08-30 15:42 ` Mcnamara, John
2016-07-26 15:56 ` [dpdk-dev] [PATCH 2/2] doc: l2fwd: document new --[no-]mac-tweaking option Maxime Coquelin
` (2 subsequent siblings)
3 siblings, 1 reply; 9+ messages in thread
From: Maxime Coquelin @ 2016-07-26 15:56 UTC (permalink / raw)
To: bruce.richardson, pablo.de.lara.guarch; +Cc: dev, Maxime Coquelin
l2fwd could be useful for testing virtual devices without the need
of physical ones.
To achieve this, this patch adds a new option to enable/disable the
MAC addresses tweaking done at forwarding time: --[no-]mac-tweaking
By default, MAC address tweaking remains enabled, to keep consistency
with previous usage.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
examples/l2fwd/main.c | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 8897921..2693be1 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -74,6 +74,9 @@
static volatile bool force_quit;
+/* MAC tweaking enabled by default */
+static int mac_tweaking = 1;
+
#define RTE_LOGTYPE_L2FWD RTE_LOGTYPE_USER1
#define NB_MBUF 8192
@@ -186,23 +189,32 @@ print_stats(void)
}
static void
-l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
+l2fwd_mac_tweaking(struct rte_mbuf *m, unsigned dest_portid)
{
struct ether_hdr *eth;
void *tmp;
- unsigned dst_port;
- int sent;
- struct rte_eth_dev_tx_buffer *buffer;
- dst_port = l2fwd_dst_ports[portid];
eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = ð->d_addr.addr_bytes[0];
- *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dst_port << 40);
+ *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);
/* src addr */
- ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], ð->s_addr);
+ ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], ð->s_addr);
+}
+
+static void
+l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
+{
+ unsigned dst_port;
+ int sent;
+ struct rte_eth_dev_tx_buffer *buffer;
+
+ dst_port = l2fwd_dst_ports[portid];
+
+ if (mac_tweaking)
+ l2fwd_mac_tweaking(m, dst_port);
buffer = tx_buffer[dst_port];
sent = rte_eth_tx_buffer(dst_port, 0, buffer, m);
@@ -322,7 +334,11 @@ l2fwd_usage(const char *prgname)
printf("%s [EAL options] -- -p PORTMASK [-q NQ]\n"
" -p PORTMASK: hexadecimal bitmask of ports to configure\n"
" -q NQ: number of queue (=ports) per lcore (default is 1)\n"
- " -T PERIOD: statistics will be refreshed each PERIOD seconds (0 to disable, 10 default, 86400 maximum)\n",
+ " -T PERIOD: statistics will be refreshed each PERIOD seconds (0 to disable, 10 default, 86400 maximum)\n"
+ " --[no-]mac-tweaking: Enable or disable MAC addresses tweaking (enabled by default)\n"
+ " When enabled:\n"
+ " - The source MAC address is replaced by the TX port MAC address\n"
+ " - The destination MAC address is replaced by 02:00:00:00:00:TX_PORT_ID\n",
prgname);
}
@@ -386,6 +402,8 @@ l2fwd_parse_args(int argc, char **argv)
int option_index;
char *prgname = argv[0];
static struct option lgopts[] = {
+ { "mac-tweaking", no_argument, &mac_tweaking, 1},
+ { "no-mac-tweaking", no_argument, &mac_tweaking, 0},
{NULL, 0, 0, 0}
};
@@ -428,8 +446,7 @@ l2fwd_parse_args(int argc, char **argv)
/* long options */
case 0:
- l2fwd_usage(prgname);
- return -1;
+ break;
default:
l2fwd_usage(prgname);
@@ -542,6 +559,8 @@ main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid L2FWD arguments\n");
+ printf("MAC tweaking %s\n", mac_tweaking ? "enabled" : "disabled");
+
/* convert to number of cycles */
timer_period *= rte_get_timer_hz();
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* [dpdk-dev] [PATCH 2/2] doc: l2fwd: document new --[no-]mac-tweaking option
2016-07-26 15:56 [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Maxime Coquelin
2016-07-26 15:56 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new " Maxime Coquelin
@ 2016-07-26 15:56 ` Maxime Coquelin
2016-08-30 15:42 ` [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Mcnamara, John
2016-09-21 21:53 ` De Lara Guarch, Pablo
3 siblings, 0 replies; 9+ messages in thread
From: Maxime Coquelin @ 2016-07-26 15:56 UTC (permalink / raw)
To: bruce.richardson, pablo.de.lara.guarch; +Cc: dev, Maxime Coquelin
This patch documents the new l2fwd option, which provides a way to
disable the MAC addresses tweaking, enabling the use of l2fwd for basic
VM to VM communication.
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg | 311 +++++++++++++++++++++
.../sample_app_ug/l2_forward_real_virtual.rst | 24 +-
2 files changed, 329 insertions(+), 6 deletions(-)
create mode 100644 doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
diff --git a/doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg b/doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
new file mode 100644
index 0000000..b84dcb2
--- /dev/null
+++ b/doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="554.46204"
+ height="443.63278"
+ viewBox="0 0 554.46204 443.63279"
+ id="svg3917"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="l2_fwd_vm2vm.svg">
+ <defs
+ id="defs3919">
+ <marker
+ inkscape:isstock="true"
+ style="overflow:visible"
+ id="marker8020"
+ refX="0"
+ refY="0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="matrix(-0.8,0,0,-0.8,-10,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ id="path8022"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:isstock="true"
+ style="overflow:visible"
+ id="marker7177"
+ refX="0"
+ refY="0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="matrix(-0.8,0,0,-0.8,-10,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ id="path7179"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:isstock="true"
+ style="overflow:visible"
+ id="marker6025"
+ refX="0"
+ refY="0"
+ orient="auto"
+ inkscape:stockid="Arrow1Lend">
+ <path
+ transform="matrix(-0.8,0,0,-0.8,-10,0)"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ id="path6027"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Lend"
+ style="overflow:visible"
+ inkscape:isstock="true"
+ inkscape:collect="always">
+ <path
+ id="path5351"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lstart"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Lstart"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ id="path5348"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(0.8,0,0,0.8,10,0)"
+ inkscape:connector-curvature="0" />
+ </marker>
+ <inkscape:path-effect
+ effect="powerstroke"
+ id="path-effect4780"
+ is_visible="true"
+ offset_points="0,0.5"
+ sort_points="true"
+ interpolator_type="Linear"
+ interpolator_beta="0.2"
+ start_linecap_type="zerowidth"
+ linejoin_type="round"
+ miter_limit="4"
+ end_linecap_type="zerowidth"
+ cusp_linecap_type="round" />
+ <linearGradient
+ id="linearGradient4729"
+ osb:paint="solid">
+ <stop
+ style="stop-color:#000000;stop-opacity:1;"
+ offset="0"
+ id="stop4731" />
+ </linearGradient>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Lend-5"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ inkscape:connector-curvature="0"
+ id="path5351-3"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Lend-6"
+ style="overflow:visible"
+ inkscape:isstock="true"
+ inkscape:collect="always">
+ <path
+ inkscape:connector-curvature="0"
+ id="path5351-2"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Lend-6-1"
+ style="overflow:visible"
+ inkscape:isstock="true">
+ <path
+ inkscape:connector-curvature="0"
+ id="path5351-2-2"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z"
+ style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1"
+ transform="matrix(-0.8,0,0,-0.8,-10,0)" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1"
+ inkscape:cx="323.29803"
+ inkscape:cy="27.634604"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:snap-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:window-width="1276"
+ inkscape:window-height="1400"
+ inkscape:window-x="1280"
+ inkscape:window-y="38"
+ inkscape:window-maximized="0"
+ units="px"
+ fit-margin-top="5"
+ fit-margin-left="5"
+ fit-margin-right="5"
+ fit-margin-bottom="5" />
+ <metadata
+ id="metadata3922">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-0.56091356,-0.34416246)">
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:2.10537624;stroke-opacity:1"
+ id="rect4727"
+ width="542.35669"
+ height="431.5274"
+ x="6.6136017"
+ y="6.3968506" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:30.53249741px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="237.30467"
+ y="33.252548"
+ id="text4735"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4737"
+ x="237.30467"
+ y="33.252548">Host</tspan></text>
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"
+ id="rect4739"
+ width="207.08128"
+ height="202.03053"
+ x="38.385803"
+ y="45.240112" />
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-opacity:1"
+ id="rect4739-3"
+ width="207.08128"
+ height="202.03053"
+ x="301.53052"
+ y="44.22995" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:19.96650314px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="101.13004"
+ y="63.706543"
+ id="text4756"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4758"
+ x="101.13004"
+ y="63.706543">Guest1</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:19.96650314px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="369.73492"
+ y="63.619873"
+ id="text4756-6"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan4758-7"
+ x="369.73492"
+ y="63.619873">Guest2</tspan></text>
+ <rect
+ style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect5336"
+ width="477.80215"
+ height="85.862968"
+ x="39.39595"
+ y="316.97116" />
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-weight:normal;font-size:23.81648636px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ x="237.96404"
+ y="398.79352"
+ id="text5338"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5340"
+ x="237.96404"
+ y="398.79352">L2FWD</tspan></text>
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.9760201px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)"
+ d="m 120.20815,247.27063 0,68.32236"
+ id="path5342"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.9760201px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend-5)"
+ d="m 382.84782,246.56645 0,68.32236"
+ id="path5342-5"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.9760201px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend-6)"
+ d="m 162.63455,316.66519 0,-68.32236"
+ id="path5342-9"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.9760201px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend-6-1)"
+ d="m 423.25391,315.65504 0,-68.32236"
+ id="path5342-9-7"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.60951841;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4.82855511, 1.60951837;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 119.48645,319.66266 0,47.47156 303.479,0 0,-51.26929"
+ id="path10412"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.1137104;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3.3411313, 1.11371043;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 162.67537,318.28501 0,31.19206 221.14177,0 0,-33.68743"
+ id="path10412-0"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
index a1c10c0..dcb486c 100644
--- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
+++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst
@@ -50,15 +50,17 @@ performs L2 forwarding for each packet that is received on an RX_PORT.
The destination port is the adjacent port from the enabled portmask, that is,
if the first four ports are enabled (portmask 0xf),
ports 1 and 2 forward into each other, and ports 3 and 4 forward into each other.
-Also, the MAC addresses are affected as follows:
+Also, if MAC addresses tweaking is enabled, the MAC addresses are affected as follows:
* The source MAC address is replaced by the TX_PORT MAC address
* The destination MAC address is replaced by 02:00:00:00:00:TX_PORT_ID
-This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup`.
+This application can be used to benchmark performance using a traffic-generator, as shown in the :numref:`figure_l2_fwd_benchmark_setup`,
+or in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup`.
-The application can also be used in a virtualized environment as shown in :numref:`figure_l2_fwd_virtenv_benchmark_setup`.
+This application can also be used for basic VM to VM communication as shown in :numref:`figure_l2_fwd_vm2vm`,
+when MAC addresses tweaking is disabled.
The L2 Forwarding application can also be used as a starting point for developing a new application based on the DPDK.
@@ -75,6 +77,12 @@ The L2 Forwarding application can also be used as a starting point for developin
Performance Benchmark Setup (Virtualized Environment)
+.. _figure_l2_fwd_vm2vm:
+
+.. figure:: img/l2_fwd_vm2vm.*
+
+ Virtual Machine to Virtual Machine communication.
+
.. _l2_fwd_vf_setup:
Virtual Function Setup Instructions
@@ -128,7 +136,7 @@ The application requires a number of command line options:
.. code-block:: console
- ./build/l2fwd [EAL options] -- -p PORTMASK [-q NQ]
+ ./build/l2fwd [EAL options] -- -p PORTMASK [-q NQ] --[no-]mac-tweaking
where,
@@ -136,7 +144,10 @@ where,
* q NQ: A number of queues (=ports) per lcore (default is 1)
-To run the application in linuxapp environment with 4 lcores, 16 ports and 8 RX queues per lcore, issue the command:
+* --[no-]mac-tweaking: Enable or disable MAC addresses tweaking (enabled by default).
+
+To run the application in linuxapp environment with 4 lcores, 16 ports and 8 RX queues per lcore and MAC address
+tweaking enabled, issue the command:
.. code-block:: console
@@ -415,7 +426,8 @@ Packets are read in a burst of size MAX_PKT_BURST.
The rte_eth_rx_burst() function writes the mbuf pointers in a local table and returns the number of available mbufs in the table.
Then, each mbuf in the table is processed by the l2fwd_simple_forward() function.
-The processing is very simple: process the TX port from the RX port, then replace the source and destination MAC addresses.
+The processing is very simple: process the TX port from the RX port, then replace the source and destination MAC addresses if MAC
+addresses tweaking is enabled.
.. note::
--
2.7.4
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
2016-07-26 15:56 [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Maxime Coquelin
2016-07-26 15:56 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new " Maxime Coquelin
2016-07-26 15:56 ` [dpdk-dev] [PATCH 2/2] doc: l2fwd: document new --[no-]mac-tweaking option Maxime Coquelin
@ 2016-08-30 15:42 ` Mcnamara, John
2016-09-23 13:54 ` Maxime Coquelin
2016-09-21 21:53 ` De Lara Guarch, Pablo
3 siblings, 1 reply; 9+ messages in thread
From: Mcnamara, John @ 2016-08-30 15:42 UTC (permalink / raw)
To: Maxime Coquelin, Richardson, Bruce, De Lara Guarch, Pablo; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Maxime Coquelin
> Sent: Tuesday, July 26, 2016 4:56 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to
> enable/disable MAC addresses tweaking
>
> This series adds a new option to enable/disable MAC addresses tweaking in
> l2fwd example.
>
> Doing that, we can enable basic VM 2 VM communication easily, without
> external projects dependencies, nor real NIC (as with vhost example).
Hi,
This looks like a useful feature. However, I don't know if "tweaking" is
the best description of the feature. Maybe "updating" would be better.
John
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new option to enable/disable MAC addresses tweaking
2016-07-26 15:56 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new " Maxime Coquelin
@ 2016-08-30 15:42 ` Mcnamara, John
0 siblings, 0 replies; 9+ messages in thread
From: Mcnamara, John @ 2016-08-30 15:42 UTC (permalink / raw)
To: Maxime Coquelin, Richardson, Bruce, De Lara Guarch, Pablo; +Cc: dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Maxime Coquelin
> Sent: Tuesday, July 26, 2016 4:56 PM
> To: Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
> <pablo.de.lara.guarch@intel.com>
> Cc: dev@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
> Subject: [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new option to
> enable/disable MAC addresses tweaking
>
> l2fwd could be useful for testing virtual devices without the need of
> physical ones.
>
> To achieve this, this patch adds a new option to enable/disable the MAC
> addresses tweaking done at forwarding time: --[no-]mac-tweaking
Acked-by: John McNamara <john.mcnamara@intel.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
2016-07-26 15:56 [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Maxime Coquelin
` (2 preceding siblings ...)
2016-08-30 15:42 ` [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Mcnamara, John
@ 2016-09-21 21:53 ` De Lara Guarch, Pablo
2016-09-23 13:52 ` Maxime Coquelin
3 siblings, 1 reply; 9+ messages in thread
From: De Lara Guarch, Pablo @ 2016-09-21 21:53 UTC (permalink / raw)
To: Maxime Coquelin, Richardson, Bruce; +Cc: dev
> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Tuesday, July 26, 2016 8:56 AM
> To: Richardson, Bruce; De Lara Guarch, Pablo
> Cc: dev@dpdk.org; Maxime Coquelin
> Subject: [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC
> addresses tweaking
>
> This series adds a new option to enable/disable MAC addresses tweaking in
> l2fwd example.
>
> Doing that, we can enable basic VM 2 VM communication easily, without
> external projects dependencies, nor real NIC (as with vhost example).
>
> Example of cli with vhost-user:
>
> #l2fwd -c f --socket-mem=1024 \
> --vdev 'eth_vhost0,iface=/tmp/vhost-user1,queues=1' \
> --vdev 'eth_vhost1,iface=/tmp/vhost-user2,queues=1' \
> -- -p3 --no-mac-tweaking
>
> By default, MAC addresses tweaking remains enabled, but maybe we could
> consider having it disabled by default to be consistent with l2fwd-cat
> for example.
>
> Maxime Coquelin (2):
> examples/l2fwd: Add new option to enable/disable MAC addresses
> tweaking
> doc: l2fwd: document new --[no-]mac-tweaking option
>
> doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg | 311
> +++++++++++++++++++++
> .../sample_app_ug/l2_forward_real_virtual.rst | 24 +-
> examples/l2fwd/main.c | 39 ++-
> 3 files changed, 358 insertions(+), 16 deletions(-)
> create mode 100644 doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
>
> --
> 2.7.4
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
2016-09-21 21:53 ` De Lara Guarch, Pablo
@ 2016-09-23 13:52 ` Maxime Coquelin
2016-09-23 17:11 ` De Lara Guarch, Pablo
0 siblings, 1 reply; 9+ messages in thread
From: Maxime Coquelin @ 2016-09-23 13:52 UTC (permalink / raw)
To: De Lara Guarch, Pablo, Richardson, Bruce; +Cc: dev
On 09/21/2016 11:53 PM, De Lara Guarch, Pablo wrote:
>
>
>> -----Original Message-----
>> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
>> Sent: Tuesday, July 26, 2016 8:56 AM
>> To: Richardson, Bruce; De Lara Guarch, Pablo
>> Cc: dev@dpdk.org; Maxime Coquelin
>> Subject: [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC
>> addresses tweaking
>>
>> This series adds a new option to enable/disable MAC addresses tweaking in
>> l2fwd example.
>>
>> Doing that, we can enable basic VM 2 VM communication easily, without
>> external projects dependencies, nor real NIC (as with vhost example).
>>
>> Example of cli with vhost-user:
>>
>> #l2fwd -c f --socket-mem=1024 \
>> --vdev 'eth_vhost0,iface=/tmp/vhost-user1,queues=1' \
>> --vdev 'eth_vhost1,iface=/tmp/vhost-user2,queues=1' \
>> -- -p3 --no-mac-tweaking
>>
>> By default, MAC addresses tweaking remains enabled, but maybe we could
>> consider having it disabled by default to be consistent with l2fwd-cat
>> for example.
>>
>> Maxime Coquelin (2):
>> examples/l2fwd: Add new option to enable/disable MAC addresses
>> tweaking
>> doc: l2fwd: document new --[no-]mac-tweaking option
>>
>> doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg | 311
>> +++++++++++++++++++++
>> .../sample_app_ug/l2_forward_real_virtual.rst | 24 +-
>> examples/l2fwd/main.c | 39 ++-
>> 3 files changed, 358 insertions(+), 16 deletions(-)
>> create mode 100644 doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
>>
>> --
>> 2.7.4
>
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
>
Thanks Pablo,
Just sent the v2, but didn't applied your Ack since I did some changes,
even though trivial ones.
Regards,
Maxime
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
2016-08-30 15:42 ` [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Mcnamara, John
@ 2016-09-23 13:54 ` Maxime Coquelin
0 siblings, 0 replies; 9+ messages in thread
From: Maxime Coquelin @ 2016-09-23 13:54 UTC (permalink / raw)
To: Mcnamara, John, Richardson, Bruce, De Lara Guarch, Pablo; +Cc: dev
Hi John,
On 08/30/2016 05:42 PM, Mcnamara, John wrote:
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Maxime Coquelin
>> Sent: Tuesday, July 26, 2016 4:56 PM
>> To: Richardson, Bruce <bruce.richardson@intel.com>; De Lara Guarch, Pablo
>> <pablo.de.lara.guarch@intel.com>
>> Cc: dev@dpdk.org; Maxime Coquelin <maxime.coquelin@redhat.com>
>> Subject: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to
>> enable/disable MAC addresses tweaking
>>
>> This series adds a new option to enable/disable MAC addresses tweaking in
>> l2fwd example.
>>
>> Doing that, we can enable basic VM 2 VM communication easily, without
>> external projects dependencies, nor real NIC (as with vhost example).
>
> Hi,
>
> This looks like a useful feature. However, I don't know if "tweaking" is
> the best description of the feature. Maybe "updating" would be better.
Sorry, looks like your replies fall through the cracks...
Thanks for the correction, I'm not a native english speaker :)
I should have applied all your remarks, so I added your Ack.
Regards,
Maxime
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking
2016-09-23 13:52 ` Maxime Coquelin
@ 2016-09-23 17:11 ` De Lara Guarch, Pablo
0 siblings, 0 replies; 9+ messages in thread
From: De Lara Guarch, Pablo @ 2016-09-23 17:11 UTC (permalink / raw)
To: Maxime Coquelin, Richardson, Bruce; +Cc: dev
> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Friday, September 23, 2016 6:52 AM
> To: De Lara Guarch, Pablo; Richardson, Bruce
> Cc: dev@dpdk.org
> Subject: Re: [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC
> addresses tweaking
>
>
>
> On 09/21/2016 11:53 PM, De Lara Guarch, Pablo wrote:
> >
> >
> >> -----Original Message-----
> >> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> >> Sent: Tuesday, July 26, 2016 8:56 AM
> >> To: Richardson, Bruce; De Lara Guarch, Pablo
> >> Cc: dev@dpdk.org; Maxime Coquelin
> >> Subject: [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC
> >> addresses tweaking
> >>
> >> This series adds a new option to enable/disable MAC addresses tweaking
> in
> >> l2fwd example.
> >>
> >> Doing that, we can enable basic VM 2 VM communication easily, without
> >> external projects dependencies, nor real NIC (as with vhost example).
> >>
> >> Example of cli with vhost-user:
> >>
> >> #l2fwd -c f --socket-mem=1024 \
> >> --vdev 'eth_vhost0,iface=/tmp/vhost-user1,queues=1' \
> >> --vdev 'eth_vhost1,iface=/tmp/vhost-user2,queues=1' \
> >> -- -p3 --no-mac-tweaking
> >>
> >> By default, MAC addresses tweaking remains enabled, but maybe we
> could
> >> consider having it disabled by default to be consistent with l2fwd-cat
> >> for example.
> >>
> >> Maxime Coquelin (2):
> >> examples/l2fwd: Add new option to enable/disable MAC addresses
> >> tweaking
> >> doc: l2fwd: document new --[no-]mac-tweaking option
> >>
> >> doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg | 311
> >> +++++++++++++++++++++
> >> .../sample_app_ug/l2_forward_real_virtual.rst | 24 +-
> >> examples/l2fwd/main.c | 39 ++-
> >> 3 files changed, 358 insertions(+), 16 deletions(-)
> >> create mode 100644 doc/guides/sample_app_ug/img/l2_fwd_vm2vm.svg
> >>
> >> --
> >> 2.7.4
> >
> > Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
> >
> Thanks Pablo,
>
> Just sent the v2, but didn't applied your Ack since I did some changes,
> even though trivial ones.
This looks good to me, as well.
Pablo
>
> Regards,
> Maxime
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2016-09-23 17:11 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-26 15:56 [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Maxime Coquelin
2016-07-26 15:56 ` [dpdk-dev] [PATCH 1/2] examples/l2fwd: Add new " Maxime Coquelin
2016-08-30 15:42 ` Mcnamara, John
2016-07-26 15:56 ` [dpdk-dev] [PATCH 2/2] doc: l2fwd: document new --[no-]mac-tweaking option Maxime Coquelin
2016-08-30 15:42 ` [dpdk-dev] [PATCH 0/2] examples/l2fwd: Add option to enable/disable MAC addresses tweaking Mcnamara, John
2016-09-23 13:54 ` Maxime Coquelin
2016-09-21 21:53 ` De Lara Guarch, Pablo
2016-09-23 13:52 ` Maxime Coquelin
2016-09-23 17:11 ` De Lara Guarch, Pablo
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).