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 1/3] spp_mirror: add spp_mirror common define and func
Date: Wed, 21 Nov 2018 10:36:15 +0900	[thread overview]
Message-ID: <201811210136.wAL1aHmd009759@imss03.silk.ntt-tx.co.jp> (raw)
In-Reply-To: <20181121013617.8938-1-x-fn-spp@sl.ntt-tx.co.jp>

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

Add common defines and functions for spp_mirror.

Signed-off-by: Hideyuki Yamashita <yamashita.hideyuki@po.ntt-tx.co.jp>
Signed-off-by: Naoki Takada <takada.naoki@lab.ntt.co.jp>
---
 src/vf/common/command_dec.c  |  6 ++++++
 src/vf/common/command_proc.c |  9 +++++++++
 src/vf/common/spp_proc.c     |  6 ++++++
 src/vf/common/spp_proc.h     | 17 ++++++++++-------
 4 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/src/vf/common/command_dec.c b/src/vf/common/command_dec.c
index 84268de..9f56eba 100644
--- a/src/vf/common/command_dec.c
+++ b/src/vf/common/command_dec.c
@@ -201,6 +201,12 @@ spp_convert_component_type(const char *type_str)
 		return SPP_COMPONENT_FORWARD;
 	}
 #endif /* SPP_VF_MODULE */
+#ifdef SPP_MIRROR_MODULE
+	if (strncmp(type_str, SPP_TYPE_MIRROR_STR,
+			strlen(SPP_TYPE_MIRROR_STR)+1) == 0)
+		/* Mirror */
+		return SPP_COMPONENT_MIRROR;
+#endif /* SPP_MIRROR_MODULE */
 	return SPP_COMPONENT_UNUSE;
 }
 
diff --git a/src/vf/common/command_proc.c b/src/vf/common/command_proc.c
index f274707..e6a9fab 100644
--- a/src/vf/common/command_proc.c
+++ b/src/vf/common/command_proc.c
@@ -14,6 +14,9 @@
 #include "../classifier_mac.h"
 #include "../spp_forward.h"
 #endif /* SPP_VF_MODULE */
+#ifdef SPP_MIRROR_MODULE
+#include "../../mirror/spp_mirror.h"
+#endif /* SPP_MIRROR_MODULE */
 #include "command_conn.h"
 #include "command_dec.h"
 #include "command_proc.h"
@@ -482,6 +485,12 @@ spp_iterate_core_info(struct spp_iterate_core_params *params)
 						params);
 			}
 #endif /* SPP_VF_MODULE */
+#ifdef SPP_MIRROR_MODULE
+			ret = spp_mirror_get_component_status(
+						lcore_id,
+						core->id[cnt],
+						params);
+#endif /* SPP_MIRROR_MODULE */
 			if (unlikely(ret != 0)) {
 				RTE_LOG(ERR, APP, "Cannot iterate core "
 						"information. "
diff --git a/src/vf/common/spp_proc.c b/src/vf/common/spp_proc.c
index 5119612..abbd5d5 100644
--- a/src/vf/common/spp_proc.c
+++ b/src/vf/common/spp_proc.c
@@ -18,6 +18,9 @@
 #include "../spp_forward.h"
 #include "../classifier_mac.h"
 #endif /* SPP_VF_MODULE */
+#ifdef SPP_MIRROR_MODULE
+#include "../../mirror/spp_mirror.h"
+#endif /* SPP_MIRROR_MODULE */
 
 /* Manage data to addoress */
 struct manage_data_addr_info {
@@ -888,6 +891,9 @@ flush_component(void)
 		else
 			ret = spp_forward_update(component_info);
 #endif /* SPP_VF_MODULE */
+#ifdef SPP_MIRROR_MODULE
+		ret = spp_mirror_update(component_info);
+#endif /* SPP_MIRROR_MODULE */
 		if (unlikely(ret < 0)) {
 			RTE_LOG(ERR, APP, "Flush error. "
 					"( component = %s, type = %d)\n",
diff --git a/src/vf/common/spp_proc.h b/src/vf/common/spp_proc.h
index a6de55c..8bb43ec 100644
--- a/src/vf/common/spp_proc.h
+++ b/src/vf/common/spp_proc.h
@@ -21,9 +21,10 @@
  */
 /** Identifier string for each component (status command) */
 #define SPP_TYPE_CLASSIFIER_MAC_STR "classifier_mac"
-#define SPP_TYPE_MERGE_STR          "merge"
-#define SPP_TYPE_FORWARD_STR        "forward"
-#define SPP_TYPE_UNUSE_STR          "unuse"
+#define SPP_TYPE_MERGE_STR	    "merge"
+#define SPP_TYPE_FORWARD_STR	    "forward"
+#define SPP_TYPE_MIRROR_STR	    "mirror"
+#define SPP_TYPE_UNUSE_STR	    "unuse"
 
 /** Identifier string for each interface */
 #define SPP_IFTYPE_NIC_STR   "phy"
@@ -72,8 +73,9 @@
  */
 /* Name string for each component */
 #define CORE_TYPE_CLASSIFIER_MAC_STR "classifier_mac"
-#define CORE_TYPE_MERGE_STR          "merge"
-#define CORE_TYPE_FORWARD_STR        "forward"
+#define CORE_TYPE_MERGE_STR	     "merge"
+#define CORE_TYPE_FORWARD_STR	     "forward"
+#define CORE_TYPE_MIRROR_STR	     "mirror"
 
 /* State on component */
 enum spp_core_status {
@@ -89,8 +91,9 @@ enum spp_core_status {
 enum spp_component_type {
 	SPP_COMPONENT_UNUSE,          /**< Not used */
 	SPP_COMPONENT_CLASSIFIER_MAC, /**< Classifier_mac */
-	SPP_COMPONENT_MERGE,          /**< Merger */
-	SPP_COMPONENT_FORWARD,        /**< Forwarder */
+	SPP_COMPONENT_MERGE,	      /**< Merger */
+	SPP_COMPONENT_FORWARD,	      /**< Forwarder */
+	SPP_COMPONENT_MIRROR,	      /**< Mirror */
 };
 
 /* Classifier Type */
-- 
2.18.0

       reply	other threads:[~2018-11-21  1:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181121013617.8938-1-x-fn-spp@sl.ntt-tx.co.jp>
2018-11-21  1:36 ` x-fn-spp [this message]
2018-11-21  1:36 ` [spp] [PATCH 2/3] spp_mirror: add spp_mirror x-fn-spp
2018-11-21  1:36 ` [spp] [PATCH 3/3] spp_mirror: add Makefile for spp_mirror x-fn-spp

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=201811210136.wAL1aHmd009759@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).