From: yasufum.o@gmail.com
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH] bin: add interfaces of spp_primary for start.sh
Date: Tue, 16 Jul 2019 16:31:11 +0900 [thread overview]
Message-ID: <20190716073111.18877-1-yasufum.o@gmail.com> (raw)
From: Yasufumi Ogawa <yasufum.o@gmail.com>
Startup script `start.sh` supports using vdevs, but only for vhost. This
update is to add `ring` and `tap` types for the interface.
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
bin/sample/config.sh | 2 ++
bin/spp_pri.sh | 30 ++++++++++++++++++++++++++----
bin/start.sh | 4 +++-
3 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/bin/sample/config.sh b/bin/sample/config.sh
index 915c093..9bdee41 100644
--- a/bin/sample/config.sh
+++ b/bin/sample/config.sh
@@ -12,6 +12,8 @@ PRI_MEMCHAN=4 # change for your memory channels.
NUM_RINGS=8
PRI_PORTMASK=0x03 # total num of ports of spp_primary.
#PRI_VHOST_IDS=(11 12) # you use if you have no phy ports.
+#PRI_RING_IDS=(1 2) # you use if you have no phy ports.
+#PRI_TAP_IDS=(1 2) # you use if you have no phy ports.
# You do not need to change usually.
# Log files created in 'spp/log/'.
diff --git a/bin/spp_pri.sh b/bin/spp_pri.sh
index 2f45b83..62a6075 100644
--- a/bin/spp_pri.sh
+++ b/bin/spp_pri.sh
@@ -5,22 +5,42 @@
#set -x
SPP_PRI_VHOST=""
+SPP_PRI_RING=""
+SPP_PRI_TAP=""
function clean_sock_files() {
# clean /tmp/sock*
sudo rm -f /tmp/sock*
}
-# Add vdevs if no physical ports.
-function setup_vdevs() {
- if [ ${PRI_VHOST_IDS} ]; then
- for id in ${PRI_VHOST_IDS[@]}; do
+# Add vhost vdevs.
+function setup_vhost_vdevs() {
+ if [ ${PRI_VHOST_VDEVS} ]; then
+ for id in ${PRI_VHOST_VDEVS[@]}; do
SPP_SOCK="/tmp/sock${id}"
SPP_PRI_VHOST="${SPP_PRI_VHOST} --vdev eth_vhost${id},iface=${SPP_SOCK}"
done
fi
}
+# Add ring vdevs.
+function setup_ring_vdevs() {
+ if [ ${PRI_RING_VDEVS} ]; then
+ for id in ${PRI_RING_VDEVS[@]}; do
+ SPP_PRI_RING="${SPP_PRI_RING} --vdev net_ring${id}"
+ done
+ fi
+}
+
+# Add tap vdevs.
+function setup_tap_vdevs() {
+ if [ ${PRI_TAP_VDEVS} ]; then
+ for id in ${PRI_TAP_VDEVS[@]}; do
+ SPP_PRI_TAP="${SPP_PRI_TAP} --vdev net_tap${id},iface=vtap${id}"
+ done
+ fi
+}
+
# Launch spp_primary.
function spp_pri() {
SPP_PRI_BIN=${SPP_DIR}/src/primary/${RTE_TARGET}/spp_primary
@@ -33,6 +53,8 @@ function spp_pri() {
--base-virtaddr 0x100000000 \
--log-level ${LOGLEVEL} \
${SPP_PRI_VHOST} \
+ ${SPP_PRI_RING} \
+ ${SPP_PRI_TAP} \
-- \
-p ${PRI_PORTMASK} \
-n ${NUM_RINGS} \
diff --git a/bin/start.sh b/bin/start.sh
index 9bc1ff0..bf57d4e 100755
--- a/bin/start.sh
+++ b/bin/start.sh
@@ -31,7 +31,9 @@ python3 ${SPP_DIR}/src/spp-ctl/spp-ctl -b ${SPP_HOST_IP} \
echo "Start spp_primary"
. ${SPP_DIR}/bin/spp_pri.sh
clean_sock_files # remove /tmp/sock* as initialization
-setup_vdevs # you use vdevs if you have no phy ports
+setup_vhost_vdevs # you use vdevs if you have no phy ports
+setup_ring_vdevs # you use vdevs if you have no phy ports
+setup_tap_vdevs # you use vdevs if you have no phy ports
spp_pri # launch spp_primary
echo "Waiting for spp-ctl is ready ..."
--
2.17.1
reply other threads:[~2019-07-16 7:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20190716073111.18877-1-yasufum.o@gmail.com \
--to=yasufum.o@gmail.com \
--cc=ferruh.yigit@intel.com \
--cc=spp@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).