From: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
To: dev@dpdk.org
Subject: [PATCH V2] examples/pipeline: simplify the L2 forwarding example
Date: Tue, 13 Feb 2024 12:19:21 +0000 [thread overview]
Message-ID: <20240213121921.1522224-1-cristian.dumitrescu@intel.com> (raw)
In-Reply-To: <20240213121337.1521711-1-cristian.dumitrescu@intel.com>
Simplified the L2 forwarding examples by removing all tables and
actions, as they are not really needed for this simplest use-case.
Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
examples/pipeline/examples/l2fwd.spec | 34 +++++++--------------------
1 file changed, 8 insertions(+), 26 deletions(-)
diff --git a/examples/pipeline/examples/l2fwd.spec b/examples/pipeline/examples/l2fwd.spec
index 0aebafd07b..1e3e1ad040 100644
--- a/examples/pipeline/examples/l2fwd.spec
+++ b/examples/pipeline/examples/l2fwd.spec
@@ -1,42 +1,24 @@
; SPDX-License-Identifier: BSD-3-Clause
; Copyright(c) 2020 Intel Corporation
+; The simplest pipeline processing with just packet reception and transmission. No header parsing,
+; table lookup or action execution involved. Packets received on port 0 are sent out on port 1,
+; those received on port 1 are sent out on port 0, etc.
+
//
// Meta-data.
//
struct metadata_t {
- bit<32> port_in
- bit<32> port_out
+ bit<32> port
}
metadata instanceof metadata_t
-//
-// Actions.
-//
-action NoAction args none {
- return
-}
-
-//
-// Tables.
-//
-table stub {
- key {
- }
-
- actions {
- NoAction
- }
-
- default_action NoAction args none const
-}
-
//
// Pipeline.
//
apply {
- rx m.port_in
- table stub
- tx m.port_in
+ rx m.port
+ xor m.port 1
+ tx m.port
}
--
2.34.1
next prev parent reply other threads:[~2024-02-13 12:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 12:13 [PATCH] " Cristian Dumitrescu
2024-02-13 12:19 ` Cristian Dumitrescu [this message]
2024-02-15 19:26 ` [PATCH V3] examples/pipeline: simplify the L2 forwarding examples Cristian Dumitrescu
2024-02-19 0:55 ` Thomas Monjalon
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=20240213121921.1522224-1-cristian.dumitrescu@intel.com \
--to=cristian.dumitrescu@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).