From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3EE9DA04F7 for ; Fri, 20 Dec 2019 08:41:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 373042C17; Fri, 20 Dec 2019 08:41:20 +0100 (CET) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by dpdk.org (Postfix) with ESMTP id 81E142C17 for ; Fri, 20 Dec 2019 08:41:19 +0100 (CET) Received: by mail-pf1-f175.google.com with SMTP id x184so4748230pfb.3 for ; Thu, 19 Dec 2019 23:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=gBDcwVUcDkU9WCk86s3NQdVHhivS4TY6t6aa6vqdeF8=; b=SzNfDXVTsNGRNmkHvEfgYc+74rgTy6s5QtTj9VrJPcg8ONgkle/iXMayFNG7SLWrTk BXS709wnySwftrRWrv2ioxn6kY33sWQ52xOOao/1Ff9a+jPA+ZNOIyn+YU0YOv1wePFc b3uQAVgWlFgT4l7iXSmiLsYfofjU65AwjkyXRyOGK4JNElzoa5phPv/TbfaBV7z6K3ne WoSY+7wmQXZxqIJoZ+gDthei6K1LZu1coHsSkDereTRf5STUsgQNehtBaYsHokMfA7FX /lfhb7t5zXJj4aA2m4tF5tsgBbs+KegcKc7HvJEUmYmzqQeSjo7Wf72hh1RWLbmC3GrA aDng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=gBDcwVUcDkU9WCk86s3NQdVHhivS4TY6t6aa6vqdeF8=; b=b9OckGZbNvZ8HuIuYsN9Vu3zVQOiNvIYa9YPMxxzEFpkSSwnsKD6wNdrpsx3CK0dqa mGPJr1sJJkf02l+66bsS/dVXLybFY+pme7YjAmTNgKKXie1H/1DiErw5lbAl3Yv5Lm/Q sNpj3AM+O2pOnViHlRmN0SNr6TvQgAi/3lrYx+NxIXuDsKaLL26on8eTm+4tYoAtLSPw cXDqriL+86Y3VAfokxpuhu9hyZRHNfUJgGrmzwWnXVzC5v1OFW2t//uMa4ur2oV8L8F2 5lQcHCCPSdrCVf7tABGp3Vpr5G8U4roMwKAYT0y1qtxrCKwsndT+XA9f69C3rK9n5qWD MwLg== X-Gm-Message-State: APjAAAXHV5UEPF74mY/onYmUP2bzbJj9qqENaBqlPsm7GOwzljndIHPD Q27WwdNAPMYPNAhGVl4nGk5qOHE1 X-Google-Smtp-Source: APXvYqw0Dpofd+k4XCINGJf+qtOrp4CNL5niBA/Y0ufa03MugLFdV4+jLVVFc5cgz6OXfRTrtgUZiw== X-Received: by 2002:a63:3cb:: with SMTP id 194mr13799142pgd.123.1576827678418; Thu, 19 Dec 2019 23:41:18 -0800 (PST) Received: from localhost.localdomain ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id i3sm9641378pfo.72.2019.12.19.23.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2019 23:41:18 -0800 (PST) From: yasufum.o@gmail.com To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com Date: Fri, 20 Dec 2019 16:41:03 +0900 Message-Id: <20191220074103.14065-7-yasufum.o@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191220074103.14065-1-yasufum.o@gmail.com> References: <20191220074103.14065-1-yasufum.o@gmail.com> Subject: [spp] [PATCH 6/6] docs: add file prefix option in usecases X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa This update is to add examples of usage of `--file-prefix` option in `Use Cases` chapter. Signed-off-by: Yasufumi Ogawa --- docs/guides/gsg/howto_use.rst | 84 ++++++++++++++++++++--------- docs/guides/usecases/spp_mirror.rst | 5 ++ docs/guides/usecases/spp_pcap.rst | 5 ++ docs/guides/usecases/spp_vf.rst | 5 ++ 4 files changed, 73 insertions(+), 26 deletions(-) diff --git a/docs/guides/gsg/howto_use.rst b/docs/guides/gsg/howto_use.rst index b0824d4..8520de5 100644 --- a/docs/guides/gsg/howto_use.rst +++ b/docs/guides/gsg/howto_use.rst @@ -15,6 +15,21 @@ You should keep in mind the order of launching processes if you do it manually, or you can use startup script. This start script is for launching ``spp-ctl``, ``spp_primary`` and SPP CLI. +Before starting, you should define environmental variable ``SPP_FILE_PREFIX`` +for using the same prefix among SPP processes. ``--file-prefix`` is an EAL +option for using a different shared data file prefix for a DPDK process. + +.. code-block:: console + + $ export SPP_FILE_PREFIX=spp + +This option is used for running several DPDK processes because it is not +allowed different processes to have the same name of share data file, although +each process of multi-process application should have the same prefix on the +contrary. +Even if you do not run several DPDK applications, you do not need to define +actually. However, it is a good practice because SPP is used for connecting +DPDK applications in actual usecases. .. _spp_gsg_howto_quick_start: @@ -53,22 +68,30 @@ Confirm that the status is ``running``. Now you are ready to launch secondary processes from ``pri; launch`` command, or another terminal. Here is an example for launching ``spp_nfv`` -with options from ``pri; launch``. Log file of this process is created as -``log/spp_nfv1.log``. +with options from ``pri; launch``. +Log file of this process is created as ``log/spp_nfv1.log``. .. code-block:: none - spp > pri; launch nfv 1 -l 1,2 -m 512 -- -n 1 -s 127.0.0.1:6666 + spp > pri; launch nfv 1 -l 1,2 -m 512 --file-prefix spp -- -n 1 -s ... This ``launch`` command supports TAB completion. Parameters for ``spp_nfv`` are completed after secondary ID ``1``. +You might notice ``--file-prefix spp`` which should be the same value among +primary and secondary processes. SPP CLI expects that this value can be +referred as environmental variable ``SPP_FILE_PREFIX``, and spp_primary is +launched with the same ``--file-prefix spp``. +If you run SPP from ``bin/start.sh``, you do no need to define the variable +by yourself because it is defined in ``bin/config.sh`` so that spp_primary is +launched with the prefix. + .. code-block:: none spp > pri; launch nfv 1 # Press TAB - spp > pri; launch nfv 1 -l 1,2 -m 512 -- -n 1 -s 127.0.0.1:6666 + spp > pri; launch nfv 1 -l 1,2 -m 512 --file-prefix spp -- -n 1 -s ... It is same as following options launching from terminal. @@ -78,6 +101,7 @@ It is same as following options launching from terminal. $ sudo ./src/nfv/x86_64-native-linuxapp-gcc/spp_nfv \ -l 1,2 -n 4 -m 512 \ --proc-type secondary \ + --file-prefix spp \ -- \ -n 1 \ -s 127.0.0.1:6666 @@ -100,8 +124,8 @@ If you just patch two DPDK applications on host, it is enough to use one .. code-block:: none - spp > pri; launch nfv 2 -l 1,3 -m 512 -- -n 2 -s 127.0.0.1:6666 - spp > pri; launch vf 3 -l 1,4,5,6 -m 512 -- -n 3 -s 127.0.0.1:6666 + spp > pri; launch nfv 2 -l 1,3 -m 512 --file-prefix spp -- -n 2 -s ... + spp > pri; launch vf 3 -l 1,4,5,6 -m 512 --file-prefix spp -- -n 3 -s ... ... If you launch processes by yourself, ``spp_primary`` must be launched @@ -339,6 +363,7 @@ To launch SPP primary, run ``spp_primary`` with specific options. --socket-mem 512,512 \ --huge-dir /dev/hugepages \ --proc-type primary \ + --file-prefix $SPP_FILE_PREFIX \ --base-virtaddr 0x100000000 -- \ -p 0x03 \ @@ -385,6 +410,7 @@ Here is an example for launching ``spp_primary`` with monitor thread. --socket-mem 512,512 \ --huge-dir /dev/hugepages \ --proc-type primary \ + --file-prefix $SPP_FILE_PREFIX \ --base-virtaddr 0x100000000 -- \ -p 0x03 \ @@ -409,6 +435,7 @@ secondary processes. --vdev eth_vhost1,iface=/tmp/sock1 # used as 1st phy port --vdev eth_vhost2,iface=/tmp/sock2 # used as 2nd phy port --proc-type=primary \ + --file-prefix $SPP_FILE_PREFIX \ --base-virtaddr 0x100000000 -- \ -p 0x03 \ @@ -455,6 +482,7 @@ as ``l2fwd``. $ sudo ./src/nfv/x86_64-native-linuxapp-gcc/spp_nfv \ -l 2-3 -n 4 \ --proc-type secondary \ + --file-prefix $SPP_FILE_PREFIX \ -- \ -n 1 \ -s 192.168.1.100:6666 @@ -487,12 +515,13 @@ spp_vf .. code-block:: console $ sudo ./src/vf/x86_64-native-linuxapp-gcc/spp_vf \ - -l 2-13 -n 4 \ - --proc-type secondary \ - -- \ - --client-id 1 \ - -s 192.168.1.100:6666 \ - --vhost-client + -l 2-13 -n 4 \ + --proc-type secondary \ + --file-prefix $SPP_FILE_PREFIX \ + -- \ + --client-id 1 \ + -s 192.168.1.100:6666 \ + --vhost-client EAL options are the same as primary process. Here is a list of application options of ``spp_vf``. @@ -511,12 +540,13 @@ and options are same as ``spp_vf``. .. code-block:: console $ sudo ./src/mirror/x86_64-native-linuxapp-gcc/spp_mirror \ - -l 2,3 -n 4 \ - --proc-type secondary \ - -- \ - --client-id 1 \ - -s 192.168.1.100:6666 \ - --vhost-client + -l 2,3 -n 4 \ + --proc-type secondary \ + --file-prefix $SPP_FILE_PREFIX \ + -- \ + --client-id 1 \ + -s 192.168.1.100:6666 \ + --vhost-client EAL options are the same as primary process. Here is a list of application options of ``spp_mirror``. @@ -537,14 +567,15 @@ SPP provides ``spp_pcap`` for capturing comparatively heavy traffic. .. code-block:: console $ sudo ./src/pcap/x86_64-native-linuxapp-gcc/spp_pcap \ - -l 2-5 -n 4 \ - --proc-type secondary \ - -- \ - --client-id 1 \ - -s 192.168.1.100:6666 \ - -c phy:0 \ - --out-dir /path/to/dir \ - --fsize 107374182 + -l 2-5 -n 4 \ + --proc-type secondary \ + --file-prefix $SPP_FILE_PREFIX \ + -- \ + --client-id 1 \ + -s 192.168.1.100:6666 \ + -c phy:0 \ + --out-dir /path/to/dir \ + --fsize 107374182 EAL options are the same as primary process. Here is a list of application options of ``spp_pcap``. @@ -758,6 +789,7 @@ launching DPDK processes. --huge-dir=/dev/hugepages \ --proc-type=primary \ --base-virtaddr 0x100000000 + --file-prefix $SPP_FILE_PREFIX \ -- \ -p 0x03 \ -n 6 \ diff --git a/docs/guides/usecases/spp_mirror.rst b/docs/guides/usecases/spp_mirror.rst index 3830820..4164a16 100644 --- a/docs/guides/usecases/spp_mirror.rst +++ b/docs/guides/usecases/spp_mirror.rst @@ -7,6 +7,11 @@ spp_mirror ========== +.. note:: + + ``--file-prefix`` option is not required in this section because there is + not DPDK application other than SPP. + Duplicate Packets ----------------- diff --git a/docs/guides/usecases/spp_pcap.rst b/docs/guides/usecases/spp_pcap.rst index 9149a43..543538d 100644 --- a/docs/guides/usecases/spp_pcap.rst +++ b/docs/guides/usecases/spp_pcap.rst @@ -7,6 +7,11 @@ spp_pcap ======== +.. note:: + + ``--file-prefix`` option is not required in this section because there is + not DPDK application other than SPP. + Packet Capture -------------- diff --git a/docs/guides/usecases/spp_vf.rst b/docs/guides/usecases/spp_vf.rst index f17c0dc..ee18439 100644 --- a/docs/guides/usecases/spp_vf.rst +++ b/docs/guides/usecases/spp_vf.rst @@ -10,6 +10,11 @@ spp_vf ``spp_vf`` is a secondary process for providing L2 classification as a simple pusedo SR-IOV features. +.. note:: + + ``--file-prefix`` option is not required in this section because there is + not DPDK application other than SPP. + .. _spp_usecases_vf_cls_icmp: Classify ICMP Packets -- 2.17.1