Soft Patch Panel
 help / color / mirror / Atom feed
From: x-fn-spp@sl.ntt-tx.co.jp
To: ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Cc: spp@dpdk.org
Subject: [spp] [PATCH 2/2] docs: add data management for command process
Date: Tue, 12 Feb 2019 21:39:28 +0900	[thread overview]
Message-ID: <201902121239.x1CCdT0w028829@imss03.silk.ntt-tx.co.jp> (raw)
In-Reply-To: <20190212123928.25057-1-x-fn-spp@sl.ntt-tx.co.jp>

From: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>

spp_vf and spp_mirror takes 2 step approach when reflecting
data after reception of command input.
This patch add explanation about with the actual code.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 docs/guides/spp_vf/explain/functions_vf.rst | 42 +++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/docs/guides/spp_vf/explain/functions_vf.rst b/docs/guides/spp_vf/explain/functions_vf.rst
index c915655..46499db 100644
--- a/docs/guides/spp_vf/explain/functions_vf.rst
+++ b/docs/guides/spp_vf/explain/functions_vf.rst
@@ -421,3 +421,45 @@ For distributing multicast packet, it is cloned with
                             (long)classifier_info->active_classifieds[i]);
             }
     }
+
+Data management for command processing
+--------------------------------------
+``spp_vf`` has two data areas for for port, component and core.
+One is called reference area and other is called updating area.
+The reason is for having two data areas is that updating
+reference area which is referred by packet transmitting process
+directly may lead inconsistency when transmitting packet.
+When ``spp_vf`` process command, it changes pointer of reference
+area and updating area so that data which is referred by transmitting
+process is changed.
+
+The following code shows how flush is called inside spp_vf.
+You can read that data is flushed in the order of port, core and component.
+
+Note that ``spp_vf`` and ``spp_mirror`` has code logic in common and
+the above rule applies to also on ``spp_mirror``.
+
+.. code-block:: c
+
+        spp_flush(void)
+        {
+                int ret = SPP_RET_NG;
+                struct cancel_backup_info *backup_info = NULL;
+
+                spp_get_mng_data_addr(NULL, NULL, NULL,
+                                        NULL, NULL, NULL, &backup_info);
+
+                /* Initial setting of each interface. */
+                ret = flush_port();
+                        if (ret < SPP_RET_OK)
+                        return ret;
+
+                /* Flush of core index. */
+                flush_core();
+
+                /* Flush of component */
+                ret = flush_component();
+
+                backup_mng_info(backup_info);
+                return ret;
+        }
-- 
2.17.1

      parent reply	other threads:[~2019-02-12 12:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190212123928.25057-1-x-fn-spp@sl.ntt-tx.co.jp>
2019-02-12 12:39 ` [spp] [PATCH 1/2] docs: add explanation of port number check x-fn-spp
2019-02-12 12:39 ` x-fn-spp [this message]

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=201902121239.x1CCdT0w028829@imss03.silk.ntt-tx.co.jp \
    --to=x-fn-spp@sl.ntt-tx.co.jp \
    --cc=ferruh.yigit@intel.com \
    --cc=ogawa.yasufumi@lab.ntt.co.jp \
    --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).