From: ogawa.yasufumi@lab.ntt.co.jp
To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp
Subject: [spp] [PATCH] spp_vf: move libs of classifier from common
Date: Wed, 8 May 2019 11:00:30 +0900 [thread overview]
Message-ID: <1557280830-7774-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> (raw)
From: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
Struct `management_info` is for containing attributes of classifier, but
included in common libs unnecessarily. It is because vf siblings use
common function `spp_command_proc_do` for parsing user command and
`management_info` is referred from the function.
It should be moved to as a local function of spp_vf, not common. This
update is to fix this issue. The names of these should be refactored
because of ambiguity in a future update.
Signed-off-by: Yasufumi Ogawa <ogawa.yasufumi@lab.ntt.co.jp>
---
.../secondary/spp_worker_th/command_proc.c | 29 +------------
src/vf/classifier_mac.c | 41 +++++++++++++++++++
2 files changed, 42 insertions(+), 28 deletions(-)
diff --git a/src/shared/secondary/spp_worker_th/command_proc.c b/src/shared/secondary/spp_worker_th/command_proc.c
index 2fc1829..1e16bd0 100644
--- a/src/shared/secondary/spp_worker_th/command_proc.c
+++ b/src/shared/secondary/spp_worker_th/command_proc.c
@@ -9,13 +9,10 @@
#include <rte_branch_prediction.h>
#include "vf_deps.h"
+#include "mirror_deps.h"
#include "spp_port.h"
#include "string_buffer.h"
-#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"
@@ -102,30 +99,6 @@ const char *CLASSIFILER_TYPE_STATUS_STRINGS[] = {
/* termination */ "",
};
-/* uninitialize classifier. */
-static void
-uninit_classifier(struct management_info *mng_info)
-{
- int i;
-
- mng_info->is_used = 0;
-
- for (i = 0; i < NUM_CLASSIFIER_MAC_INFO; ++i)
- uninit_component_info(mng_info->cmp_infos + (long)i);
-
- memset(mng_info, 0, sizeof(struct management_info));
-}
-
-/* initialize classifier information. */
-void
-init_classifier_info(int component_id)
-{
- struct management_info *mng_info = NULL;
-
- mng_info = g_mng_infos + component_id;
- uninit_classifier(mng_info);
-}
-
/* get client id */
static int
spp_get_client_id(void)
diff --git a/src/vf/classifier_mac.c b/src/vf/classifier_mac.c
index a7ccd78..b49cf14 100644
--- a/src/vf/classifier_mac.c
+++ b/src/vf/classifier_mac.c
@@ -50,6 +50,47 @@
/* VID of VLAN untagged */
#define VLAN_UNTAGGED_VID 0x0fff
+/* classifier management information */
+struct management_info {
+ /* classifier information */
+ struct component_info cmp_infos[NUM_CLASSIFIER_MAC_INFO];
+
+ /* Reference index number for classifier information */
+ volatile int ref_index;
+
+ /* Update index number for classifier information */
+ volatile int upd_index;
+
+ /* used flag */
+ volatile int is_used;
+};
+
+struct management_info g_mng_infos[RTE_MAX_LCORE];
+
+/* uninitialize classifier. */
+static void
+uninit_classifier(struct management_info *mng_info)
+{
+ int i;
+
+ mng_info->is_used = 0;
+
+ for (i = 0; i < NUM_CLASSIFIER_MAC_INFO; ++i)
+ uninit_component_info(mng_info->cmp_infos + (long)i);
+
+ memset(mng_info, 0, sizeof(struct management_info));
+}
+
+/* initialize classifier information. */
+void
+init_classifier_info(int component_id)
+{
+ struct management_info *mng_info = NULL;
+
+ mng_info = g_mng_infos + component_id;
+ uninit_classifier(mng_info);
+}
+
/*
* hash table name buffer size
*[reson for value]
--
2.17.1
reply other threads:[~2019-05-08 2:02 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=1557280830-7774-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp \
--to=ogawa.yasufumi@lab.ntt.co.jp \
--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).